import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.Toolkit;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
/**
* swing jframe全屏显示无边框
* @author ZFang
*/
public class FullScreenDemo {
private static final JLabel label = new JLabel(new ImageIcon("C:\\ZFang.jpg"));
public static void main(String[] args) {
JFrame jframe = new JFrame();
// jframe.getContentPane().setLayout(new FlowLayout());
jframe.getContentPane().add(label);
//卸掉窗口装饰 title栏 最小化最大化关闭按钮等
jframe.setUndecorated(false);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Rectangle bounds = new Rectangle(screenSize);
jframe.setBounds(bounds);
jframe.setUndecorated(true);
//一直在最上层显示
jframe.setAlwaysOnTop(true);
jframe.setVisible(true);
}
}