It's not a secret anymore!*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes JDialog and JFrame *HELP* !!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "JDialog and JFrame *HELP* !!!" Watch "JDialog and JFrame *HELP* !!!" New topic
Author

JDialog and JFrame *HELP* !!!

Donald Wedding
Ranch Hand

Joined: Aug 28, 2001
Posts: 72

Here's what I am trying to accomplish.
I have a "JFrame" with some data on it contained inside of a JTable.
When I click on some data in the JTable, I want a JDialog box to pop up.
I need the box to be in the foreground and to be modal.
However, when I run my code to JDialog box goes BEHIND my JFrame. Since the JDialog is Modal and it is behind the JFrame, I can't get to it to do anything. My screen is locked up.
How can I do what I want to do? By the way, I have to use SWING because the requirements for the SCJD exam won't let me use any AWT.
Here's the code I'm using.
/////////
public void mouseClicked( MouseEvent ev )
{
JDialog dialog = new JDialog();
dialog.setEnabled(true);
dialog.setModal(true);
dialog.getContentPane().add(new JLabel("hi there"));
dialog.setVisible(true);
dialog.pack();
dialog.show();
}
/////////////////////
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDialog and JFrame *HELP* !!!
 
Similar Threads
jtable
JDialog and JFrame *HELP* !!!
Clone JTable
JDialog Question
JTable ........