Bring JFrame JDialog Window to front java swing

To bring JFrame or JDialog ... or Window (JFrame and JDialog inherits Window)   to front in JAVA, fun the code below :

java.awt.EventQueue.invokeLater(new Runnable() {
    @Override
    //myFrame is object of Window or JFrame
    public void run() {
        myFrame.toFront();
        myFrame.repaint();
    }
});

No comments :

Post a Comment

Your Comment and Question will help to make this blog better...