Java 类javax.swing.JCheckBox 实例源码

项目:myster    文件:MessageManager.java   
public MessagePreferencesPanel() {
    setLayout(null);

    refuseMessages = new JCheckBox("Refuse Messages");
    refuseMessages.setSize(150, 25);
    refuseMessages.setLocation(10, 25);
    refuseMessages.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            updateEnabled();
        }
    });
    add(refuseMessages);

    denyMessageLabel = new JLabel("Refusal Message:");
    denyMessageLabel.setSize(150, 25);
    denyMessageLabel.setLocation(20, 50);
    add(denyMessageLabel);

    denyMessageText = new JTextField(REFUSAL_MESSAGE_DEFAULT);
    denyMessageText.setSize(400, 25);
    denyMessageText.setLocation(25, 75);
    add(denyMessageText);

    setSize(STD_XSIZE, STD_YSIZE);
}
项目:Equella    文件:FilteringTab.java   
@Override
public void setup(ChangeDetector changeDetector)
{
    showResults = new JCheckBox(getString("filteringtab.display"), true); //$NON-NLS-1$
    filter = new SearchSetFilter(cache, clientService);

    final int[] rows = {TableLayout.PREFERRED, TableLayout.FILL,};
    final int[] cols = {TableLayout.FILL,};

    setLayout(new TableLayout(rows, cols));

    add(showResults, new Rectangle(0, 0, 1, 1));
    add(filter, new Rectangle(0, 1, 1, 1));

    changeDetector.watch(showResults);
    changeDetector.watch(filter);
}
项目:LivroJavaComoProgramar10Edicao    文件:CheckBoxFrame.java   
public CheckBoxFrame()
{
   super("JCheckBox Test");
   setLayout(new FlowLayout());

   // set up JTextField and set its font
   textField = new JTextField("Watch the font style change", 20);
   textField.setFont(new Font("Serif", Font.PLAIN, 14));
   add(textField); // add textField to JFrame

   boldJCheckBox = new JCheckBox("Bold"); 
   italicJCheckBox = new JCheckBox("Italic"); 
   add(boldJCheckBox); // add bold checkbox to JFrame
   add(italicJCheckBox); // add italic checkbox to JFrame

   // register listeners for JCheckBoxes
   CheckBoxHandler handler = new CheckBoxHandler();
   boldJCheckBox.addItemListener(handler);
   italicJCheckBox.addItemListener(handler);
}
项目:TwitchBot    文件:MainView.java   
private void manageButtons() {
    this.joinChannel = new JButton("Join Channel");
    this.joinChannel.setPreferredSize(
            new Dimension(this.chatAreaDescription.getPreferredSize().width, this.joinChannel.getPreferredSize().height));
    this.joinChannel.setBorder(BorderFactory.createBevelBorder(1));

    this.leaveChannel = new JButton("Leave Channel");
    this.leaveChannel.setPreferredSize(
            new Dimension(this.chatAreaDescription.getPreferredSize().width, this.joinChannel.getPreferredSize().height));
    this.leaveChannel.setBorder(BorderFactory.createBevelBorder(1));

    this.actAsBot = new JCheckBox("React to !");
    this.actAsBot.setSelected(true);

    this.trollPaul = new JCheckBox("Copy Swaul");
    this.trollPaul.setSelected(false);

    this.trollMatti = new JCheckBox("Copy GeniusMatti");
    this.trollMatti.setSelected(false);

    this.logToFile = new JCheckBox("Log To File");
    this.logToFile.setSelected(true);

}
项目:incubator-netbeans    文件:ScopeOptionsController.java   
private void init() {
    btnTestFileNamePattern = new JButton();
    chkFileNameRegex = new JCheckBox();
    chkFileNameRegex.setToolTipText(UiUtils.getText(
            "BasicSearchForm.chkFileNameRegex.tooltip"));           //NOI18N

    if (!replacing) {
        chkArchives = new JCheckBox();
        chkGenerated = new JCheckBox();
    }
    chkUseIgnoreList = new JCheckBox();
    btnEditIgnoreList = new JButton();
    checkBoxListener = new CheckBoxListener();

    component.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0));
    setMnemonics();
    initIgnoreListControlComponents();
    initScopeOptionsRow(replacing);
    initInteraction();
}
项目:GIFKR    文件:PreviewStatusPanel.java   
private void initializeComponents() {
    qualitySlider = new JSlider(10, 100, 50) {
        private static final long serialVersionUID = -3633632766184431178L;

        @Override
        public Dimension getPreferredSize() {
            return new Dimension(super.getPreferredSize().width/2, new JLabel(" ").getPreferredSize().height);
        }
    };
    qualitySlider.addChangeListener(ce -> r.refresh());

    qualitySlider.setOpaque(false);
    statusLabel = new JLabel();
    skipFrames = new JCheckBox("Skip frames", false);
    skipFrames.setOpaque(false);
}
项目:incubator-netbeans    文件:EditorPanelOperator.java   
protected JPanel getOpenedPanel(EditorOperator editorOperator) {
    for (int i = 0; i < 10; i++) {
        this.panel =  findPanel((Container) editorOperator.getSource());
        if(panel!=null) break;
        new EventTool().waitNoEvent(200);
    }
    if(panel==null) return null;
    for (Component c : panel.getComponents()) {
        if (c instanceof JCheckBox) {
            checkBoxesInPanel.add((JCheckBox)c);
        } else if(c instanceof JButton) {
            buttons.add((JButton)c);
        }
    }      
    return panel;
}
项目:marathonv5    文件:RToggleButtonTest.java   
public void selectCheckBoxNotSelected() throws InterruptedException {
    final LoggingRecorder lr = new LoggingRecorder();
    siw(new Runnable() {
        @Override public void run() {
            List<Component> comps = ComponentUtils.findComponents(JCheckBox.class, frame);
            JCheckBox checkBox = (JCheckBox) comps.get(3);
            RToggleButton rButton = new RToggleButton(checkBox, null, null, lr);
            checkBox.setSelected(false);
            rButton.mouseEntered(null);
            checkBox.setSelected(true);
            rButton.mouseClicked(null);
        }
    });
    Call call = lr.getCall();
    AssertJUnit.assertEquals("select", call.getFunction());
    AssertJUnit.assertEquals("true", call.getState());
}
项目:KernelHive    文件:ResourceMonitorPanel.java   
/**
 *
 */
public ResourceMonitorPanel() {
    setLayout(new BorderLayout(0, 0));

    picturePanel = new JPanel();
    picturePanel.setLayout(new BoxLayout(picturePanel, BoxLayout.PAGE_AXIS));

    JScrollPane scroll = new JScrollPane(picturePanel);
    add(scroll);

    final JPanel buttonPanel = new JPanel();
    add(buttonPanel, BorderLayout.SOUTH);

    btnRefresh = new JButton("Refresh");
    buttonPanel.add(btnRefresh);

    autoRefreshCheckbox = new JCheckBox("Auto-refresh", true);
    buttonPanel.add(autoRefreshCheckbox);
}
项目:xdman    文件:XDMMainWindow.java   
int getDupAction(String url) {
    JTextField txt = new JTextField(url, 30);
    String lbl = StringResource.getString("DUP_TXT");
    JComboBox choice = new JComboBox(new String[] { StringResource.getString("DUP_OP1"),
            StringResource.getString("DUP_OP2"), StringResource.getString("DUP_OP3") });
    JCheckBox chk = new JCheckBox(StringResource.getString("DUP_CHK"));
    int ret = JOptionPane.showOptionDialog(null, new Object[] { txt, lbl, choice, chk },
            StringResource.getString("DUP_TITLE"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null,
            null, null);
    if (ret == JOptionPane.OK_OPTION) {
        int index = choice.getSelectedIndex();
        if (chk.isSelected()) {
            config.duplicateLinkAction = index;
        }
        return index;
    }
    return -1;
}
项目:PTEAssistant    文件:UserTableHeaderCellRenderer.java   
public UserTableHeaderCellRenderer(JTable table) {
    this.tableModel = (UserTableModel) table.getModel();
    this.tableHeader = table.getTableHeader();
    selectBox = new JCheckBox(tableModel.getColumnName(0));
    selectBox.setSelected(false);
    tableHeader.addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent e) {
            if (e.getClickCount() > 0) {
                int selectColumn = tableHeader.columnAtPoint(e.getPoint());
                if (selectColumn == 0) {
                    boolean value = !selectBox.isSelected();
                    selectBox.setSelected(value);
                    tableModel.selectAll(value);
                    tableHeader.repaint();
                }
            }
        }
    });
}
项目:projetomcdonalds    文件:ControlerAlteracaoLanche.java   
public ControlerAlteracaoLanche(AlteracaoLanche alteracaoLanche, Lanche lanche, Vendas tela) {
    this.alteracaoLanche = alteracaoLanche;
    this.lanche = lanche;
    this.telaVenda = tela;

    this.alteracaoLanche.getBtn_Cancelar().addActionListener(this);
    this.alteracaoLanche.getBtn_Finalizar().addActionListener(this);
    for (JCheckBox botao : this.alteracaoLanche.getBotoes()) {
        botao.addActionListener(this);
    }

    getDados();
    iniciaCheckBox();
    marcarCheck();

    this.alteracaoLanche.setVisible(true);
    this.alteracaoLanche.toFront();
    this.alteracaoLanche.setLocationRelativeTo(this.telaVenda);
    this.alteracaoLanche.setVisible(true);
}
项目:JDigitalSimulator    文件:Application.java   
private JPanel createTitlePanel() {
    JPanel title = new JPanel(new BorderLayout());
    title.add(Guitilities.createGradientTitle(getTranslation("components.title")), BorderLayout.NORTH);

    JPanel interact = new JPanel();
    interact.setBackground(UIManager.getColor(Guitilities.SUB_PANEL_BACKGROUND));
    interact.setLayout(new BoxLayout(interact, BoxLayout.X_AXIS));
    interact.setBorder(new CompoundBorder(Guitilities.CHISEL_BORDER, new EmptyBorder(12, 8, 12, 8)));
    final JCheckBox checkImages = new JCheckBox(getTranslation("group.images"), true);
    checkImages.setBackground(UIManager.getColor(Guitilities.SUB_PANEL_BACKGROUND));
    checkImages.addActionListener(new ActionListener() {
        @Override public void actionPerformed(ActionEvent event) {
            for(ComponentButton button:componentButtons)
                button.setIconVisible(checkImages.isSelected());
            for(CollapsiblePanel panel:collapsiblePanels)
                panel.setExpanded(false);
        }
    });
    interact.add(checkImages);
    title.add(interact, BorderLayout.CENTER);
    return title;
}
项目:incubator-netbeans    文件:CodeTemplatesOperator.java   
public CodeTemplatesOperator setContext(Set<String> set) {
    JTabbedPaneOperator tabbedPane = getTabbedPane();
    tabbedPane.selectPage("Contexts");
    ContainerOperator<JEditorPane> selectedComponent = new ContainerOperator<>((Container)tabbedPane.getSelectedComponent());
    JListOperator list = new JListOperator(selectedComponent);
    for (int i = 0; i < list.getModel().getSize(); i++) {
        JCheckBox checkBox = (JCheckBox) list.getRenderedComponent(i);
        String contextName = checkBox.getText();
        list.scrollToItem(i);
        if(!checkBox.isSelected() && set.contains(contextName)) {
            list.selectItem(i);
        } else if(checkBox.isSelected() && !set.contains(contextName)) {
            list.selectItem(i);
        }            
    }   
    return this;

}
项目:Tarski    文件:SimpleGUI.java   
/** This method performs Edit->Find. */
private Runner doFind() {
    if (wrap) return wrapMe();
    JTextField x = OurUtil.textfield(lastFind,30);
    x.selectAll();
    JCheckBox c = new JCheckBox("Case Sensitive?",lastFindCaseSensitive);
    c.setMnemonic('c');
    JCheckBox b = new JCheckBox("Search Backward?",!lastFindForward);
    b.setMnemonic('b');
    if (!OurDialog.getInput("Find", "Text:", x, " ", c, b)) return null;
    if (x.getText().length() == 0) return null;
    lastFind = x.getText();
    lastFindCaseSensitive = c.getModel().isSelected();
    lastFindForward = !b.getModel().isSelected();
    doFindNext();
    return null;
}
项目:jdk8u-jdk    文件:Test7024235.java   
public void run() {
    if (this.pane == null) {
        this.pane = new JTabbedPane();
        this.pane.addTab("1", new Container());
        this.pane.addTab("2", new JButton());
        this.pane.addTab("3", new JCheckBox());

        JFrame frame = new JFrame();
        frame.add(BorderLayout.WEST, this.pane);
        frame.pack();
        frame.setVisible(true);

        test("first");
    }
    else {
        test("second");
        if (this.passed || AUTO) { // do not close a frame for manual review
            SwingUtilities.getWindowAncestor(this.pane).dispose();
        }
        this.pane = null;
    }
}
项目:VASSAL-src    文件:ReportState.java   
public Ed(ReportState piece) {

      box = new JPanel();
      box.setLayout(new BoxLayout(box, BoxLayout.Y_AXIS));
      descInput = new StringConfigurer(null, "Description:  ", piece.description);
      box.add(descInput.getControls());
      keys = new NamedKeyStrokeArrayConfigurer(null, "Report on these keystrokes:  ", piece.keys);
      box.add(keys.getControls());
      cycle = new JCheckBox("Cycle through different messages?");
      box.add(cycle);
      format = new PlayerIdFormattedStringConfigurer(null, "Report format:  ", new String[]{COMMAND_NAME,
                                                                                         OLD_UNIT_NAME,
                                                                                         NEW_UNIT_NAME,
                                                                                         MAP_NAME,
                                                                                         OLD_MAP_NAME,
                                                                                         LOCATION_NAME,
                                                                                         OLD_LOCATION_NAME});
      format.setValue(piece.reportFormat);
      box.add(format.getControls());
      cycleFormat = new StringArrayConfigurer(null, "Message formats", piece.cycleReportFormat);
      box.add(cycleFormat.getControls());
      cycleDownKeys = new NamedKeyStrokeArrayConfigurer(null, "Report previous message on these keystrokes:  ", piece.cycleDownKeys);
      box.add(cycleDownKeys.getControls());
      ItemListener l = new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
          format.getControls().setVisible(!cycle.isSelected());
          cycleFormat.getControls().setVisible(cycle.isSelected());
          cycleDownKeys.getControls().setVisible(cycle.isSelected());
          Window w = SwingUtilities.getWindowAncestor(box);
          if (w != null) {
            w.pack();
          }
        }
      };
      l.itemStateChanged(null);
      cycle.addItemListener(l);
      cycle.setSelected(piece.cycleReportFormat.length > 0);
    }
项目:A-Pathfinding-Visualization    文件:ControlHandler.java   
public JCheckBox getC(String t) {
    for(int i = 0; i < checks.size(); i++) {
        if(checks.get(i).getName().equals(t)) {
            return checks.get(i);
        }
    }
    return null;
}
项目:openjdk-jdk10    文件:Test4520754.java   
public static void main(String[] args) {
    // ensure that 4168475 does not regress
    test4168475(Component.class);
    // AWT classes (com.sun.beans.infos.ComponentBeanInfo)
    test(null, Button.class, Component.class, List.class, Menu.class, Panel.class);
    // Swing classes (dt.jar)
    test(null, JApplet.class, JButton.class, JCheckBox.class);
    // user defined classes
    test(Boolean.TRUE, Wombat.class, Foo.class, FooBar.class);
}
项目:gchisto    文件:GUIUtilities.java   
/**
 * It creates a new check box for inclusion in a table and sets 
 * its "is selected" attribute to the given value.
 * 
 * @param selected It determines whether the newly-created check box
 * will be selected or not.
 * @return A new check box for inclusion in a table.
 */
static public JCheckBox createJCheckBoxForTable(boolean selected) {
    JCheckBox checkBox = new JCheckBox();
    checkBox.setOpaque(true);
    checkBox.setHorizontalAlignment(SwingConstants.CENTER);
    checkBox.setForeground(TABLE_COMPONENT_FG_COLOR);
    checkBox.setBackground(TABLE_COMPONENT_BG_COLOR);
    checkBox.setSelected(selected);
    return checkBox;
}
项目:Equella    文件:AttachmentsSectionConfig.java   
@Override
public void setup()
{
    showFull = new JCheckBox(s("showfullscreen"));
    showFullNewWindow = new JCheckBox(s("showfullscreen.newwindow"));
    modeStructured = new JRadioButton(s("displaymode.structured.title"));
    modeThumbnail = new JRadioButton(s("displaymode.thumbnail.title"));
    metadataTarget = new MultiTargetChooser(schemaModel, "");

    ButtonGroup bg = new ButtonGroup();
    bg.add(modeStructured);
    bg.add(modeThumbnail);

    changeDetector = new ChangeDetector();
    changeDetector.watch(showFull);
    changeDetector.watch(showFullNewWindow);
    changeDetector.watch(modeStructured);
    changeDetector.watch(modeThumbnail);
    changeDetector.watch(metadataTarget);

    setLayout(new MigLayout("wrap", "[]"));

    super.setup();

    add(new JLabel(s("fullscreen")), "gaptop 2u");
    add(showFull, "gap 2i");
    add(showFullNewWindow, "gap 2i");

    add(new JLabel(s("displaymode")), "gaptop 2u");

    add(modeStructured, "gap i*2");
    add(new JLabel("<html>" + s("displaymode.structured.description")), "gap i*4");

    add(modeThumbnail, "gap i*2");
    add(new JLabel("<html>" + s("displaymode.thumbnail.description")), "gap i*4");

    add(new JLabel(s("restrict")), "gaptop 2u, grow");
    add(new JLabel("<html>" + s("restrict.help")), "gap 2i");
    add(metadataTarget, "grow, gap 2i");
}
项目:Equella    文件:SearchSetInheritance.java   
public SearchSetInheritance(final EntityCache cache, final ClientService clientService)
{
    final JLabel schemasLabel = new JLabel(
        getString("searchset.searchsetinheritance.inheritschemas")); //$NON-NLS-1$
    final JLabel itemDefsLabel = new JLabel(
        getString("searchset.searchsetinheritance.inheritcollections")); //$NON-NLS-1$

    inheritFreetext = new JCheckBox(
        getString("searchset.searchsetinheritance.inheritfreetext")); //$NON-NLS-1$
    schemasModel = new InheritedTableModel<Schema, SchemaScript>(cache.getSchemaMap(), SchemaScript.class,
        getString("searchset.searchsetinheritance.schema")); //$NON-NLS-1$
    itemDefsModel = new InheritedTableModel<ItemDefinition, ItemDefinitionScript>(cache.getItemDefinitionMap(),
        ItemDefinitionScript.class,
        getString("searchset.searchsetinheritance.collection")); //$NON-NLS-1$

    final JTable schemasTable = generateTable(schemasModel, clientService);
    final JTable itemDefTable = generateTable(itemDefsModel, clientService);

    final int height1 = inheritFreetext.getPreferredSize().height;
    final int height2 = schemasLabel.getPreferredSize().height;

    final int[] rows = {height1, height2, TableLayout.FILL, height2, TableLayout.FILL,};
    final int[] cols = {TableLayout.FILL,};

    setLayout(new TableLayout(rows, cols));

    add(inheritFreetext, new Rectangle(0, 0, 1, 1));

    add(schemasLabel, new Rectangle(0, 1, 1, 1));
    add(new JScrollPane(schemasTable), new Rectangle(0, 2, 1, 1));

    add(itemDefsLabel, new Rectangle(0, 3, 1, 1));
    add(new JScrollPane(itemDefTable), new Rectangle(0, 4, 1, 1));

    changeDetector = new ChangeDetector();
    changeDetector.watch(inheritFreetext);
    changeDetector.watch(schemasModel);
    changeDetector.watch(itemDefsModel);
}
项目:sumo    文件:ActionDialog.java   
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    this.setVisible(false);
    try {
        //String[] args = new String[components.size() ];
        this.actionArgs=new HashMap<>();
        int i = 0;
        for (JComponent c : components.values()) {
            if (c instanceof JTextField) {
                //args[i++]= ((JTextField) c).getText();
                actionArgs.put(((JTextField) c).getName(), ((JTextField) c).getText());
            } else if (c instanceof JComboBox) {
                //args[i++] = ((JComboBox) c).getSelectedItem() + "";
                actionArgs.put(((JComboBox) c).getName(),  ((JComboBox) c).getSelectedItem() + "");
            }
            else if (c instanceof JCheckBox) {
               // args[i++] = ((JCheckBox) c).isSelected() + "";
                actionArgs.put(((JCheckBox) c).getName(), ((JCheckBox) c).isSelected() + "");
            }
            /* else if (c instanceof DateControl) {
                args[i++] = new Timestamp(((DateControl) c).getDate().getTime()).toString();
            }*/
        }
        ok=true;
    } catch (Exception ex) {
        logger.error(ex.getMessage(),ex);
        ok=false;
    }
}
项目:VisualGraphviz    文件:MainFrame.java   
private void addCheckBox() {
    /* isDirected */

    directed = new JCheckBox("isDirected");
    directed.setBounds(635, 17, 125, 20);
    directed.setFont(checkBoxFont);
    directed.setMargin(DEFAULT_INSETS);

    /* hasWight */

    weight = new JCheckBox("hasWeight");
    weight.setBounds(530, 17, 100, 20);
    weight.setFont(checkBoxFont);
    weight.setMargin(DEFAULT_INSETS);
}
项目:BaseClient    文件:EffectUtil.java   
/**
 * Prompts the user for boolean value
 * 
 * @param name The name of the dialog to show
 * @param currentValue The current value to be displayed
 * @param description The help text to provide
 * @return The value selected by the user
 */
static public Value booleanValue (String name, final boolean currentValue, final String description) {
    return new DefaultValue(name, String.valueOf(currentValue)) {
        public void showDialog () {
            JCheckBox checkBox = new JCheckBox();
            checkBox.setSelected(currentValue);
            if (showValueDialog(checkBox, description)) value = String.valueOf(checkBox.isSelected());
        }

        public Object getObject () {
            return Boolean.valueOf(value);
        }
    };
}
项目:Equella    文件:InternalDataSourceChoice.java   
public InternalDataSourceChoice()
{
    super(new MigLayout("wrap 1"));

    allowNewTerms = new JCheckBox(getString("internal.allownewterms"));

    add(new JLabel("<html>" + getString("internal.choicedescription")));
    add(allowNewTerms);

    changeDetector.watch(allowNewTerms);
}
项目:gate-core    文件:CheckBoxTableCellRenderer.java   
public CheckBoxTableCellRenderer() {
  super();

  // centre the checkbox within the cell
  setHorizontalAlignment(JCheckBox.CENTER);

  // make sure we always paint the cell border
  setBorderPainted(true);

  // make sure we always paint the background
  setOpaque(true);
}
项目:incubator-netbeans    文件:DataViewUI.java   
@Override
public void actionPerformed(ActionEvent e) {
    JCheckBox source = (JCheckBox) e.getSource();
    int index = Integer.parseInt(e.getActionCommand());
    Set<Integer> currentVisibleColumns = dataPanel.getVisibleColumns();
    if (source.isSelected()) {
        currentVisibleColumns.add(index);
    } else {
        currentVisibleColumns.remove(index);
    }
    dataPanel.setVisibleColumns(currentVisibleColumns);
}
项目:jaer    文件:ControlPanel.java   
void addTip(Controllable f, JCheckBox label) {
    String s = f.getPropertyTooltip(label.getText());
    if (s == null) {
        return;
    }
    label.setToolTipText(s);
    label.setForeground(Color.BLUE);
}
项目:AgentWorkbench    文件:TableCellRenderer4CheckBox.java   
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {

    JCheckBox checkBox = new JCheckBox();
    checkBox.setSelected((Boolean) value);
    checkBox.setHorizontalAlignment(SwingConstants.CENTER);
    checkBox.setOpaque(true);
    GraphGlobals.Colors.setTableCellRendererColors(checkBox, row, isSelected);
    return checkBox;
}
项目:incubator-netbeans    文件:DefaultFoldingOptions.java   
private void updateChecker(String prefKey, JCheckBox cb, FoldType ft) {
    if (lastChangedCB == cb) {
        // ignore
        lastChangedCB = null;
        return;
    }
    boolean val = isCollapseEnabled(ft);
    ignoreStateChange = true;
    LOG.log(Level.FINE, "Updating checker: " + prefKey + ", setSelected " + val); // NOI18N
    cb.setSelected(val);
    ignoreStateChange = false;
}
项目:Progetto-C    文件:EmitterList.java   
/**
 * @see javax.swing.DefaultListCellRenderer#getListCellRendererComponent(javax.swing.JList, java.lang.Object, int, boolean, boolean)
 */
public Component getListCellRendererComponent(JList list, final Object value, int index, boolean isSelected, boolean cellHasFocus) {
    JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected,
            cellHasFocus);

    final JCheckBox box = new JCheckBox(label.getText());
    box.setBackground(label.getBackground());

    box.setSelected(((ConfigurableEmitter) value).isEnabled());
    checks.put(value, box);

    return box;
}
项目:Hollow-Knight-SaveManager    文件:CharmPanel.java   
public static List<CharmPanel> createCharmPanels(JsonObject playerData, Notches notches, JCheckBox autoCalc, JCheckBox overcharmed){
    List<CharmPanel> out = new ArrayList<CharmPanel>(); 
    for( int i = 0; i < 40; i++){
        CharmPanel charm = new CharmPanel(i, charmNames[i], playerData, notches, autoCalc, overcharmed);
        out.add(charm);
    }
    Collections.sort(out);
    return out;
}
项目:Equella    文件:MultiEditor.java   
private JComponent createDetails()
{
    JLabel titleLabel = new JLabel(CurrentLocale.get("wizard.controls.title")); //$NON-NLS-1$
    JLabel descriptionLabel = new JLabel(CurrentLocale.get("wizard.controls.description")); //$NON-NLS-1$

    title = new I18nTextField(BundleCache.getLanguages());
    description = new I18nTextField(BundleCache.getLanguages());
    mandatory = new JCheckBox(CurrentLocale.get("wizard.controls.mandatory")); //$NON-NLS-1$

    final int height1 = title.getPreferredSize().height;
    final int width1 = descriptionLabel.getPreferredSize().width;

    final int[] rows = {height1, height1, height1,};
    final int[] cols = {width1, TableLayout.FILL, TableLayout.DOUBLE_FILL,};

    JPanel all = new JPanel(new TableLayout(rows, cols, 5, 5));

    all.add(titleLabel, new Rectangle(0, 0, 1, 1));
    all.add(title, new Rectangle(1, 0, 2, 1));

    all.add(descriptionLabel, new Rectangle(0, 1, 1, 1));
    all.add(description, new Rectangle(1, 1, 2, 1));

    all.add(mandatory, new Rectangle(0, 2, 2, 1));

    return all;
}
项目:incubator-netbeans    文件:DefaultOutlineCellRenderer.java   
final JCheckBox createCheckBox() {
    JCheckBox cb = new JCheckBox();
    cb.setSize(cb.getPreferredSize());
    cb.setBorderPainted(false);
    cb.setOpaque(false);
    return cb;
}
项目:jmeter-prometheus-plugin    文件:PrometheusListenerGui.java   
protected JPanel createLabelsPanel() {
    HorizontalPanel panel = new HorizontalPanel();
    panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),"Labels"));

    this.codeCheckBox = new JCheckBox("Code");
    panel.add(this.codeCheckBox);

    this.labelsCheckBox = new JCheckBox("Jmeter Labels");
    panel.add(this.labelsCheckBox);

    this.successCheckBox = new JCheckBox("Success");
    panel.add(this.successCheckBox);

    return panel;
}
项目:appinventor-extensions    文件:AIMerger.java   
private static JCheckBox[] getScreenCheckBoxes(AIProject project, boolean isMainProject) {
  List<AIScreen> tempScreensList = project.getScreensList();
  JCheckBox[] screenCheckBoxLabels = new JCheckBox[1 + tempScreensList.size()];
  screenCheckBoxLabels[0] = new JCheckBox("Check All");
  for (int i = 1; i <= tempScreensList.size(); i++) {
    String tempScreenName = tempScreensList.get(i - 1).getName();
    if (tempScreenName.equals("Screen1") && isMainProject) {
      screenCheckBoxLabels[i] = new JCheckBox(tempScreenName, true);
    } else {
      screenCheckBoxLabels[i] = new JCheckBox(tempScreenName);
    }
  }
  return screenCheckBoxLabels;
}
项目:geomapapp    文件:CustomDB.java   
protected Component createThumbsCheckbox() {
    thumbsB = new JCheckBox("<html>Image Viewer</html>",true);
    thumbsB.setSize(45, 45);
    thumbsB.addActionListener(this);
    thumbsB.setActionCommand("thumb");
    thumbsB.setEnabled(false);
    return thumbsB;
}
项目:incubator-netbeans    文件:NodeTableModel.java   
void makeAccessibleCheckBox(JCheckBox box, Property p) {
    box.getAccessibleContext().setAccessibleName(p.getDisplayName());
    box.getAccessibleContext().setAccessibleDescription(p.getShortDescription());

    Object mnemonicChar = p.getValue(ATTR_MNEMONIC_CHAR);

    if ((null != mnemonicChar) && (mnemonicChar.toString().length() > 0)) {
        box.setMnemonic(mnemonicChar.toString().charAt(0));
    }
}
项目:BachSys    文件:TelaPrincipal.java   
private void adicionarPainelListaMusica() {
        painelListaMusica = new Painel(600, 550);
        adicionarComponente(painelListaMusica, GridBagConstraints.CENTER, GridBagConstraints.BOTH, 0, 1, 1, 2);
//        painelListaMusica.setBackground(Color.red);



        criaTabelaMusicas(musicas, false);

        boxMusicasUsuario = new JCheckBox("Ver apenas minhas músicas");
        painelListaMusica.adicionarComponente(boxMusicasUsuario, GridBagConstraints.WEST,
                                            GridBagConstraints.NONE, 0, 2, 1, 1, 0.1, 0.1);
        adicionarBarraBusca();
    }