Exemple #1
0
  public ArenaFrame(String title, Arena arena, String background, String battleBG, String cardBG) {
    setTitle(title);
    this.arena = arena;
    Toolkit tk = Toolkit.getDefaultToolkit();
    Dimension screenSize = tk.getScreenSize();
    width = (int) screenSize.getWidth();
    height = (int) screenSize.getHeight();
    posX = (width - Constant.BATTLEFIELD_WIDTH) / 2;
    posY = (height - Constant.BATTLEFIELD_HEIGHT - Constant.CARDPANEL_HEIGHT) / 2;
    skill_id = 0;
    addKeyListener(this);
    addMouseListener(this);
    addMouseMotionListener(this);

    setUndecorated(true);
    setExtendedState(JFrame.MAXIMIZED_BOTH);
    c = getContentPane();
    c.setPreferredSize(new Dimension(width, height));
    c.setLayout(null);

    battle_field =
        new BattleFieldPanel(Constant.BATTLEFIELD_WIDTH, Constant.BATTLEFIELD_HEIGHT, arena);
    battle_field.setBounds(posX, posY, Constant.BATTLEFIELD_WIDTH, Constant.BATTLEFIELD_HEIGHT);
    battle_field.setOpaque(false);
    c.add(battle_field);

    card_panel = new CardPanel(Constant.CARDPANEL_WIDTH, Constant.CARDPANEL_HEIGHT, arena);
    card_panel.setBounds(
        posX,
        posY + Constant.BATTLEFIELD_HEIGHT,
        Constant.CARDPANEL_WIDTH,
        Constant.CARDPANEL_HEIGHT);
    card_panel.setOpaque(false);
    c.add(card_panel);

    setSize(width, height);

    setBackground(background);
    setBattleFieldBackground(battleBG);
    setCardPanelBackground(cardBG);

    setResizable(false);
    setLocationRelativeTo(null);

    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    pack();
    setVisible(true);
    setFocusable(true);
  }
Exemple #2
0
  public Animation() {
    String[] keys = {"no Animator found"};
    if (tryDir(".")) // || tryDir("BLM305") || tryDir("CSE470"))
    keys = map.keySet().toArray(keys);
    System.out.println(map.size() + " classes loaded");
    menu = new JComboBox(keys);

    pan.setLayout(new BorderLayout(GAP, GAP - 4));
    pan.setBorder(new javax.swing.border.EmptyBorder(GAP, GAP, GAP, GAP));
    pan.setBackground(COLOR);

    last = new JPanel();
    last.setPreferredSize(DIM);
    pan.add(last, "Center");

    ref.setFont(NORM);
    ref.setEditable(false);
    ref.setColumns(35);
    ref.setDragEnabled(true);
    pan.add(ref, "North");

    pan.add(bottomPanel(), "South");

    pan.setToolTipText("A collective project for BLM320");
    menu.setToolTipText("Animator classes");
    who.setToolTipText("author()");
    ref.setToolTipText("description()");

    Closer ear = new Closer();
    menu.addActionListener(ear);
    stop.addActionListener(ear);
    frm.addWindowListener(ear);

    if (map.size() > 0) setItem(0);
    frm.setContentPane(pan);
    frm.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    frm.setLocation(scaled(120), scaled(90));
    frm.pack(); // setSize() is called here
    frm.setVisible(true);
    start();
  }
    private void initComponents() {
      label1 = new JLabel();
      comboBox1 = new JComboBox();
      button1 = new JButton();

      // ======== this ========
      setTitle("SneakyFarmer");
      Container contentPane = getContentPane();
      contentPane.setLayout(null);

      // ---- label1 ----
      label1.setText("Which herb to farm:");
      label1.setFont(label1.getFont().deriveFont(label1.getFont().getSize() + 1f));
      contentPane.add(label1);
      label1.setBounds(10, 10, 125, 35);

      // ---- comboBox1 ----
      comboBox1.setModel(
          new DefaultComboBoxModel(
              new String[] {
                "Guam",
                "Marrentill",
                "Tarromin",
                "Harralander",
                "Ranarr",
                "Toadflax",
                "Irit",
                "Avantoe",
                "Kwuarm",
                "Snapdragon",
                "Cadantine",
                "Lantadyme",
                "Dwarf Weed",
                "Torstol"
              }));
      contentPane.add(comboBox1);
      comboBox1.setBounds(135, 10, 90, 35);

      // ---- button1 ----
      button1.setText("Start Farming!");
      button1.setFont(button1.getFont().deriveFont(button1.getFont().getSize() + 7f));
      contentPane.add(button1);
      button1.setBounds(10, 50, 215, 35);
      button1.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              startActionPerformed(e);
            }
          });

      { // compute preferred size
        Dimension preferredSize = new Dimension();
        for (int i = 0; i < contentPane.getComponentCount(); i++) {
          Rectangle bounds = contentPane.getComponent(i).getBounds();
          preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
          preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
        }
        Insets insets = contentPane.getInsets();
        preferredSize.width += insets.right;
        preferredSize.height += insets.bottom;
        contentPane.setMinimumSize(preferredSize);
        contentPane.setPreferredSize(preferredSize);
      }
      pack();
      setLocationRelativeTo(getOwner());
    }
  /** Creates a ComponentTree, loading the Components from the file at <code>path</code>. */
  public ComponentTree(String path) {
    this.path = path;
    ttCount++;
    jTextArea = new JTextArea();
    textArea = new JTextArea();
    redirectSystemStreams();
    frame = createFrame();
    Container cPane = frame.getContentPane();
    JMenuBar mb = createMenuBar();
    TreeTableModel model = createModel(path);

    cPane.setLayout(new BorderLayout(5, 5));
    Dimension dim = new Dimension(600, 600);
    cPane.setPreferredSize(dim);

    try {
      textArea.read(new FileReader(path), null);
    } catch (IOException e) {
      e.printStackTrace(); // To change body of catch statement use File | Settings | File
      // Templates.
    }
    treeTable = createTreeTable(model);
    textArea.setEditable(false);

    JScrollPane tp =
        new JScrollPane(
            textArea,
            ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    JScrollPane sp =
        new JScrollPane(
            treeTable,
            ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    JScrollPane cp =
        new JScrollPane(
            jTextArea,
            ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    sp.getViewport().setBackground(Color.white);

    Dimension scrDim = new Dimension(300, 600);
    Dimension dime = new Dimension(300, 400);
    Dimension dimc = new Dimension(300, 200);
    sp.setLocation(0, 0);
    sp.setPreferredSize(dime);
    tp.setLocation(300, 0);
    tp.setPreferredSize(scrDim);
    cp.setLocation(0, 400);
    cp.setPreferredSize(dimc);
    cPane.add(sp, BorderLayout.LINE_START);
    cPane.add(tp, BorderLayout.CENTER);
    cPane.add(cp, BorderLayout.PAGE_END);
    cPane.setPreferredSize(dim);

    // frame.add(cPane);
    frame.setJMenuBar(mb);
    // frame.pack();

    frame.setVisible(true);
  }
Exemple #5
0
  private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Evaluation license - Chance Turner
    mainMenuBar = new JMenuBar();
    maintenanceMenu = new JMenu();
    editStore = new JMenuItem();
    editItem = new JMenuItem();
    editTaxCategory = new JMenuItem();
    editCashier = new JMenuItem();
    editRegister = new JMenuItem();
    menu1 = new JMenu();
    loginToPos = new JMenuItem();
    menu2 = new JMenu();
    dailySalesReportMenuItem = new JMenuItem();
    itemSalesReportMenuItem = new JMenuItem();
    cashierSalesReportMenuItem = new JMenuItem();
    panel1 = new JPanel();

    // ======== this ========
    Container contentPane = getContentPane();
    contentPane.setLayout(null);

    // ======== mainMenuBar ========
    {

      // ======== maintenanceMenu ========
      {
        maintenanceMenu.setText("Maintenance");

        // ---- editStore ----
        editStore.setText("Edit Store");
        editStore.addActionListener(
            new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                editStoreActionPerformed(e);
              }
            });
        maintenanceMenu.add(editStore);

        // ---- editItem ----
        editItem.setText("Edit Item");
        editItem.addActionListener(
            new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                editItemActionPerformed(e);
              }
            });
        maintenanceMenu.add(editItem);

        // ---- editTaxCategory ----
        editTaxCategory.setText("Edit Tax Category");
        editTaxCategory.addActionListener(
            new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                editTaxCategoryActionPerformed(e);
              }
            });
        maintenanceMenu.add(editTaxCategory);

        // ---- editCashier ----
        editCashier.setText("Edit Cashier");
        editCashier.addActionListener(
            new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                editCashierActionPerformed(e);
              }
            });
        maintenanceMenu.add(editCashier);

        // ---- editRegister ----
        editRegister.setText("Edit Register");
        editRegister.addActionListener(
            new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                editRegisterActionPerformed(e);
              }
            });
        maintenanceMenu.add(editRegister);
      }
      mainMenuBar.add(maintenanceMenu);

      // ======== menu1 ========
      {
        menu1.setText("POS");

        // ---- loginToPos ----
        loginToPos.setText("Login");
        loginToPos.addActionListener(
            new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                loginToPosActionPerformed(e);
              }
            });
        menu1.add(loginToPos);
      }
      mainMenuBar.add(menu1);

      // ======== menu2 ========
      {
        menu2.setText("Reports");

        // ---- dailySalesReportMenuItem ----
        dailySalesReportMenuItem.setText("Daily Sales");
        dailySalesReportMenuItem.addActionListener(
            new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                dailySalesReportMenuItemActionPerformed(e);
              }
            });
        menu2.add(dailySalesReportMenuItem);

        // ---- itemSalesReportMenuItem ----
        itemSalesReportMenuItem.setText("Item Sales");
        itemSalesReportMenuItem.addActionListener(
            new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                itemSalesReportMenuItemActionPerformed(e);
              }
            });
        menu2.add(itemSalesReportMenuItem);

        // ---- cashierSalesReportMenuItem ----
        cashierSalesReportMenuItem.setText("Cashier Sales");
        cashierSalesReportMenuItem.addActionListener(
            new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                cashierSalesReportMenuItemActionPerformed(e);
              }
            });
        menu2.add(cashierSalesReportMenuItem);
      }
      mainMenuBar.add(menu2);
    }
    setJMenuBar(mainMenuBar);

    // ======== panel1 ========
    {

      // JFormDesigner evaluation mark
      panel1.setBorder(
          new javax.swing.border.CompoundBorder(
              new javax.swing.border.TitledBorder(
                  new javax.swing.border.EmptyBorder(0, 0, 0, 0),
                  "JFormDesigner Evaluation",
                  javax.swing.border.TitledBorder.CENTER,
                  javax.swing.border.TitledBorder.BOTTOM,
                  new java.awt.Font("Dialog", java.awt.Font.BOLD, 12),
                  java.awt.Color.red),
              panel1.getBorder()));
      panel1.addPropertyChangeListener(
          new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent e) {
              if ("border".equals(e.getPropertyName())) throw new RuntimeException();
            }
          });

      panel1.setLayout(null);

      { // compute preferred size
        Dimension preferredSize = new Dimension();
        for (int i = 0; i < panel1.getComponentCount(); i++) {
          Rectangle bounds = panel1.getComponent(i).getBounds();
          preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
          preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
        }
        Insets insets = panel1.getInsets();
        preferredSize.width += insets.right;
        preferredSize.height += insets.bottom;
        panel1.setMinimumSize(preferredSize);
        panel1.setPreferredSize(preferredSize);
      }
    }
    contentPane.add(panel1);
    panel1.setBounds(0, 0, 580, 415);

    { // compute preferred size
      Dimension preferredSize = new Dimension();
      for (int i = 0; i < contentPane.getComponentCount(); i++) {
        Rectangle bounds = contentPane.getComponent(i).getBounds();
        preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
        preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
      }
      Insets insets = contentPane.getInsets();
      preferredSize.width += insets.right;
      preferredSize.height += insets.bottom;
      contentPane.setMinimumSize(preferredSize);
      contentPane.setPreferredSize(preferredSize);
    }
    pack();
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
  }
  Client(String[] args) {
    //
    // Initialize an Ice communicator.
    //
    try {
      com.zeroc.Ice.InitializationData initData = new com.zeroc.Ice.InitializationData();
      initData.properties = com.zeroc.Ice.Util.createProperties();
      initData.properties.load("config.client");
      initData.dispatcher =
          (runnable, connection) -> {
            SwingUtilities.invokeLater(runnable);
          };
      _communicator = com.zeroc.Ice.Util.initialize(args, initData).communicator;
    } catch (Throwable ex) {
      handleException(ex);
    }

    Container cp = this;

    JLabel l1 = new JLabel("Hostname");
    _hostname = new JTextField();
    JLabel l2 = new JLabel("Mode");
    _mode = new JComboBox<String>();
    JLabel l3 = new JLabel("Timeout");
    _timeoutSlider = new JSlider(0, MAX_TIME);
    _timeoutLabel = new JLabel("0.0");
    JLabel l4 = new JLabel("Delay");
    _delaySlider = new JSlider(0, MAX_TIME);
    _delayLabel = new JLabel("0.0");
    JPanel buttonPanel = new JPanel();
    _hello = new JButton("Hello World!");
    _shutdown = new JButton("Shutdown");
    _flush = new JButton("Flush");
    _flush.setEnabled(false);
    JSeparator statusPanelSeparator = new JSeparator();
    _status = new JLabel();
    _status.setText("Ready");

    //
    // Default to localhost.
    //
    _hostname.setText("127.0.0.1");
    _hostname
        .getDocument()
        .addDocumentListener(
            new DocumentListener() {
              @Override
              public void changedUpdate(DocumentEvent e) {
                updateProxy();
              }

              @Override
              public void insertUpdate(DocumentEvent e) {
                if (e.getDocument().getLength() > 0) {
                  _hello.setEnabled(true);
                  _shutdown.setEnabled(true);
                }
                updateProxy();
              }

              @Override
              public void removeUpdate(DocumentEvent e) {
                if (e.getDocument().getLength() == 0) {
                  _hello.setEnabled(false);
                  _shutdown.setEnabled(false);
                  _flush.setEnabled(false);
                }
                updateProxy();
              }
            });

    _mode.setModel(new DefaultComboBoxModel<String>(DELIVERY_MODE_DESC));

    _hello.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            sayHello();
          }
        });
    _shutdown.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            shutdown();
          }
        });
    _flush.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            flush();
          }
        });
    _mode.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            changeDeliveryMode(_mode.getSelectedIndex());
          }
        });
    changeDeliveryMode(_mode.getSelectedIndex());

    _timeoutSlider.addChangeListener(new SliderListener(_timeoutSlider, _timeoutLabel));
    _timeoutSlider.addChangeListener(
        new ChangeListener() {
          @Override
          public void stateChanged(ChangeEvent ce) {
            updateProxy();
          }
        });
    _timeoutSlider.setValue(0);
    _delaySlider.addChangeListener(new SliderListener(_delaySlider, _delayLabel));
    _delaySlider.setValue(0);

    GridBagConstraints gridBagConstraints;

    cp.setMaximumSize(null);
    cp.setPreferredSize(null);
    cp.setLayout(new GridBagLayout());

    l1.setText("Hostname");
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = GridBagConstraints.WEST;
    gridBagConstraints.insets = new Insets(5, 5, 5, 5);
    cp.add(l1, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new Insets(5, 0, 5, 5);
    cp.add(_hostname, gridBagConstraints);

    l2.setText("Mode");
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.anchor = GridBagConstraints.WEST;
    gridBagConstraints.insets = new Insets(0, 5, 5, 0);
    cp.add(l2, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new Insets(0, 0, 5, 5);
    cp.add(_mode, gridBagConstraints);

    l3.setText("Timeout");
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.anchor = GridBagConstraints.WEST;
    gridBagConstraints.insets = new Insets(0, 5, 5, 0);
    cp.add(l3, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = GridBagConstraints.WEST;
    cp.add(_timeoutSlider, gridBagConstraints);

    _timeoutLabel.setMinimumSize(new Dimension(20, 17));
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.anchor = GridBagConstraints.WEST;
    gridBagConstraints.insets = new Insets(0, 5, 5, 5);
    cp.add(_timeoutLabel, gridBagConstraints);

    l4.setText("Delay");
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.anchor = GridBagConstraints.WEST;
    gridBagConstraints.insets = new Insets(0, 5, 5, 0);
    cp.add(l4, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = GridBagConstraints.WEST;
    cp.add(_delaySlider, gridBagConstraints);

    _delayLabel.setMinimumSize(new Dimension(20, 17));
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.anchor = GridBagConstraints.WEST;
    gridBagConstraints.insets = new Insets(0, 5, 5, 5);
    cp.add(_delayLabel, gridBagConstraints);

    _hello.setText("Hello World!");
    buttonPanel.add(_hello);

    _shutdown.setText("Shutdown");
    buttonPanel.add(_shutdown);

    _flush.setText("Flush");
    buttonPanel.add(_flush);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.gridwidth = 3;
    gridBagConstraints.ipady = 5;
    cp.add(buttonPanel, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.gridwidth = 3;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new Insets(0, 5, 5, 5);
    cp.add(statusPanelSeparator, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.gridwidth = 3;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new Insets(0, 5, 5, 5);
    cp.add(_status, gridBagConstraints);

    setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);

    _shutdownHook =
        new Thread("Shutdown hook") {
          @Override
          public void run() {
            destroyCommunicator();
          }
        };

    try {
      Runtime.getRuntime().addShutdownHook(_shutdownHook);
    } catch (IllegalStateException e) {
      //
      // Shutdown in progress, ignored
      //
    }

    addWindowListener(
        new WindowAdapter() {
          @Override
          public void windowClosing(WindowEvent e) {
            destroyCommunicator();
            Runtime.getRuntime().removeShutdownHook(_shutdownHook);
            dispose();
            Runtime.getRuntime().exit(0);
          }
        });

    setTitle("Ice - Hello World!");
    pack();
    locateOnScreen(this);
    setVisible(true);
  }
Exemple #7
0
  private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Evaluation license - Octavio Maia
    label1 = new JLabel();
    comboBox1 = new JComboBox<>();
    label2 = new JLabel();
    data = new JLabel();
    buttonDataNascimento = new JButton();
    buttonCancelar = new JButton();
    buttonAvancar = new JButton();
    separator1 = new JSeparator();
    dialogoCalendar = new JDialog();
    calendar1 = new JCalendar();
    buttonConfirmarDataInicio = new JButton();
    buttonCancelarData = new JButton();

    // ======== this ========
    setTitle("Criar Elei\u00e7\u00e3o");
    setResizable(false);
    setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    Container contentPane = getContentPane();
    contentPane.setLayout(null);

    // ---- label1 ----
    label1.setText("Tipo de elei\u00e7\u00e3o:");
    label1.setFont(new Font("Arial", Font.PLAIN, 14));
    contentPane.add(label1);
    label1.setBounds(10, 10, label1.getPreferredSize().width, 25);

    // ---- comboBox1 ----
    comboBox1.setFont(new Font("Arial", Font.PLAIN, 14));
    comboBox1.setModel(
        new DefaultComboBoxModel<>(
            new String[] {"Assembleia da Rep\u00fablica", "Presid\u00eancia da Rep\u00fablica"}));
    contentPane.add(comboBox1);
    comboBox1.setBounds(125, 10, 215, 25);

    // ---- label2 ----
    label2.setText("Data:");
    label2.setFont(new Font("Arial", Font.PLAIN, 14));
    contentPane.add(label2);
    label2.setBounds(10, 50, 101, 25);

    // ---- data ----
    data.setText("dd/mm/aa");
    data.setFont(new Font("Arial", Font.PLAIN, 14));
    contentPane.add(data);
    data.setBounds(125, 50, 115, 25);

    // ---- buttonDataNascimento ----
    buttonDataNascimento.setText("Alterar");
    buttonDataNascimento.setFont(new Font("Arial", Font.PLAIN, 14));
    buttonDataNascimento.addActionListener(e -> buttonDataActionPerformed(e));
    contentPane.add(buttonDataNascimento);
    buttonDataNascimento.setBounds(260, 50, 80, 25);

    // ---- buttonCancelar ----
    buttonCancelar.setText("Cancelar");
    buttonCancelar.setFont(new Font("Arial", Font.PLAIN, 14));
    buttonCancelar.addActionListener(e -> buttonCancelarActionPerformed(e));
    contentPane.add(buttonCancelar);
    buttonCancelar.setBounds(100, 90, 115, 25);

    // ---- buttonAvancar ----
    buttonAvancar.setText("Avan\u00e7ar");
    buttonAvancar.setFont(new Font("Arial", Font.PLAIN, 14));
    buttonAvancar.setEnabled(false);
    buttonAvancar.addActionListener(e -> buttonAvancarActionPerformed(e));
    contentPane.add(buttonAvancar);
    buttonAvancar.setBounds(230, 90, 110, buttonAvancar.getPreferredSize().height);
    contentPane.add(separator1);
    separator1.setBounds(5, 80, 340, 5);

    { // compute preferred size
      Dimension preferredSize = new Dimension();
      for (int i = 0; i < contentPane.getComponentCount(); i++) {
        Rectangle bounds = contentPane.getComponent(i).getBounds();
        preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
        preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
      }
      Insets insets = contentPane.getInsets();
      preferredSize.width += insets.right;
      preferredSize.height += insets.bottom;
      contentPane.setMinimumSize(preferredSize);
      contentPane.setPreferredSize(preferredSize);
    }
    setSize(365, 160);
    setLocationRelativeTo(null);

    // ======== dialogoCalendar ========
    {
      dialogoCalendar.setTitle("Calendario");
      dialogoCalendar.setResizable(false);
      dialogoCalendar.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
      Container dialogoCalendarContentPane = dialogoCalendar.getContentPane();
      dialogoCalendarContentPane.setLayout(null);
      dialogoCalendarContentPane.add(calendar1);
      calendar1.setBounds(0, 0, 210, 155);

      // ---- buttonConfirmarDataInicio ----
      buttonConfirmarDataInicio.setText("Confirmar");
      buttonConfirmarDataInicio.setFont(new Font("Arial", Font.PLAIN, 12));
      buttonConfirmarDataInicio.addActionListener(e -> buttonConfirmarDataActionPerformed(e));
      dialogoCalendarContentPane.add(buttonConfirmarDataInicio);
      buttonConfirmarDataInicio.setBounds(5, 155, 90, 28);

      // ---- buttonCancelarData ----
      buttonCancelarData.setText("Cancelar");
      buttonCancelarData.setFont(new Font("Arial", Font.PLAIN, 12));
      buttonCancelarData.addActionListener(e -> buttonCancelarDataActionPerformed(e));
      dialogoCalendarContentPane.add(buttonCancelarData);
      buttonCancelarData.setBounds(110, 155, 90, 28);

      dialogoCalendarContentPane.setPreferredSize(new Dimension(225, 235));
      dialogoCalendar.setSize(225, 235);
      dialogoCalendar.setLocationRelativeTo(null);
    }
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
  }