Here you can find the source of toFront(JFrame frame)
public static void toFront(JFrame frame)
//package com.java2s; import java.awt.Frame; import javax.swing.JFrame; public class Main { public static void toFront(JFrame frame) { if (frame.getExtendedState() >= Frame.MAXIMIZED_BOTH) { frame.setExtendedState(Frame.MAXIMIZED_BOTH); } else if (frame.getExtendedState() > Frame.NORMAL) { frame.setExtendedState(Frame.NORMAL); }//from www . j a v a2s .c o m frame.setVisible(true); } }