 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to set fullscreen mode for Java Swing Application?
To set fullscreen mode for your Java Swing application, use the setFullScreenWindow() method:
GraphicsDevice device = graphics.getDefaultScreenDevice(); JFrame frame = new JFrame("Fullscreen"); device.setFullScreenWindow(frame); The following is an example to set fullscreen mode for Java Swing Application:
Example
import java.awt.Color; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; public class SwingDemo {    public static void main(String[] args) {       GraphicsEnvironment graphics =       GraphicsEnvironment.getLocalGraphicsEnvironment();       GraphicsDevice device = graphics.getDefaultScreenDevice();       JFrame frame = new JFrame("Fullscreen");       JPanel panel = new JPanel();       JLabel label = new JLabel("", JLabel.CENTER);       label.setText("This is in fullscreen mode!");       label.setOpaque(true);       frame.add(panel);       frame.add(label);       frame.setUndecorated(true);       frame.setResizable(false);       device.setFullScreenWindow(frame);    } } The output is as follows that displays the application in FullScreen:
Output

Advertisements
 