This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Constructing modified JOptionPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Constructing modified JOptionPane" Watch "Constructing modified JOptionPane" New topic

Constructing modified JOptionPane

Douglas Kent
Ranch Hand

Joined: Oct 06, 2000
Posts: 171
I need to adapt a JOptionPane to allow users to drag the text from the pane. I construct an instance:

Problem is, the pane does not show, presumably disappearing as soon as it's shown. I do not see any methods for making it modal. When I use the

call, it behaves properly.
How do I ensure that it's showing and that it should be modal?
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
JOptionPane pane = new JOptionPane ("My Text");
JDialog dialog = pane.createDialog(...);
Douglas Kent
Ranch Hand

Joined: Oct 06, 2000
Posts: 171
Thanks for the assist. The copying of text is not working. Has anyone done the adaptation of a normally non-Drag n Drop object to allow dragging text? Should not the object provide a visual clue on the dragging, ie: hi-liting of the dragged text? The code implementing the drag and drop from the Sun Java Tutorial:
I agree. Here's the link:
subject: Constructing modified JOptionPane
It's not a secret anymore!