Пример #1
0
  /**
   * This method is called from within the constructor to initialize the form. WARNING: Do NOT
   * modify this code. The content of this method is always regenerated by the Form Editor.
   */
  private void initComponents() {
    TitlePanel = new javax.swing.JPanel();
    NameLabel = new javax.swing.JLabel();
    DataPanel = new javax.swing.JPanel();

    getContentPane()
        .setLayout(new javax.swing.BoxLayout(getContentPane(), javax.swing.BoxLayout.Y_AXIS));

    addWindowListener(
        new java.awt.event.WindowAdapter() {
          public void windowClosing(java.awt.event.WindowEvent evt) {
            closeDialog(evt);
          }
        });

    TitlePanel.setMaximumSize(new java.awt.Dimension(32767, 36));
    NameLabel.setFont(new java.awt.Font("Verdana", Font.BOLD, 18));
    NameLabel.setForeground(java.awt.Color.black);
    NameLabel.setText("Client");
    TitlePanel.add(NameLabel);

    getContentPane().add(TitlePanel);

    getContentPane().add(DataPanel);

    // setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
  }
Пример #2
0
  TitleFrame() {
    setSize(797, 550);
    setResizable(false);
    setTitle("Mouse Mouse");
    setLocationRelativeTo(null);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    // Add opening panel
    tp.add(cont, BorderLayout.SOUTH);
    add(tp);

    // When button is clicked, set contClicked true
    cont.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            dispose();
            InstructionFrame inst = new InstructionFrame();
            inst.setVisible(true);
          }
        });
  }