• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDialog and JFrame *HELP* !!!

Donald Wedding
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.getContentPane().add(new JLabel("hi there"));
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic