Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import javax.swing.JFrame;
- public class Test{
- public static void main(String[] args) {
- GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
- GraphicsDevice device = env.getDefaultScreenDevice();
- JFrame myFrame = new JFrame("Title");
- myFrame.setUndecorated(true);
- myFrame.setResizable(false);
- myFrame.setSize(600,600);
- myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- device.setFullScreenWindow(myFrame);
- sleep(1000);
- device.setFullScreenWindow(null);
- myFrame.dispose();
- myFrame.setUndecorated(false);
- myFrame.setVisible(true);
- sleep(5000);
- myFrame.dispose();
- System.exit(0);
- }
- public static void sleep(long millis) {
- try{
- Thread.sleep(millis);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement