import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class displayFullScreen extends JFrame {
private JLabel alarmMessage = new JLabel(
The invocation of setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); does not close the frame, it will define the behaviour when the windows decoration [X] close button is pressed (Which you have disabled for full screen).
You could replace this with setVisible(false); or exit your programm.