Re: Using Copy (Ctrl-C) functionality with disabled JTextFields
From: Brad BARCLAY (bbarclay_at_jsyncmanager.org)
Date: 11/25/03
- Previous message: DaiIchi: "Re: Tomcat configuration question"
- In reply to: JMBollard: "Using Copy (Ctrl-C) functionality with disabled JTextFields"
- Next in thread: JMBollard: "Re: Using Copy (Ctrl-C) functionality with disabled JTextFields"
- Reply: JMBollard: "Re: Using Copy (Ctrl-C) functionality with disabled JTextFields"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 24 Nov 2003 23:42:06 GMT
JMBollard wrote:
> I am working on a Swing application (Java 1.4 ) and I am having
> trouble implementing the following functionality:
> A JTextField that should not be part of focus traversal (should
> not be tabbed to), but the text can be selected and copied (Ctrl-C).
Okay -- first off, Ctrl-C isn't Copy on every platform. Many use
Shift-Insert instead. So if you're coding a platform-neutral
application, don't hard-code Ctrl-C -- let the OS take care of it.
As to your specific issue, if you don't want to simply remove the
JTextField from the tab order, why not just disable it (as I'm assuming
you want to do) and then put a "Copy" button beside it that will take
its output and send it to the clipboard through the proper Transferrable
object? Seems to be the easiest way to me.
Brad BARCLAY
-- =-=-=-=-=-=-=-=-= From the OS/2 WARP v4.5 Desktop of Brad BARCLAY. The jSyncManager Project: http://www.jsyncmanager.org
- Previous message: DaiIchi: "Re: Tomcat configuration question"
- In reply to: JMBollard: "Using Copy (Ctrl-C) functionality with disabled JTextFields"
- Next in thread: JMBollard: "Re: Using Copy (Ctrl-C) functionality with disabled JTextFields"
- Reply: JMBollard: "Re: Using Copy (Ctrl-C) functionality with disabled JTextFields"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]