wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Message dialog box displaying behind the main frame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Message dialog box displaying behind the main frame" Watch "Message dialog box displaying behind the main frame" New topic
Author

Message dialog box displaying behind the main frame

aity myles
Greenhorn

Joined: Jun 14, 2011
Posts: 11
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

Joined: Jul 19, 2011
Posts: 175

Actually I think you need to paste some code of yours because normally this wouldn't happen.


Please correct my English.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4522
    
    5

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.


luck, db
There are no new questions, but there may be new answers.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Message dialog box displaying behind the main frame
 
Similar Threads
PrinterJob
JDialog &Modal.
Parent and child window cncept in java swing
How to access parent JFrame component from its Child frame
JFrame or JDialog