Bring JPanel To Front Of Other Objects In Java (SWING)
Answer : So here you have at least two solutions. Either go with what @Geoff and @sthupahsmaht are suggesting. BTW also possible is to use JOptionPane which automatically creates a dialog for you. The other option would be to use a GlassPane from a frame. Or yet another option is to use JLayeredPane as @jzd suggests. EDIT: Example showing how to use GlassPane to capture user selections. Try following steps: 1.Left clicking on the glass pane visible at start. See the output. 2.Right click it. This hides the glass pane. 3.Left clicking on the content pane. See the output. 4.Right click it. Go to point 1. Enjoy. import java.awt.Color; import java.awt.Dimension; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.SwingUtilities; public class OverPanel extends JPanel { private static void createAndShowGUI() { final JFrame f = new JFrame(); f.setPreferred...