Search in sources :

Example 76 with JRadioButton

use of javax.swing.JRadioButton in project vcell by virtualcell.

the class MolecularTypePropertiesPanel method getAnchorAllButton.

private JRadioButton getAnchorAllButton() {
    if (anchorAllButton == null) {
        anchorAllButton = new JRadioButton("No restrictions");
        anchorAllButton.setToolTipText("This Molecule can be present in any Structure (recommended)");
        anchorAllButton.addActionListener(eventHandler);
    }
    return anchorAllButton;
}
Also used : JRadioButton(javax.swing.JRadioButton)

Example 77 with JRadioButton

use of javax.swing.JRadioButton in project vcell by virtualcell.

the class TestCaseAddPanel method getIvjExactRadioButtonSteady.

/**
 * This method initializes ivjExactRadioButtonSteady
 *
 * @return javax.swing.JRadioButton
 */
private JRadioButton getIvjExactRadioButtonSteady() {
    if (ivjExactRadioButtonSteady == null) {
        ivjExactRadioButtonSteady = new JRadioButton();
        ivjExactRadioButtonSteady.setName("ExactRadioButton");
        ivjExactRadioButtonSteady.setText("Exact Steady");
    }
    return ivjExactRadioButtonSteady;
}
Also used : JRadioButton(javax.swing.JRadioButton)

Example 78 with JRadioButton

use of javax.swing.JRadioButton in project vcell by virtualcell.

the class DisplayAdapterServicePanel method updateColorModelRadioButtons.

/**
 * Insert the method's description here.
 * Creation date: (10/11/00 6:15:25 PM)
 */
private void updateColorModelRadioButtons() {
    String currentSelection = getDisplayAdapterService().getActiveColorModelID();
    JRadioButton toBeSelectedButton = null;
    // remove all from panel and buttongroup
    java.awt.Component[] components = getColorGridPanel().getComponents();
    if (components != null) {
        for (int i = 0; i < components.length; i += 1) {
            if (components[i].getName() == null || !components[i].getName().equals("SpecialColorsJPanel")) {
                ((java.awt.Container) getColorGridPanel()).remove(components[i]);
            }
        }
    }
    java.util.Enumeration<AbstractButton> buttons = getColorMapButtonGroup().getElements();
    while (buttons.hasMoreElements()) {
        AbstractButton button = buttons.nextElement();
        getColorMapButtonGroup().remove(button);
    }
    // now add new ones
    String[] colorNames = getDisplayAdapterService().getColorModelIDs();
    if (colorNames != null) {
        for (int i = 0; i < colorNames.length; i += 1) {
            JRadioButton jcb = new JRadioButton(colorNames[i]);
            jcb.addActionListener(this);
            if (colorNames[i].equals(currentSelection)) {
                toBeSelectedButton = jcb;
            }
            jcb.setActionCommand(colorNames[i]);
            java.awt.GridBagConstraints constraints = new java.awt.GridBagConstraints();
            // constraints.gridy = i;
            constraints.gridy = i + 1;
            constraints.insets = new java.awt.Insets(0, 5, 0, 0);
            constraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
            constraints.weightx = 1.0;
            getColorGridPanel().add(jcb, constraints);
            getColorMapButtonGroup().add(jcb);
        }
        if (toBeSelectedButton != null) {
            toBeSelectedButton.setSelected(true);
        }
    }
    getColorGridPanel().revalidate();
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) JRadioButton(javax.swing.JRadioButton) AbstractButton(javax.swing.AbstractButton) GridBagConstraints(java.awt.GridBagConstraints)

Example 79 with JRadioButton

use of javax.swing.JRadioButton in project Course_Generator by patrovite.

the class frmFillCoeff method initComponents.

private void initComponents() {
    int line = 0;
    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle(bundle.getString("frmFillCoeff.title"));
    setAlwaysOnTop(true);
    setResizable(false);
    setMinimumSize(new Dimension(300, 400));
    setType(java.awt.Window.Type.UTILITY);
    // -- Layout
    // ------------------------------------------------------------
    Container paneGlobal = getContentPane();
    paneGlobal.setLayout(new GridBagLayout());
    // == Panel start
    panelStart = new JPanel();
    panelStart.setLayout(new GridBagLayout());
    // Start
    panelStart.setBorder(BorderFactory.createTitledBorder(bundle.getString("frmFillCoeff.panelStart.Title")));
    panelStart.setLayout(new GridBagLayout());
    Utils.addComponent(paneGlobal, panelStart, 0, 0, 1, 1, 0, 0, 10, 10, 0, 10, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    // From the start
    rbFromStart = new JRadioButton(bundle.getString("frmFillCoeff.rbFromStart.Text"));
    rbFromStart.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Refresh();
        }
    });
    Utils.addComponent(panelStart, rbFromStart, 0, 0, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // From line
    rbFromLine = new JRadioButton(bundle.getString("frmFillCoeff.rbFromLine.Text"));
    rbFromLine.setSelected(true);
    rbFromLine.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Refresh();
        }
    });
    Utils.addComponent(panelStart, rbFromLine, 0, 1, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    groupStart = new ButtonGroup();
    groupStart.add(rbFromStart);
    groupStart.add(rbFromLine);
    spinFromLine = new CgSpinner(100, 1, 100, 1);
    Utils.addComponent(panelStart, spinFromLine, 1, 1, 1, 1, 1, 0, 5, 5, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    lbFromValue = new JLabel(bundle.getString("frmFillCoeff.lbFromValue.Text"));
    Utils.addComponent(panelStart, lbFromValue, 0, 2, 1, 1, 1, 0, 5, 5, 5, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.NONE);
    spinFromValue = new CgSpinnerDouble(100.0, 0.1, 200.0, 0.1);
    Utils.addComponent(panelStart, spinFromValue, 1, 2, 1, 1, 1, 0, 5, 5, 5, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // == Panel end
    panelEnd = new JPanel();
    panelEnd.setLayout(new GridBagLayout());
    // End
    panelEnd.setBorder(BorderFactory.createTitledBorder(bundle.getString("frmFillCoeff.panelEnd.Title")));
    panelEnd.setLayout(new GridBagLayout());
    Utils.addComponent(paneGlobal, panelEnd, 0, 1, 1, 1, 0, 0, 10, 10, 0, 10, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    // To the end
    rbToEnd = new JRadioButton(bundle.getString("frmFillCoeff.rbToEnd.Text"));
    rbToEnd.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Refresh();
        }
    });
    Utils.addComponent(panelEnd, rbToEnd, 0, 0, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // To line
    rbToLine = new JRadioButton(bundle.getString("frmFillCoeff.rbToLine.Text"));
    rbToLine.setSelected(true);
    rbToLine.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Refresh();
        }
    });
    Utils.addComponent(panelEnd, rbToLine, 0, 1, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    groupEnd = new ButtonGroup();
    groupEnd.add(rbToEnd);
    groupEnd.add(rbToLine);
    spinToLine = new CgSpinner(100, 1, 100, 1);
    Utils.addComponent(panelEnd, spinToLine, 1, 1, 1, 1, 1, 0, 5, 5, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    lbToValue = new JLabel(bundle.getString("frmFillCoeff.lbToValue.Text"));
    Utils.addComponent(panelEnd, lbToValue, 0, 2, 1, 1, 1, 0, 5, 5, 5, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.NONE);
    spinToValue = new CgSpinnerDouble(100.0, 0.1, 200.0, 0.1);
    Utils.addComponent(panelEnd, spinToValue, 1, 2, 1, 1, 1, 0, 5, 5, 5, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // == Panel help
    panelHelp = new JPanel();
    panelHelp.setLayout(new GridBagLayout());
    // Difficulty
    panelHelp.setBorder(BorderFactory.createTitledBorder(bundle.getString("frmFillCoeff.panelHelp.Title")));
    Utils.addComponent(paneGlobal, panelHelp, 0, 2, 1, 1, 1, 1, 10, 10, 0, 10, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    panelEstimateTime = new JPanel();
    panelEstimateTime.setLayout(new GridBagLayout());
    Utils.addComponent(panelHelp, panelEstimateTime, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    lbEstimateTime = new JLabel(bundle.getString("frmFillCoeff.lbEstimateTime.Text"));
    Utils.addComponent(panelEstimateTime, lbEstimateTime, 0, 0, GridBagConstraints.REMAINDER, 1, 1, 0, 5, 5, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.NONE);
    lbHour = new JLabel(bundle.getString("frmFillCoeff.lbHour.Text"));
    Utils.addComponent(panelEstimateTime, lbHour, 0, 1, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.NONE);
    spinHour = new CgSpinner(0, 0, 999, 1);
    Utils.addComponent(panelEstimateTime, spinHour, 1, 1, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    lbMinute = new JLabel(bundle.getString("frmFillCoeff.lbMinute.Text"));
    Utils.addComponent(panelEstimateTime, lbMinute, 2, 1, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.NONE);
    spinMinute = new CgSpinner(0, 0, 59, 1);
    Utils.addComponent(panelEstimateTime, spinMinute, 3, 1, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    btCalc = new javax.swing.JButton(bundle.getString("frmFillCoeff.btCalc.text"));
    btCalc.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Calc();
            Refresh();
        }
    });
    Utils.addComponent(panelEstimateTime, btCalc, 4, 1, 1, 1, 1, 0, 5, 5, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.NONE);
    // --
    panelResult = new JPanel();
    panelResult.setLayout(new GridBagLayout());
    Utils.addComponent(panelHelp, panelResult, 0, 1, 1, 1, 1, 1, 10, 0, 10, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    lbResultCoeff = new JLabel(bundle.getString("frmFillCoeff.lbResultCoeff.Text"));
    Utils.addComponent(panelResult, lbResultCoeff, 0, 1, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.NONE);
    lbResultCoeffVal = new JLabel("0.0", JLabel.CENTER);
    lbResultCoeffVal.setBorder(BorderFactory.createLineBorder(Color.GRAY));
    lbResultCoeffVal.setOpaque(true);
    lbResultCoeffVal.setBackground(Color.WHITE);
    lbResultCoeffVal.setPreferredSize(new Dimension(60, 20));
    Utils.addComponent(panelResult, lbResultCoeffVal, 1, 1, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    btCopyToStart = new javax.swing.JButton(bundle.getString("frmFillCoeff.btCopyToStart.text"));
    btCopyToStart.setToolTipText(bundle.getString("frmFillCoeff.btCopyToStart.toolTipText"));
    btCopyToStart.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            spinFromValue.setValue(estimatedCoeff);
        }
    });
    Utils.addComponent(panelResult, btCopyToStart, 2, 1, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    btCopyToEnd = new javax.swing.JButton(bundle.getString("frmFillCoeff.btCopyToEnd.text"));
    btCopyToEnd.setToolTipText(bundle.getString("frmFillCoeff.btCopyToEnd.toolTipText"));
    btCopyToEnd.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            spinToValue.setValue(estimatedCoeff);
        }
    });
    Utils.addComponent(panelResult, btCopyToEnd, 3, 1, 1, 1, 0, 0, 5, 5, 0, 5, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // == BUTTONS
    // ===========================================================
    jPanelButtons = new javax.swing.JPanel();
    jPanelButtons.setLayout(new FlowLayout());
    Utils.addComponent(paneGlobal, jPanelButtons, 0, 3, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL);
    btCancel = new javax.swing.JButton();
    btCancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/cancel.png")));
    btCancel.setText(bundle.getString("Global.btCancel.text"));
    btCancel.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            setVisible(false);
        }
    });
    btOk = new javax.swing.JButton();
    btOk.setIcon(new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/valid.png")));
    btOk.setText(bundle.getString("Global.btOk.text"));
    btOk.setMinimumSize(btCancel.getMinimumSize());
    btOk.setPreferredSize(btCancel.getPreferredSize());
    btOk.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            RequestToClose();
        }
    });
    // -- Add buttons
    jPanelButtons.add(btOk);
    jPanelButtons.add(btCancel);
    // --
    pack();
    setLocationRelativeTo(null);
}
Also used : JPanel(javax.swing.JPanel) JRadioButton(javax.swing.JRadioButton) JButton(javax.swing.JButton) FlowLayout(java.awt.FlowLayout) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) ActionEvent(java.awt.event.ActionEvent) Container(java.awt.Container) CgSpinner(course_generator.utils.CgSpinner) ButtonGroup(javax.swing.ButtonGroup) JPanel(javax.swing.JPanel) CgSpinnerDouble(course_generator.utils.CgSpinnerDouble)

Example 80 with JRadioButton

use of javax.swing.JRadioButton in project Course_Generator by patrovite.

the class frmFillDiff method initComponents.

private void initComponents() {
    int line = 0;
    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle(bundle.getString("frmFillDiff.title"));
    setAlwaysOnTop(true);
    setResizable(false);
    setMinimumSize(new Dimension(300, 400));
    setType(java.awt.Window.Type.UTILITY);
    // -- Layout
    // ------------------------------------------------------------
    Container paneGlobal = getContentPane();
    paneGlobal.setLayout(new GridBagLayout());
    // == Panel start
    panelStart = new JPanel();
    panelStart.setLayout(new GridBagLayout());
    // Start
    panelStart.setBorder(BorderFactory.createTitledBorder(bundle.getString("frmFillDiff.panelStart.Title")));
    panelStart.setLayout(new GridBagLayout());
    Utils.addComponent(paneGlobal, panelStart, 0, 0, 1, 1, 0, 0, 10, 10, 0, 10, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    // From the start
    rbFromStart = new JRadioButton(bundle.getString("frmFillDiff.rbFromStart.Text"));
    rbFromStart.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Refresh();
        }
    });
    Utils.addComponent(panelStart, rbFromStart, 0, 0, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // From line
    rbFromLine = new JRadioButton(bundle.getString("frmFillDiff.rbFromLine.Text"));
    rbFromLine.setSelected(true);
    rbFromLine.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Refresh();
        }
    });
    Utils.addComponent(panelStart, rbFromLine, 0, 1, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    groupStart = new ButtonGroup();
    groupStart.add(rbFromStart);
    groupStart.add(rbFromLine);
    spinFromLine = new CgSpinner(100, 1, 100, 1);
    Utils.addComponent(panelStart, spinFromLine, 1, 1, 1, 1, 1, 0, 5, 5, 5, 5, GridBagConstraints.EAST, GridBagConstraints.NONE);
    // == Panel end
    panelEnd = new JPanel();
    panelEnd.setLayout(new GridBagLayout());
    // End
    panelEnd.setBorder(BorderFactory.createTitledBorder(bundle.getString("frmFillDiff.panelEnd.Title")));
    panelEnd.setLayout(new GridBagLayout());
    Utils.addComponent(paneGlobal, panelEnd, 0, 1, 1, 1, 0, 0, 10, 10, 0, 10, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    // To the end
    rbToEnd = new JRadioButton(bundle.getString("frmFillDiff.rbToEnd.Text"));
    rbToEnd.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Refresh();
        }
    });
    Utils.addComponent(panelEnd, rbToEnd, 0, 0, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // To line
    rbToLine = new JRadioButton(bundle.getString("frmFillDiff.rbToLine.Text"));
    rbToLine.setSelected(true);
    rbToLine.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Refresh();
        }
    });
    Utils.addComponent(panelEnd, rbToLine, 0, 1, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    groupEnd = new ButtonGroup();
    groupEnd.add(rbToEnd);
    groupEnd.add(rbToLine);
    spinToLine = new CgSpinner(100, 1, 100, 1);
    Utils.addComponent(panelEnd, spinToLine, 1, 1, 1, 1, 1, 0, 5, 5, 5, 5, GridBagConstraints.EAST, GridBagConstraints.NONE);
    // == Panel difficulty
    panelDiff = new JPanel();
    panelDiff.setLayout(new GridBagLayout());
    // Difficulty
    panelDiff.setBorder(BorderFactory.createTitledBorder(bundle.getString("frmFillDiff.panelDiff.Title")));
    panelDiff.setLayout(new GridBagLayout());
    Utils.addComponent(paneGlobal, panelDiff, 0, 2, 1, 1, 1, 1, 10, 10, 0, 10, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.BOTH);
    // Very easy
    rbVeryEasy = new JRadioButton(bundle.getString("frmFillDiff.rbVeryEasy.Text"));
    rbVeryEasy.setOpaque(true);
    rbVeryEasy.setBackground(CgConst.CL_DIFF_VERYEASY);
    rbVeryEasy.setSelected(true);
    rbVeryEasy.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Refresh();
        }
    });
    Utils.addComponent(panelDiff, rbVeryEasy, 0, 0, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // Easy
    rbEasy = new JRadioButton(bundle.getString("frmFillDiff.rbEasy.Text"));
    rbEasy.setOpaque(true);
    rbEasy.setBackground(CgConst.CL_DIFF_EASY);
    rbEasy.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Refresh();
        }
    });
    Utils.addComponent(panelDiff, rbEasy, 0, 1, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // Average
    rbAverage = new JRadioButton(bundle.getString("frmFillDiff.rbAverage.Text"));
    rbAverage.setOpaque(true);
    rbAverage.setBackground(CgConst.CL_DIFF_AVERAGE);
    rbAverage.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Refresh();
        }
    });
    Utils.addComponent(panelDiff, rbAverage, 0, 2, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // Hard
    rbHard = new JRadioButton(bundle.getString("frmFillDiff.rbHard.Text"));
    rbHard.setOpaque(true);
    rbHard.setBackground(CgConst.CL_DIFF_HARD);
    rbHard.setForeground(Color.WHITE);
    rbHard.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Refresh();
        }
    });
    Utils.addComponent(panelDiff, rbHard, 0, 3, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // Very hard
    rbVeryHard = new JRadioButton(bundle.getString("frmFillDiff.rbVeryHard.Text"));
    rbVeryHard.setOpaque(true);
    rbVeryHard.setBackground(CgConst.CL_DIFF_VERYHARD);
    rbVeryHard.setForeground(Color.WHITE);
    rbVeryHard.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Refresh();
        }
    });
    Utils.addComponent(panelDiff, rbVeryHard, 0, 4, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    // Other
    rbOther = new JRadioButton(bundle.getString("frmFillDiff.rbOther.Text"));
    rbOther.setOpaque(true);
    rbOther.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Refresh();
        }
    });
    Utils.addComponent(panelDiff, rbOther, 0, 5, 1, 1, 0, 0, 5, 5, 0, 0, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL);
    groupDiff = new ButtonGroup();
    groupDiff.add(rbVeryEasy);
    groupDiff.add(rbEasy);
    groupDiff.add(rbAverage);
    groupDiff.add(rbHard);
    groupDiff.add(rbVeryHard);
    groupDiff.add(rbOther);
    spinDiff = new CgSpinner(100, 1, 100, 1);
    Utils.addComponent(panelDiff, spinDiff, 1, 5, 1, 1, 1, 0, 5, 5, 5, 5, GridBagConstraints.EAST, GridBagConstraints.NONE);
    // == BUTTONS
    // ===========================================================
    jPanelButtons = new javax.swing.JPanel();
    jPanelButtons.setLayout(new FlowLayout());
    Utils.addComponent(paneGlobal, jPanelButtons, 0, 3, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL);
    btCancel = new javax.swing.JButton();
    btCancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/cancel.png")));
    btCancel.setText(bundle.getString("Global.btCancel.text"));
    btCancel.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            setVisible(false);
        }
    });
    btOk = new javax.swing.JButton();
    btOk.setIcon(new javax.swing.ImageIcon(getClass().getResource("/course_generator/images/valid.png")));
    btOk.setText(bundle.getString("Global.btOk.text"));
    btOk.setMinimumSize(btCancel.getMinimumSize());
    btOk.setPreferredSize(btCancel.getPreferredSize());
    btOk.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent evt) {
            RequestToClose();
        }
    });
    // -- Add buttons
    jPanelButtons.add(btOk);
    jPanelButtons.add(btCancel);
    // --
    pack();
    setLocationRelativeTo(null);
}
Also used : JPanel(javax.swing.JPanel) JRadioButton(javax.swing.JRadioButton) FlowLayout(java.awt.FlowLayout) JButton(javax.swing.JButton) GridBagLayout(java.awt.GridBagLayout) Dimension(java.awt.Dimension) ActionEvent(java.awt.event.ActionEvent) Container(java.awt.Container) CgSpinner(course_generator.utils.CgSpinner) ButtonGroup(javax.swing.ButtonGroup) JPanel(javax.swing.JPanel)

Aggregations

JRadioButton (javax.swing.JRadioButton)323 ButtonGroup (javax.swing.ButtonGroup)185 JPanel (javax.swing.JPanel)168 JLabel (javax.swing.JLabel)144 ActionEvent (java.awt.event.ActionEvent)104 ActionListener (java.awt.event.ActionListener)95 JTextField (javax.swing.JTextField)81 JButton (javax.swing.JButton)77 BoxLayout (javax.swing.BoxLayout)61 JCheckBox (javax.swing.JCheckBox)59 GridBagLayout (java.awt.GridBagLayout)57 BorderLayout (java.awt.BorderLayout)52 GridBagConstraints (java.awt.GridBagConstraints)52 Insets (java.awt.Insets)51 Dimension (java.awt.Dimension)45 FlowLayout (java.awt.FlowLayout)42 JScrollPane (javax.swing.JScrollPane)41 GridLayout (java.awt.GridLayout)32 JComboBox (javax.swing.JComboBox)32 ItemEvent (java.awt.event.ItemEvent)25