Good day. There is code in which the FSFullScreenActionPerformed function does not work. It does not work, as I understand it, because I do not know who to set the setContentPane() parameter to. What needs to be fixed in the code to make it work?
public class DIVISION extends JFrame { int hor,vert,ma,mb; String[] Language = { "English", "Русский", }; String tNewGame="Новая Игра"; String tSettings="Настройки"; String tExit="Выход"; String tFullScreen="Полноэкранный режим"; /* tNewGame="New Game"; tSettings="Settings"; tExit="Exit"; tFullScreen="Full Screen"; */ private JPanel MainMenu; private JButton MMNGame; private JButton MMSettings; private JButton MMExit; private JPanel FullSettingsMenu; private JButton FSMBack; private JCheckBox FSFullScreen; private JComboBox FSSetLanguage; private JPanel Menu; private JButton MExit; private JButton MBack; private JButton MSettings; private JPanel SettingsMenu; private JButton SMBack; public DIVISION() { initComponents(); } private void initComponents() { Dimension sSize = Toolkit.getDefaultToolkit().getScreenSize(); vert = sSize.height; hor = sSize.width; //Setings of window// setSize(hor,vert); setResizable(false); setUndecorated(true); setDefaultCloseOperation(EXIT_ON_CLOSE); //----------------// //Setings of buttons// ma=(hor/4);//height// mb=(vert/10);//width// //------------------// MainMenu = new JPanel(); MainMenu.setLayout(null);MainMenu.setBackground(Color.blue); MMNGame = new JButton(tNewGame); MMNGame.setSize(ma, mb); MMNGame.setLocation((hor/2)-(ma/2),300); MMNGame.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { MMNGameActionPerformed(evt); } }); MMSettings = new JButton(tSettings); MMSettings.setSize(ma, mb); MMSettings.setLocation((hor/2)-(ma/2),400); MMSettings.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { MMSettingsActionPerformed(evt); } }); MMExit = new JButton(tExit); MMExit.setSize(ma, mb); MMExit.setLocation((hor/2)-(ma/2),500); MMExit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { MMExitActionPerformed(evt); } }); MainMenu.add(MMNGame);MainMenu.add(MMSettings);MainMenu.add(MMExit); FullSettingsMenu = new JPanel(); FullSettingsMenu.setLayout(null);FullSettingsMenu.setBackground(Color.orange); FSMBack = new JButton("\u21B6"); FSMBack.setSize(50, 50); FSMBack.setLocation(0,0); FSMBack.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { FSMBackActionPerformed(evt); } }); FSFullScreen = new JCheckBox(tFullScreen); FSFullScreen.setSize(ma, mb); FSFullScreen.setLocation((hor/2)-(ma/2),400); FSFullScreen.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { FSFullScreenActionPerformed(evt); } }); FSSetLanguage = new JComboBox(Language); FSSetLanguage.setSize(ma, mb); FSSetLanguage.setLocation((hor/2)-(ma/2),500); FullSettingsMenu.add(FSMBack);FullSettingsMenu.add(FSFullScreen);FullSettingsMenu.add(FSSetLanguage); SettingsMenu = new JPanel(); SettingsMenu.setLayout(null);SettingsMenu.setBackground(Color.green); SMBack = new JButton("\u21B6"); SMBack.setSize(ma, mb); SMBack.setLocation((hor/2)-(ma/2),300); SMBack.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { SMBackActionPerformed(evt); } }); SettingsMenu.add(SMBack); Menu = new JPanel(); Menu.setLayout(null);Menu.setBackground(Color.red); MBack = new JButton("\u21B6"); MBack.setSize(50, 50); MBack.setLocation(0,0); MBack.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { MBackActionPerformed(evt); } }); MSettings = new JButton(tSettings); MSettings.setSize(ma, mb); MSettings.setLocation((hor/2)-(ma/2),400); MSettings.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { MSettingsActionPerformed(evt); } }); MExit = new JButton(tExit); MExit.setSize(ma, mb); MExit.setLocation((hor/2)-(ma/2),500); MExit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { MExitActionPerformed(evt); } }); Menu.add(MBack); Menu.add(MSettings); Menu.add(MExit); add(MainMenu); } private void MMNGameActionPerformed(ActionEvent evt) { // } private void MMSettingsActionPerformed(ActionEvent evt) { this.setContentPane(FullSettingsMenu); revalidate(); repaint(); } private void MMExitActionPerformed(ActionEvent evt) { Exit(); } private void FSMBackActionPerformed(ActionEvent evt) { this.setContentPane(MainMenu); revalidate(); repaint(); } private void FSFullScreenActionPerformed(ActionEvent evt) { if(FSFullScreen.isSelected()==true){ setContentPane(FullSettingsMenu); revalidate(); repaint(); setUndecorated(true); } else{ setContentPane(FullSettingsMenu); revalidate(); repaint(); setUndecorated(false); } } private void MBackActionPerformed(ActionEvent evt) { // } private void MSettingsActionPerformed(ActionEvent evt) { this.setContentPane(SettingsMenu); revalidate(); repaint(); } private void MExitActionPerformed(ActionEvent evt) { Exit(); } private void SMBackActionPerformed(ActionEvent evt) { this.setContentPane(Menu); revalidate(); repaint(); } public void ButtonFocus(){ } public void Exit(){ System.exit(0); } public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new DIVISION().setVisible(true); } }); } }