- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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
- Related Articles
- Set Bounds for JProgressBar in Java Swing
- How to display a tkinter application in fullscreen on macOS?
- How to create a borderless fullscreen application using Python-3 Tkinter?
- Java Program to set Selection Mode for JList only for single selection
- How to set a different look and feels to swing components in Java?
- How to set the fill-mode for an Animation with CSS
- How to set a verbose mode in JShell in Java 9?
- How to maximize JFrame in Java Swing
- How can I set an icon for my Android application?
- How can I set an icon for my iOS application?
- How to change Button Border in Java Swing
- How to make a canvas in Java Swing?
- How to add JTable to Panel in Java Swing?
- How to Create Fullscreen API using JavaScript?
- How to display row count in Java Swing JList

Advertisements