• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Constructing modified JOptionPane

 
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic