
Java Fullscreen "Good Bye"
Java Source Code that will make the hole screen black and in large green letters
"Good Bye"
Code:
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.awt.Frame;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Label;
import java.awt.Window;
import javax.swing.*;
public class Client {
public void view() {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice myDevice = ge.getDefaultScreenDevice();
JPanel panel = new JPanel();
JFrame frame = new JFrame(myDevice.getDefaultConfiguration());
frame.setContentPane(panel);
Window myWindow = new Window(frame);
myWindow.setBackground(Color.black);
JLabel label = new JLabel("Good Bye");
label.setFont(new Font("sansserif", Font.BOLD, 250));
label.setForeground(Color.green);
myWindow.add(label, BorderLayout.CENTER);
try {
myDevice.setFullScreenWindow(myWindow);
} catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
Client client = new Client();
client.view();
}
}