Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Constructing modified JOptionPane

 
Douglas Kent
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
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?
thanks...
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JOptionPane pane = new JOptionPane ("My Text");
JDialog dialog = pane.createDialog(...);
dialog.setModal(true);
 
Douglas Kent
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
LabelDnD.java
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic