File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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!