コード例 #1
0
 private void initComponentsI18n() {
   // JFormDesigner - Component i18n initialization - DO NOT MODIFY  //GEN-BEGIN:initI18n
   DefaultComponentFactory.setTextAndMnemonic(
       _titleAppearance, I18N._I("PreferencesWin.titleAppearance.textWithMnemonic"));
   DefaultComponentFactory.setTextAndMnemonic(
       _titleIndentation, I18N._I("PreferencesWin.titleIndentation.textWithMnemonic"));
   _lblHotkey.setText(I18N._I("prefCaptureHotkey"));
   _lblDelay.setText(I18N._I("prefCaptureDelay"));
   _lblDelaySecs.setText(I18N._I("prefSeconds"));
   _lblNaming.setText(I18N._I("prefAutoNaming"));
   _radTimestamp.setText(I18N._I("prefTimestamp"));
   _radOCR.setText(I18N._I("prefRecognizedText"));
   _radOff.setText(I18N._I("prefManualInput"));
   _tabPane.setTitleAt(0, I18N._I("prefTabScreenCapturing"));
   _chkExpandTab.setText(I18N._I("PreferencesWin.chkExpandTab.text"));
   _lblTabWidth.setText(I18N._I("PreferencesWin.lblTabWidth.text"));
   _lblFont.setText(I18N._I("PreferencesWin.lblFont.text"));
   _lblFontSize.setText(I18N._I("PreferencesWin.lblFontSize.text"));
   _tabPane.setTitleAt(1, I18N._I("PreferencesWin.paneTextEditing.tab.title"));
   _chkAutoUpdate.setText(I18N._I("prefGeneralAutoCheck"));
   _lblUpdates.setText(I18N._I("PreferencesWin.lblUpdates.text"));
   _lblLanguage.setText(I18N._I("PreferencesWin.lblLanguage.text"));
   _tabPane.setTitleAt(2, I18N._I("prefTabGeneralSettings"));
   _btnOk.setText(I18N._I("ok"));
   _btnApply.setText(I18N._I("apply"));
   _btnCancel.setText(I18N._I("cancel"));
   // JFormDesigner - End of component i18n initialization  //GEN-END:initI18n
 }
コード例 #2
0
ファイル: UI.java プロジェクト: mhartopo/Gomoku
  /**
   * Initialize the contents of the frame.
   *
   * @throws IOException
   */
  private void initialize() throws IOException {
    frmGomoku = new JFrame();
    frmGomoku.setTitle("GOMOKU");
    frmGomoku.setBounds(150, 20, 1000, 670);
    frmGomoku.setResizable(false);
    frmGomoku.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    frmGomoku.addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            try {
              listener.close();
            } catch (IOException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
            }
          }
        });
    frmGomoku.getContentPane().add(layeredPane);
    setLayeredPane();
    JLabel lblGomoku = DefaultComponentFactory.getInstance().createTitle("G . O . M . O . K . U");
    lblGomoku.setFont(new Font("Roboto", Font.BOLD, 20));
    lblGomoku.setBounds(425, 11, 205, 38);
    layeredPane.add(lblGomoku);

    textField = new TextField();
    textField.setBounds(764, 27, 182, 22);
    layeredPane.add(textField);

    textField_1 = new TextField();
    textField_1.setBounds(764, 74, 182, 22);
    layeredPane.add(textField_1);

    button = new Button("Maiin");
    button.setBackground(Color.WHITE);

    button.setBounds(764, 106, 105, 22);
    layeredPane.add(button);
    Label label = new Label("Nama");
    label.setBounds(689, 27, 62, 22);
    layeredPane.add(label);
    Label label_1 = new Label("Nama room");
    label_1.setBounds(689, 74, 69, 22);
    layeredPane.add(label_1);

    lblGiiliran = DefaultComponentFactory.getInstance().createLabel("");
    lblGiiliran.setFont(new Font("Tahoma", Font.BOLD, 15));
    lblGiiliran.setBounds(689, 221, 257, 22);
    layeredPane.add(lblGiiliran);

    lblRoom = DefaultComponentFactory.getInstance().createLabel("");
    lblRoom.setFont(new Font("Tahoma", Font.PLAIN, 14));
    lblRoom.setBounds(689, 170, 257, 22);
    layeredPane.add(lblRoom);
    listener = new ServerSocket(PORT);
  }
コード例 #3
0
  private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY
    // //GEN-BEGIN:initComponents
    ResourceBundle bundle = ResourceBundle.getBundle("messages");
    DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
    separator1 = compFactory.createSeparator("Contact");
    panelMain = new JPanel();
    lblFirstName = new JLabel();
    txtFirstName = new JTextField();
    lblLastName = new JLabel();
    txtLastName = new JTextField();
    tabbedPane = new JTabbedPane();
    panelActions = new JPanel();
    btnAccept = new JButton();
    btnCancel = new JButton();
    CellConstraints cc = new CellConstraints();

    // ======== this ========
    setTitle("Dialog Contact");
    Container contentPane = getContentPane();
    contentPane.setLayout(
        new FormLayout(
            "11dlu, $lcgap, 170dlu:grow, $lcgap, 25dlu",
            "2*(default, $lgap), 37dlu, $lgap, default, $lgap, 79dlu:grow, 2*($lgap, default)"));
    contentPane.add(separator1, cc.xy(3, 3));

    // ======== panelMain ========
    {
      panelMain.setLayout(new FormLayout("73dlu, $lcgap, 111dlu", "2*(default, $lgap), default"));

      // ---- lblFirstName ----
      lblFirstName.setText("First name:");
      lblFirstName.setLabelFor(txtFirstName);
      panelMain.add(lblFirstName, cc.xy(1, 1));
      panelMain.add(txtFirstName, cc.xy(3, 1));

      // ---- lblLastName ----
      lblLastName.setText("Last name:");
      lblLastName.setLabelFor(txtLastName);
      panelMain.add(lblLastName, cc.xy(1, 3));
      panelMain.add(txtLastName, cc.xy(3, 3));
    }
    contentPane.add(panelMain, cc.xy(3, 5));

    // ======== tabbedPane ========
    {
      tabbedPane.setTabPlacement(SwingConstants.LEFT);
      tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
    }
    contentPane.add(tabbedPane, cc.xywh(3, 9, 1, 1, CellConstraints.FILL, CellConstraints.FILL));

    // ======== panelActions ========
    {
      panelActions.setLayout(new FormLayout("default:grow, 2*($lcgap, default)", "default"));

      // ---- btnAccept ----
      btnAccept.setText(bundle.getString("common.accept"));
      btnAccept.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              btnAcceptActionPerformed(e);
            }
          });
      panelActions.add(btnAccept, cc.xy(3, 1));

      // ---- btnCancel ----
      btnCancel.setText(bundle.getString("common.cancel"));
      btnCancel.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              btnCancelActionPerformed(e);
            }
          });
      panelActions.add(btnCancel, cc.xy(5, 1));
    }
    contentPane.add(panelActions, cc.xy(3, 11));
    setSize(525, 370);
    setLocationRelativeTo(getOwner());
    // //GEN-END:initComponents
  }
コード例 #4
0
  private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
    _tabPane = new JTabbedPane();
    JPanel paneCapture = new JPanel();
    _txtHotkey = new JTextField();
    _lblHotkey = new JLabel();
    _lblDelay = new JLabel();
    _spnDelay = new JSpinner();
    _lblDelaySecs = new JLabel();
    _lblNaming = new JLabel();
    _radTimestamp = new JRadioButton();
    _radOCR = new JRadioButton();
    _radOff = new JRadioButton();
    _paneTextEditing = new JPanel();
    _chkExpandTab = new JCheckBox();
    _lblTabWidth = new JLabel();
    _cmbFontName = new JComboBox();
    _lblFont = new JLabel();
    _titleAppearance = compFactory.createTitle("");
    _titleIndentation = compFactory.createTitle("");
    _spnTabWidth = new JSpinner();
    _lblFontSize = new JLabel();
    _spnFontSize = new JSpinner();
    JPanel paneGeneral = new JPanel();
    _chkAutoUpdate = new JCheckBox();
    _cmbLang = new JComboBox();
    _lblUpdates = new JLabel();
    _lblLanguage = new JLabel();
    JPanel paneOkCancel = new JPanel();
    JPanel hSpacer1 = new JPanel(null);
    _btnOk = new JButton();
    _btnApply = new JButton();
    _btnCancel = new JButton();

    // ======== this ========
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    // ======== _tabPane ========
    {
      _tabPane.setBorder(new EmptyBorder(10, 10, 0, 10));

      // ======== paneCapture ========
      {

        // ---- _txtHotkey ----
        _txtHotkey.setHorizontalAlignment(SwingConstants.RIGHT);
        _txtHotkey.addFocusListener(
            new FocusAdapter() {
              @Override
              public void focusGained(FocusEvent e) {
                txtHotkeyFocusGained(e);
              }
            });
        _txtHotkey.addKeyListener(
            new KeyAdapter() {
              @Override
              public void keyPressed(KeyEvent e) {
                txtHotkeyKeyPressed(e);
              }
            });

        // ---- _lblHotkey ----
        _lblHotkey.setLabelFor(_txtHotkey);

        // ---- _lblDelay ----
        _lblDelay.setLabelFor(_spnDelay);

        // ---- _spnDelay ----
        _spnDelay.setModel(new SpinnerNumberModel(1.0, 0.0, null, 0.1));

        // ---- _radTimestamp ----
        _radTimestamp.setSelected(true);

        GroupLayout paneCaptureLayout = new GroupLayout(paneCapture);
        paneCapture.setLayout(paneCaptureLayout);
        paneCaptureLayout.setHorizontalGroup(
            paneCaptureLayout
                .createParallelGroup()
                .add(
                    paneCaptureLayout
                        .createSequentialGroup()
                        .add(26, 26, 26)
                        .add(
                            paneCaptureLayout
                                .createParallelGroup()
                                .add(GroupLayout.TRAILING, _lblDelay)
                                .add(GroupLayout.TRAILING, _lblHotkey)
                                .add(GroupLayout.TRAILING, _lblNaming))
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(
                            paneCaptureLayout
                                .createParallelGroup()
                                .add(_radTimestamp)
                                .add(_radOCR)
                                .add(_radOff)
                                .add(
                                    paneCaptureLayout
                                        .createSequentialGroup()
                                        .add(
                                            _spnDelay,
                                            GroupLayout.DEFAULT_SIZE,
                                            148,
                                            Short.MAX_VALUE)
                                        .addPreferredGap(LayoutStyle.RELATED)
                                        .add(
                                            _lblDelaySecs,
                                            GroupLayout.DEFAULT_SIZE,
                                            161,
                                            Short.MAX_VALUE))
                                .add(_txtHotkey, GroupLayout.DEFAULT_SIZE, 315, Short.MAX_VALUE))
                        .add(69, 69, 69)));
        paneCaptureLayout.setVerticalGroup(
            paneCaptureLayout
                .createParallelGroup()
                .add(
                    paneCaptureLayout
                        .createSequentialGroup()
                        .add(34, 34, 34)
                        .add(
                            paneCaptureLayout
                                .createParallelGroup(GroupLayout.BASELINE)
                                .add(
                                    _lblHotkey,
                                    GroupLayout.PREFERRED_SIZE,
                                    22,
                                    GroupLayout.PREFERRED_SIZE)
                                .add(
                                    _txtHotkey,
                                    GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(
                            paneCaptureLayout
                                .createParallelGroup()
                                .add(
                                    _lblDelay,
                                    GroupLayout.PREFERRED_SIZE,
                                    28,
                                    GroupLayout.PREFERRED_SIZE)
                                .add(
                                    _spnDelay,
                                    GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE)
                                .add(
                                    _lblDelaySecs,
                                    GroupLayout.PREFERRED_SIZE,
                                    28,
                                    GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(
                            paneCaptureLayout
                                .createParallelGroup(GroupLayout.LEADING, false)
                                .add(
                                    paneCaptureLayout
                                        .createSequentialGroup()
                                        .add(
                                            paneCaptureLayout
                                                .createParallelGroup(GroupLayout.BASELINE)
                                                .add(
                                                    _lblNaming,
                                                    GroupLayout.PREFERRED_SIZE,
                                                    22,
                                                    GroupLayout.PREFERRED_SIZE)
                                                .add(_radTimestamp))
                                        .add(18, 18, 18)
                                        .add(_radOff)
                                        .addPreferredGap(LayoutStyle.RELATED))
                                .add(
                                    GroupLayout.TRAILING,
                                    paneCaptureLayout
                                        .createSequentialGroup()
                                        .add(_radOCR)
                                        .add(21, 21, 21)))
                        .add(80, 80, 80)));
      }
      _tabPane.addTab(I18N._I("prefTabScreenCapturing"), paneCapture);

      // ======== _paneTextEditing ========
      {

        // ---- _lblTabWidth ----
        _lblTabWidth.setLabelFor(_spnTabWidth);

        // ---- _cmbFontName ----
        _cmbFontName.addItemListener(
            new ItemListener() {
              public void itemStateChanged(ItemEvent e) {
                fontNameItemStateChanged(e);
              }
            });

        // ---- _lblFont ----
        _lblFont.setLabelFor(_cmbFontName);

        // ---- _lblFontSize ----
        _lblFontSize.setLabelFor(_cmbFontName);

        // ---- _spnFontSize ----
        _spnFontSize.addChangeListener(
            new ChangeListener() {
              public void stateChanged(ChangeEvent e) {
                fontSizeStateChanged(e);
              }
            });

        GroupLayout _paneTextEditingLayout = new GroupLayout(_paneTextEditing);
        _paneTextEditing.setLayout(_paneTextEditingLayout);
        _paneTextEditingLayout.setHorizontalGroup(
            _paneTextEditingLayout
                .createParallelGroup()
                .add(
                    GroupLayout.TRAILING,
                    _paneTextEditingLayout
                        .createSequentialGroup()
                        .add(95, 95, 95)
                        .add(
                            _paneTextEditingLayout
                                .createParallelGroup()
                                .add(
                                    _titleIndentation,
                                    GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE)
                                .add(
                                    _paneTextEditingLayout
                                        .createSequentialGroup()
                                        .add(
                                            _titleAppearance,
                                            GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(LayoutStyle.RELATED)
                                        .add(
                                            _paneTextEditingLayout
                                                .createParallelGroup()
                                                .add(
                                                    _paneTextEditingLayout
                                                        .createSequentialGroup()
                                                        .add(29, 29, 29)
                                                        .add(
                                                            _paneTextEditingLayout
                                                                .createParallelGroup()
                                                                .add(
                                                                    GroupLayout.TRAILING,
                                                                    _lblTabWidth)
                                                                .add(GroupLayout.TRAILING, _lblFont)
                                                                .add(
                                                                    GroupLayout.TRAILING,
                                                                    _lblFontSize))
                                                        .addPreferredGap(LayoutStyle.RELATED)
                                                        .add(
                                                            _paneTextEditingLayout
                                                                .createParallelGroup()
                                                                .add(
                                                                    _cmbFontName,
                                                                    0,
                                                                    218,
                                                                    Short.MAX_VALUE)
                                                                .add(
                                                                    _spnFontSize,
                                                                    GroupLayout.PREFERRED_SIZE,
                                                                    67,
                                                                    GroupLayout.PREFERRED_SIZE)
                                                                .add(
                                                                    _spnTabWidth,
                                                                    GroupLayout.PREFERRED_SIZE,
                                                                    52,
                                                                    GroupLayout.PREFERRED_SIZE))
                                                        .addPreferredGap(
                                                            LayoutStyle.RELATED,
                                                            97,
                                                            Short.MAX_VALUE))
                                                .add(
                                                    _chkExpandTab,
                                                    GroupLayout.DEFAULT_SIZE,
                                                    420,
                                                    Short.MAX_VALUE))))
                        .addContainerGap()));
        _paneTextEditingLayout.setVerticalGroup(
            _paneTextEditingLayout
                .createParallelGroup()
                .add(
                    _paneTextEditingLayout
                        .createSequentialGroup()
                        .add(21, 21, 21)
                        .add(
                            _titleIndentation,
                            GroupLayout.PREFERRED_SIZE,
                            GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                        .add(
                            _paneTextEditingLayout
                                .createParallelGroup()
                                .add(
                                    _paneTextEditingLayout
                                        .createSequentialGroup()
                                        .add(81, 81, 81)
                                        .add(
                                            _titleAppearance,
                                            GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.PREFERRED_SIZE))
                                .add(
                                    _paneTextEditingLayout
                                        .createSequentialGroup()
                                        .addPreferredGap(LayoutStyle.RELATED)
                                        .add(_chkExpandTab)
                                        .addPreferredGap(LayoutStyle.RELATED)
                                        .add(
                                            _paneTextEditingLayout
                                                .createParallelGroup()
                                                .add(
                                                    _lblTabWidth,
                                                    GroupLayout.PREFERRED_SIZE,
                                                    16,
                                                    GroupLayout.PREFERRED_SIZE)
                                                .add(
                                                    _spnTabWidth,
                                                    GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE,
                                                    GroupLayout.PREFERRED_SIZE))
                                        .add(40, 40, 40)
                                        .add(
                                            _paneTextEditingLayout
                                                .createParallelGroup(GroupLayout.BASELINE)
                                                .add(_lblFont)
                                                .add(
                                                    _cmbFontName,
                                                    GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE,
                                                    GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(LayoutStyle.RELATED)
                                        .add(
                                            _paneTextEditingLayout
                                                .createParallelGroup(GroupLayout.TRAILING)
                                                .add(
                                                    _lblFontSize,
                                                    GroupLayout.PREFERRED_SIZE,
                                                    27,
                                                    GroupLayout.PREFERRED_SIZE)
                                                .add(
                                                    _spnFontSize,
                                                    GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE,
                                                    GroupLayout.PREFERRED_SIZE))))
                        .addContainerGap(154, Short.MAX_VALUE)));
        _paneTextEditingLayout.linkSize(
            new Component[] {_lblTabWidth, _spnTabWidth}, GroupLayout.VERTICAL);
        _paneTextEditingLayout.linkSize(
            new Component[] {_cmbFontName, _lblFont}, GroupLayout.VERTICAL);
      }
      _tabPane.addTab(I18N._I("PreferencesWin.paneTextEditing.tab.title"), _paneTextEditing);

      // ======== paneGeneral ========
      {

        // ---- _lblUpdates ----
        _lblUpdates.setFont(
            _lblUpdates.getFont().deriveFont(_lblUpdates.getFont().getStyle() | Font.BOLD));

        // ---- _lblLanguage ----
        _lblLanguage.setFont(
            _lblLanguage.getFont().deriveFont(_lblLanguage.getFont().getStyle() | Font.BOLD));

        GroupLayout paneGeneralLayout = new GroupLayout(paneGeneral);
        paneGeneral.setLayout(paneGeneralLayout);
        paneGeneralLayout.setHorizontalGroup(
            paneGeneralLayout
                .createParallelGroup()
                .add(
                    paneGeneralLayout
                        .createSequentialGroup()
                        .add(137, 137, 137)
                        .add(
                            paneGeneralLayout
                                .createParallelGroup()
                                .add(
                                    paneGeneralLayout
                                        .createSequentialGroup()
                                        .add(_lblLanguage)
                                        .add(185, 185, 185))
                                .add(
                                    paneGeneralLayout
                                        .createSequentialGroup()
                                        .add(38, 38, 38)
                                        .add(
                                            _cmbLang,
                                            GroupLayout.PREFERRED_SIZE,
                                            215,
                                            GroupLayout.PREFERRED_SIZE))
                                .add(
                                    paneGeneralLayout
                                        .createSequentialGroup()
                                        .add(_lblUpdates)
                                        .add(318, 318, 318))
                                .add(
                                    GroupLayout.TRAILING,
                                    paneGeneralLayout
                                        .createSequentialGroup()
                                        .add(38, 38, 38)
                                        .add(
                                            _chkAutoUpdate,
                                            GroupLayout.DEFAULT_SIZE,
                                            376,
                                            Short.MAX_VALUE)))
                        .addContainerGap()));
        paneGeneralLayout.setVerticalGroup(
            paneGeneralLayout
                .createParallelGroup()
                .add(
                    paneGeneralLayout
                        .createSequentialGroup()
                        .add(26, 26, 26)
                        .add(_lblUpdates)
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(_chkAutoUpdate)
                        .add(40, 40, 40)
                        .add(_lblLanguage)
                        .addPreferredGap(LayoutStyle.RELATED)
                        .add(
                            _cmbLang,
                            GroupLayout.PREFERRED_SIZE,
                            GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(196, Short.MAX_VALUE)));
      }
      _tabPane.addTab(I18N._I("prefTabGeneralSettings"), paneGeneral);
    }
    contentPane.add(_tabPane, BorderLayout.CENTER);

    // ======== paneOkCancel ========
    {
      paneOkCancel.setBorder(new EmptyBorder(5, 5, 5, 5));
      paneOkCancel.setLayout(new BoxLayout(paneOkCancel, BoxLayout.X_AXIS));
      paneOkCancel.add(hSpacer1);

      // ---- _btnOk ----
      _btnOk.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              btnOkActionPerformed(e);
            }
          });
      paneOkCancel.add(_btnOk);

      // ---- _btnCancel ----
      _btnCancel.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              btnCancelActionPerformed(e);
            }
          });
      paneOkCancel.add(_btnCancel);

      // ---- _btnApply ----
      _btnApply.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              btnApplyActionPerformed(e);
            }
          });
      paneOkCancel.add(_btnApply);
    }
    contentPane.add(paneOkCancel, BorderLayout.SOUTH);
    setSize(600, 475);
    setLocationRelativeTo(getOwner());

    // ---- btngrpNaming ----
    ButtonGroup btngrpNaming = new ButtonGroup();
    btngrpNaming.add(_radTimestamp);
    btngrpNaming.add(_radOCR);
    btngrpNaming.add(_radOff);

    initComponentsI18n();
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
  }
コード例 #5
0
  private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY
    // //GEN-BEGIN:initComponents
    DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
    dialogPane = new JPanel();
    contentPanel = new JPanel();
    separator1 = compFactory.createSeparator("Country properties");
    panelProperties = new JPanel();
    lblName = new JLabel();
    txtName = new JTextField();
    buttonBar = new JPanel();
    okButton = new JButton();
    cancelButton = new JButton();
    CellConstraints cc = new CellConstraints();

    // ======== this ========
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    // ======== dialogPane ========
    {
      dialogPane.setBorder(Borders.DIALOG_BORDER);
      dialogPane.setLayout(new BorderLayout());

      // ======== contentPanel ========
      {
        contentPanel.setLayout(
            new FormLayout(
                "17dlu, $lcgap, 160dlu:grow, $lcgap, 17dlu", "2*(default, $lgap), default"));
        contentPanel.add(separator1, cc.xy(3, 1));

        // ======== panelProperties ========
        {
          panelProperties.setLayout(
              new FormLayout("25dlu, $lcgap, 18dlu, $lcgap, default:grow", "default"));

          // ---- lblName ----
          lblName.setText("Name:");
          lblName.setLabelFor(txtName);
          panelProperties.add(lblName, cc.xy(1, 1));
          panelProperties.add(txtName, cc.xy(5, 1));
        }
        contentPanel.add(panelProperties, cc.xy(3, 5));
      }
      dialogPane.add(contentPanel, BorderLayout.CENTER);

      // ======== buttonBar ========
      {
        buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER);
        buttonBar.setLayout(new FormLayout("$glue, $button, $rgap, $button", "pref"));

        // ---- okButton ----
        okButton.setText("Save");
        buttonBar.add(okButton, cc.xy(2, 1));

        // ---- cancelButton ----
        cancelButton.setText("Cancel");
        buttonBar.add(cancelButton, cc.xy(4, 1));
      }
      dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    pack();
    setLocationRelativeTo(getOwner());
    // //GEN-END:initComponents
  }