Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class FullScreenTest
- {
- GraphicsDevice device;
- public FullScreenTest()
- {
- GraphicsEnvironment ge = GraphicsEnvironment
- .getLocalGraphicsEnvironment();
- device = ge.getDefaultScreenDevice();
- GraphicsConfiguration gc = device
- .getDefaultConfiguration();
- try {
- JFrame frame = new JFrame(gc);
- frame.setUndecorated(true);
- JButton button = new JButton("OK");
- button.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- device.setFullScreenWindow(null);
- System.exit(0);
- }
- });
- frame.getContentPane().add(button);
- device.setFullScreenWindow(frame);
- frame.setVisible(true);
- } catch (Exception ex) {
- device.setFullScreenWindow(null);
- System.exit(0);
- }
- }
- public static void main(String[] args)
- {
- FullScreenTest test = new FullScreenTest();
- }
- }
Add Comment
Please, Sign In to add comment