java全屏代码
2018-07-20 来源:open-open
import java.awt.*; import javax.swing.JFrame; public class FullScreenTest extends JFrame { public static void main(String[] args) { DisplayMode displayMode; if (args.length == 3) { displayMode = new DisplayMode( Integer.parseInt(args[0]), Integer.parseInt(args[1]), Integer.parseInt(args[2]), DisplayMode.REFRESH_RATE_UNKNOWN); } else { displayMode = new DisplayMode(800, 600, 16, DisplayMode.REFRESH_RATE_UNKNOWN); } FullScreenTest test = new FullScreenTest(); test.run(displayMode); } private static final long DEMO_TIME = 5000; public void run(DisplayMode displayMode) { setBackground(Color.blue); setForeground(Color.white); setFont(new Font("Dialog", 0, 24)); SimpleScreenManager screen = new SimpleScreenManager(); try { screen.setFullScreen(displayMode, this); try { Thread.sleep(DEMO_TIME); } catch (InterruptedException ex) { } } finally { screen.restoreScreen(); } } public void paint(Graphics g) { g.drawString("Hello World!", 20, 50); } }
标签: isp
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点!
本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。
最新资讯
热门推荐