title: The constructor WindowEvent(WelcomeWindow, int) is undefined
body: <p>Trying to implement a  close method for my Windowalthough java is giving a me a</p>
  
  <p>"The constructor WindowEvent(WelcomeWindow, int) is undefined":ERROR</p>
  
  <p>Line giving Error "WindowEvent winClosingEvent = <strong>new WindowEvent(this,WindowEvent.WINDOW_CLOSING);</strong>"</p>
  
  <p>Can you please help me out</p>
  
  <pre><code>public class WelcomeWindow {
  
      private JFrame frame;
  
      /**
       * Launch the application.
       */
      public static void main(String[] args) {
          EventQueue.invokeLater(new Runnable() {
              public void run() {
                  try {
                      WelcomeWindow window = new WelcomeWindow();
                      window.frame.setVisible(true);
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
              }
          });
      }
  
      /**
       * Create the application.
       */
      public WelcomeWindow() {
          initialize();
      }
  
  
      /**
       * Initialize the contents of the frame.
       */
      private void initialize() {
          frame = new JFrame();
          frame.setBounds(100, 100, 248, 357);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          GridBagLayout gridBagLayout = new GridBagLayout();
          gridBagLayout.columnWidths = new int[]{86, 0, 79, 0};
          gridBagLayout.rowHeights = new int[]{0, 0, 0, 0, 0, 0, 0};
          gridBagLayout.columnWeights = new double[]{0.0, 0.0, 0.0, Double.MIN_VALUE};
          gridBagLayout.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
          frame.getContentPane().setLayout(gridBagLayout);
  
          JButton btnNewButton = new JButton("Shop");
          btnNewButton.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
  
              }
          });
          GridBagConstraints gbc_btnNewButton = new GridBagConstraints();
          gbc_btnNewButton.insets = new Insets(0, 0, 5, 5);
          gbc_btnNewButton.gridx = 1;
          gbc_btnNewButton.gridy = 2;
          frame.getContentPane().add(btnNewButton, gbc_btnNewButton);
  
          JButton btnNewButton_1 = new JButton("Manage Store");
          GridBagConstraints gbc_btnNewButton_1 = new GridBagConstraints();
          gbc_btnNewButton_1.insets = new Insets(0, 0, 5, 5);
          gbc_btnNewButton_1.gridx = 1;
          gbc_btnNewButton_1.gridy = 3;
          frame.getContentPane().add(btnNewButton_1, gbc_btnNewButton_1);
  
          JButton btnManageUsers = new JButton("Manage Users");
          GridBagConstraints gbc_btnManageUsers = new GridBagConstraints();
          gbc_btnManageUsers.insets = new Insets(0, 0, 0, 5);
          gbc_btnManageUsers.gridx = 1;
          gbc_btnManageUsers.gridy = 5;
          frame.getContentPane().add(btnManageUsers, gbc_btnManageUsers);
      }
      public void close(){
          WindowEvent winClosingEvent = new WindowEvent(this,WindowEvent.WINDOW_CLOSING);
          Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(winClosingEvent);
      }
  
  }
  </code></pre>