Package javax.swing

Examples of javax.swing.JCheckBox


        int x = 0;
        int y = 0;

        for (DcField field : DcModules.get(module).getFields()) {
            if (allFields || (field.getIndex() != DcObject._ID && field.getIndex() != DcObject._SYS_EXTERNAL_REFERENCES)) {
                JCheckBox checkBox = ComponentFactory.getCheckBox(field.getLabel());
                componentMap.put(field, checkBox);
   
                panel.add(checkBox, Layout.getGBC(x, y++, 1, 1, 1.0, 1.0
                         ,GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
                          new Insets( 0, 10, 0, 0), 0, 0));
View Full Code Here


      else
      {
        editor = new TextKeyEditor(getConfig(), keyNames[i], displayName);
      }

      final JCheckBox enableCB = new JCheckBox();
      enableCB.addActionListener(new EnableAction(editor, enableCB));
      final JPanel panel = new JPanel();
      panel.setLayout(new BorderLayout());
      panel.add(enableCB, BorderLayout.WEST);
      panel.add(editor.getComponent(), BorderLayout.CENTER);
View Full Code Here

        (resources.getString("config-description-editor.description")); //$NON-NLS-1$
    final JLabel typeLabel = new JLabel(resources.getString("config-description-editor.type")); //$NON-NLS-1$
    final JLabel globalLabel = new JLabel(resources.getString("config-description-editor.global")); //$NON-NLS-1$
    final JLabel hiddenLabel = new JLabel(resources.getString("config-description-editor.hidden")); //$NON-NLS-1$

    hiddenField = new JCheckBox();
    globalField = new JCheckBox();
    final String font = ConfigEditorBoot.getInstance().getGlobalConfig().getConfigProperty
        (ConfigDescriptionEditor.EDITOR_FONT_KEY, "Monospaced"); //$NON-NLS-1$
    final int fontSize = ParserUtil.parseInt
        (ConfigEditorBoot.getInstance().getGlobalConfig().getConfigProperty
            (ConfigDescriptionEditor.EDITOR_FONT_SIZE_KEY), 12);
View Full Code Here

     * Override this if you want to change the kind of button used.
     *
     * @return AbstractButton in an off state.
     */
    protected AbstractButton createOnOffButton() {
        return new JCheckBox(layerOffIcon);
    }
View Full Code Here

     * on/off. Override this if you want to change the kind of button used.
     *
     * @return AbstractButton in an off state.
     */
    protected AbstractButton createPaletteButton() {
        return new JCheckBox(paletteIcon);
    }
View Full Code Here

     *
     * @return Component object representing the palette widgets.
     */
    public Component getGUI() {
        if (box == null) {
            JCheckBox showDBLocationCheck, showNameCheck;
            JButton rereadFilesButton;

            showDBLocationCheck = new JCheckBox("Show Locations", isShowLocations());
            showDBLocationCheck.setActionCommand(showLocationsCommand);
            showDBLocationCheck.addActionListener(this);

            showNameCheck = new JCheckBox("Show Location Names", isShowNames());
            showNameCheck.setActionCommand(showNamesCommand);
            showNameCheck.addActionListener(this);

            rereadFilesButton = new JButton("Reload Data From Source");
            rereadFilesButton.setActionCommand(readDataCommand);
View Full Code Here

     * actions.
     */
    public void actionPerformed(ActionEvent e) {
        String cmd = e.getActionCommand();
        if (cmd == showLocationsCommand) {
            JCheckBox locationCheck = (JCheckBox) e.getSource();
            setShowLocations(locationCheck.isSelected());
            if (Debug.debugging("location")) {
                Debug.output("DBLocationHandler::actionPerformed showLocations is "
                        + isShowLocations());
            }
            getLayer().repaint();
        } else if (cmd == showNamesCommand) {
            JCheckBox namesCheck = (JCheckBox) e.getSource();
            setShowNames(namesCheck.isSelected());
            if (Debug.debugging("location")) {
                Debug.output("DBLocationHandler::actionPerformed showNames is "
                        + isShowNames());
            }
            getLayer().repaint();
View Full Code Here

    public static JPanel createCheckbox(String boxlabel, String[] buttons,
                                        boolean[] checked, ActionListener al) {

        JPanel jp = createPaletteJPanel(boxlabel);
        for (int j = 0; j < buttons.length; j++) {
            JCheckBox jcb = new JCheckBox(buttons[j]);
            jcb.setActionCommand(Integer.toString(j));//index of
                                                      // checked
            if (al != null)
                jcb.addActionListener(al);
            jcb.setSelected(checked[j]);
            jp.add(jcb);
        }
        return jp;
    }
View Full Code Here

        return combo;
    }

    private JCheckBox makeSnapCheckBox() {
        String snapText = i18n.get(this, "snapToInterval", "Snap");
        JCheckBox snapBox = new JCheckBox(snapText, isSnapToInterval());
        snapText = i18n.get(this,
                "snapToInterval",
                I18n.TOOLTIP,
                "Round radius to nearest interval value.");
        snapBox.setToolTipText(snapText);
        snapBox.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                setSnapToInterval(((JCheckBox) ae.getSource()).isSelected());
                if (snapToInterval) {
                    setRadius(circle.getRadius());
                }
View Full Code Here

                String bTitle = "Run Update Timer";
                int interval = getUpdateInterval();
                if (interval > 0) {
                    bTitle = "Reload Data (" + (interval / 1000) + " sec)";
                }
                timerButton = new JCheckBox(bTitle, getTimer().isRunning());
                timerButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent ae) {
                        JCheckBox check = (JCheckBox) ae.getSource();
                        Timer t = getTimer();
                        if (t != null) {
                            if (check.isSelected()) {
                                t.restart();
                            } else {
                                t.stop();
                            }
                        }
                    }
                });
                timerButton.setToolTipText("<HTML><BODY>Reload the map data from the original source at specified intervals.</BODY></HTML>");
            }

            if (autoTimerButton == null) {
                autoTimerButton = new JCheckBox("Reload Only When Visible", getAutoTimer());
                autoTimerButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent ae) {
                        JCheckBox check = (JCheckBox) ae.getSource();
                        setAutoTimer(check.isSelected());
                    }
                });
                autoTimerButton.setToolTipText("<HTML><BODY>Only run the timer when the layer is active on the map.</BODY></HTML>");
            }
View Full Code Here

TOP

Related Classes of javax.swing.JCheckBox

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.