Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / May 2004

Tip: Looking for answers? Try searching our database.

JTextArea copy/paste

Thread view: 
Roedy Green - 28 May 2004 01:07 GMT
I have discovered that JTextAreas behave differently from TextAreas.

You can select text, but when you hit Ctrl-C nothing happens. You
can't copy the selection to the clipboard.

I'm in an unsigned JApplet so I can't poke the clipboard myself.

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

Andrew Thompson - 28 May 2004 02:14 GMT
> I have discovered that JTextAreas behave differently from TextAreas.
>
> You can select text, but when you hit Ctrl-C nothing happens. You
> can't copy the selection to the clipboard.

One of the reasons I prefer AWT for
applets like this.
<http://www.physci.org/pc/properties.jsp>

You can copy (^c) the text of any of the fields
using either MSVM or Sun 1.4.2 JRE.

Signature

Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology

Roedy Green - 28 May 2004 08:09 GMT
>I have discovered that JTextAreas behave differently from TextAreas.
>
>You can select text, but when you hit Ctrl-C nothing happens. You
>can't copy the selection to the clipboard.
>
>I'm in an unsigned JApplet so I can't poke the clipboard myself.

Discovered something else a bit strange.  I tried changing my
component from a JTextArea to a TextArea but left everything else as
Swing.  Ctrl-C still did not work.  I can select but not copy.
 

This is in an unsigned Applet.

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

Roedy Green - 28 May 2004 08:35 GMT
>I have discovered that JTextAreas behave differently from TextAreas.
>
>You can select text, but when you hit Ctrl-C nothing happens. You
>can't copy the selection to the clipboard.
>
>I'm in an unsigned JApplet so I can't poke the clipboard myself.

I have been reading up on what you have to do to make Ctrl-C Ctrl-V
work normally in a Signed applet.  barf!

Get real Sun.

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

Dag Sunde - 28 May 2004 09:33 GMT
> >I have discovered that JTextAreas behave differently from TextAreas.
> >
[quoted text clipped - 7 lines]
>
> Get real Sun.

Can you please post a pointer to that/those articles?

TIA!

--
Dag
58?26'15.9" N 008?46'45.5" E
Roedy Green - 28 May 2004 19:47 GMT
>Can you please post a pointer to that/those articles?

google "Swing copy cut paste TransferHandler"
Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

Pedro - 29 May 2004 10:33 GMT
> I have discovered that JTextAreas behave differently from TextAreas.
>
> You can select text, but when you hit Ctrl-C nothing happens. You
> can't copy the selection to the clipboard.
>
> I'm in an unsigned JApplet so I can't poke the clipboard myself.

As you're talking about an *unsigned* applet: probably the Java sandbox prevents access to the
system clipboard. Using 'policytool' of the JRE, you could add  "AWTPermission"  "accessClipboard"
to grant the applet permission to access the clipboard.

Regards,
Pedro
Roedy Green - 29 May 2004 19:46 GMT
>As you're talking about an *unsigned* applet: probably the Java sandbox prevents access to the
>system clipboard. Using 'policytool' of the JRE, you could add  "AWTPermission"  "accessClipboard"
>to grant the applet permission to access the clipboard.

Not for a wild Applet though. The code in question is the JDisplay
Applet which I use for displaying/downloading source code on my
website.

I think my only option at this point is to revert to AWT and live with
the extra scrollbars I don't need.

see http://mindprod.com/projects/javapresenter.html
http://mindprod.com/jgloss/wildapplet.html

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.