aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Getting JOprionPane to appear within the confines of JFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Getting JOprionPane to appear within the confines of JFrame" Watch "Getting JOprionPane to appear within the confines of JFrame" New topic
Author

Getting JOprionPane to appear within the confines of JFrame

Rich Charlton
Greenhorn

Joined: Nov 11, 2004
Posts: 19
Ive written medium sized program with a sizeable GUI and am having problems scoping my JOptionPanes to appear in the confines of my main JFrame. This has become a big problem for me and i have tried lots of things to solve it but nothing has worked. The Dialogs that im having trouble with all reside in actionListeners and then some reside in if statements once in the actionlistener method etc. For example:

Customer Class:


All the optionpanes im having problem with are in bold. The options below all compile but do not move the JOptionPanes anywhere. I need them within the confines of the main frame.

I need help if anyone is helpful....

Thanks a lot.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
a few changes

addActionListener(new SelectButton());
to
addActionListener(new SelectButton(datecombos));//4 of these

the constructor for SelectButton


the JOptionPanes then change to (note parent)
JOptionPane.showMessageDialog(parent, "There are no showings...etc)
Rich Charlton
Greenhorn

Joined: Nov 11, 2004
Posts: 19
This has been a great help.

Thanks a lot Michael.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting JOprionPane to appear within the confines of JFrame