• 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

How do you use javax.swing.Popup?

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a panel that displays a lot of information and is setup the way that I want it to look. I'm trying to get a window/JFrame to appear after a user clicks a button on the GUI already open. I want that new window to have the panel inside of it.

Should I be using JOptionPane.showOptionDialog or should I be using javax.swing.Popup? Could someone show a simple example of using javax.swing.Popup in action? Please :-)
 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question is far too vague, but I would guess you should use a JDialog.
 
Sebastion Hill
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well I guess just an example of how one would make a JFrame appear as a Popup using javax.swing.Popup?

JPanel panel = new JPanel(); //contains my whole setup
JFrame frame = new JFrame();
frame.add(panel, BORDERLAYOUT.CENTER);
Popup popUp = new Popup();
popUp(frame,panel,100,100) ???
popUp.show();

...

I don't know how to use the Popup class. Can someone show me how I would use it with the code above?
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Checkout PopupFactory API docs.
Also check out JPopupMenu.
You have already been suggested the JOptionPane.showXXXDialog
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic