• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Message dialog box displaying behind the main frame

 
aity myles
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks, i have an application that consists of a main Jframe, a parent JPanel(serves as the background to the main frame) and a child JPanel(placed inside the parent JPanel). The problem is that each time i click on a button(in the child Jpanel) to display a message dialog box(created from the JOptionPane class), the message dialog box goes behind the main JFrame. i want the message dialog box to be displayed on the child JPanel so that i wont have to minimize the main JFrame window before responding on the message dialog box. Does anyone have an idea how i resolve this problem
 
Manuel Petermann
Ranch Hand
Posts: 177
Hibernate Linux Python
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I think you need to paste some code of yours because normally this wouldn't happen.
 
Darryl Burke
Bartender
Posts: 5115
11
Java Netbeans IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a parent JPanel(serves as the background to the main frame)

A JFrame's contentPane is already a JPanel. There's no need to duplicate it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic