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