类javax.swing.JCheckBox源码实例Demo

下面列出了怎么用javax.swing.JCheckBox的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: netbeans   文件: ButtonBuilders.java
static ComponentBuilder getBuilder(Instance instance, Heap heap) {
    if (DetailsUtils.isSubclassOf(instance, JButton.class.getName())) {
        return new JButtonBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JCheckBox.class.getName())) {
        return new JCheckBoxBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JRadioButton.class.getName())) {
        return new JRadioButtonBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JToggleButton.class.getName())) {
        return new JToggleButtonBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JCheckBoxMenuItem.class.getName())) {
        return new JCheckBoxMenuItemBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JRadioButtonMenuItem.class.getName())) {
        return new JRadioButtonMenuItemBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JMenu.class.getName())) {
        return new JMenuBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JMenuBar.class.getName())) {
        return new JMenuBarBuilder(instance, heap);
    } else if (DetailsUtils.isSubclassOf(instance, JMenuItem.class.getName())) {
        return new JMenuItemBuilder(instance, heap);
    }
    return null;
}
 
源代码2 项目: uima-uimaj   文件: CasAnnotationViewer.java
/**
 * Adds the feature value check boxes.
 */
private void addFeatureValueCheckBoxes() {
  if (this.featureValueCheckBoxMap.size() == 0) {
    return;
  }

  List<JCheckBox> checkBoxes = new ArrayList<>(this.featureValueCheckBoxMap.values());
  checkBoxes.sort(new Comparator<JCheckBox>() {
    @Override
    public int compare(JCheckBox arg0, JCheckBox arg1) {
      return arg0.getText().toLowerCase().compareTo(arg1.getText().toLowerCase());
    }
  });

  for (JCheckBox checkBox : checkBoxes) {
    if (checkBox.getParent() != this.featureValueCheckBoxVerticalScrollPanel &&
        (checkBox.isSelected() || !this.hideUnselectedCheckBoxes)) {
      this.featureValueCheckBoxVerticalScrollPanel.add(checkBox);
    }
  }
}
 
源代码3 项目: netbeans   文件: ShelveChangesAction.java
public HgShelveChangesSupport () {
    doBackupChxBox = new JCheckBox();
    org.openide.awt.Mnemonics.setLocalizedText(doBackupChxBox, org.openide.util.NbBundle.getMessage(ShelveChangesAction.class, "ShelvePanel.doBackupChxBox.text")); //NOI18N
    doBackupChxBox.setToolTipText(org.openide.util.NbBundle.getMessage(ShelveChangesAction.class, "ShelvePanel.doBackupChxBox.desc")); //NOI18N
    doBackupChxBox.getAccessibleContext().setAccessibleDescription(doBackupChxBox.getToolTipText());
    doBackupChxBox.setSelected(HgModuleConfig.getDefault().getBackupOnRevertModifications());
    doPurgeChxBox = new JCheckBox();
    org.openide.awt.Mnemonics.setLocalizedText(doPurgeChxBox, org.openide.util.NbBundle.getMessage(ShelveChangesAction.class, "ShelvePanel.doPurgeChxBox.text")); //NOI18N
    doPurgeChxBox.setToolTipText(org.openide.util.NbBundle.getMessage(ShelveChangesAction.class, "ShelvePanel.doPurgeChxBox.desc")); //NOI18N
    doPurgeChxBox.getAccessibleContext().setAccessibleDescription(doPurgeChxBox.getToolTipText());
    doPurgeChxBox.setSelected(HgModuleConfig.getDefault().isRemoveNewFilesOnRevertModifications());
    optionsPanel = new JPanel();
    optionsPanel.setLayout(new BoxLayout(optionsPanel, BoxLayout.Y_AXIS));
    optionsPanel.add(doBackupChxBox);
    optionsPanel.add(doPurgeChxBox);
}
 
源代码4 项目: marathonv5   文件: RJideCheckBoxListItem.java
public String getValue() {
    CheckBoxListCellRenderer cbListRenderer = (CheckBoxListCellRenderer) getComponent();
    if (cbListRenderer instanceof JComponent) {
        JList list = (JList) cbListRenderer.getClientProperty("jlist");
        if (list.getSelectedIndices().length > 1) {
            return null;
        }
    }
    Component[] childern = cbListRenderer.getComponents();
    for (Component c : childern) {
        if (c instanceof JCheckBox) {
            return String.valueOf(((JCheckBox) c).isSelected());
        }
    }
    return null;
}
 
源代码5 项目: sc2gears   文件: MiscSettingsDialog.java
public void storeSetting() {
	if ( component instanceof JSpinner )
		Settings.set( settingKey, ( (JSpinner) component ).getValue() );
	else if ( component instanceof JSlider )
		Settings.set( settingKey, ( (JSlider) component ).getValue() );
	else if ( component instanceof JTextField )
		Settings.set( settingKey, ( (JTextField) component ).getText() );
	else if ( component instanceof JCheckBox )
		Settings.set( settingKey, ( (JCheckBox) component ).isSelected() );
	else if ( component instanceof JComboBox ) {
		Settings.set( settingKey, ( (JComboBox< ? >) component ).getSelectedIndex() );
		final JComboBox< ? > comboBox = (JComboBox< ? >) component;
		if ( comboBox.isEditable() ) // It's a pre-defined list combo box
			Settings.set( settingKey, comboBox.getSelectedItem() );				
		else                         // Normal combo box
			Settings.set( settingKey, comboBox.getSelectedIndex() );				
	}
}
 
源代码6 项目: buck   文件: BuckSettingsUI.java
private JPanel initUISettingsSection() {
  autoFormatOnBlur = new JCheckBox("Auto-format build files in editor (using buildifier)");
  showDebug = new JCheckBox("Show debug in tool window");

  JPanel panel = new JPanel(new GridBagLayout());
  panel.setBorder(IdeBorderFactory.createTitledBorder("UI Settings", true));

  GridBagConstraints constraints = new GridBagConstraints();
  constraints.fill = GridBagConstraints.HORIZONTAL;
  constraints.anchor = GridBagConstraints.LINE_START;
  constraints.weightx = 1;

  constraints.gridy = 0;
  panel.add(autoFormatOnBlur, constraints);

  constraints.gridy = 1;
  panel.add(showDebug, constraints);
  return panel;
}
 
源代码7 项目: CQL   文件: AqlViewer.java
private <X, Y> void viewAlgebraHelper(JComponent top, Algebra<Ty, En, Sym, Fk, Att, Gen, Sk, X, Y> algebra,
		JPanel out, JCheckBox simp, JSlider sl, Map<Pair<Boolean, Integer>, JScrollPane> cache) {
	boolean b = simp.isSelected();
	int l = sl.getValue();
	Pair<Boolean, Integer> p = new Pair<>(b, l);
	JScrollPane jsp = cache.get(p);
	if (jsp == null) {
		jsp = makeList2(algebra, b, l);
		cache.put(p, jsp);
	}
	out.removeAll();
	out.add(jsp, BorderLayout.CENTER);
	out.add(top, BorderLayout.SOUTH);
	out.revalidate();
	out.repaint();
}
 
源代码8 项目: openjdk-jdk9   文件: 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;
    }
}
 
源代码9 项目: jdk8u60   文件: LWCheckboxPeer.java
CheckboxDelegate() {
    super();
    cb = new JCheckBox() {
        @Override
        public boolean hasFocus() {
            return getTarget().hasFocus();
        }
    };
    rb = new JRadioButton() {
        @Override
        public boolean hasFocus() {
            return getTarget().hasFocus();
        }
    };
    setLayout(null);
    setRadioButton(false);
    add(rb);
    add(cb);
}
 
源代码10 项目: ET_Redux   文件: IncludedFractionsDesktopPane.java
private void ShowIncludedFractionCheckBox(
        AliquotInterface aliquot,
        ValueModel sampleDateModel,
        int width,
        int offset) {
    
    int count = 0;        
    for (ETFractionInterface f : ((ReduxAliquotInterface) aliquot).getAliquotFractions()) {
        JCheckBox temp = new JCheckBox();
        temp.setText(f.getFractionID());
        temp.setBounds(0, (offset + (count ++)) * 20 + 25, width, 15);
        //set checked status
        temp.setSelected(((SampleDateModel)sampleDateModel).includesFractionByName(f.getFractionID()));
        add(temp, javax.swing.JLayeredPane.DEFAULT_LAYER);
    }
    setBounds(
            getX(),
            getY(),
            width,
            (offset + ((ReduxAliquotInterface) aliquot).getAliquotFractions().size() * 20 + 25));
}
 
源代码11 项目: importer-exporter   文件: AddressPanel.java
private void initGui() {
	exportXAL = new JRadioButton();
	exportXAL.setIconTextGap(10);
	exportDB = new JRadioButton();
	exportDB.setIconTextGap(10);
	ButtonGroup exportGroup = new ButtonGroup();
	exportGroup.add(exportXAL);
	exportGroup.add(exportDB);
	exportFallback = new JCheckBox();
	exportFallback.setIconTextGap(10);

	setLayout(new GridBagLayout());
	{
		exportXALPanel = new JPanel();
		add(exportXALPanel, GuiUtil.setConstraints(0,0,1.0,0.0,GridBagConstraints.BOTH,5,0,5,0));
		exportXALPanel.setBorder(BorderFactory.createTitledBorder(""));
		exportXALPanel.setLayout(new GridBagLayout());
		{
			exportXALPanel.add(exportDB, GuiUtil.setConstraints(0,0,1.0,1.0,GridBagConstraints.BOTH,0,5,0,5));
			exportXALPanel.add(exportXAL, GuiUtil.setConstraints(0,1,1.0,1.0,GridBagConstraints.BOTH,0,5,0,5));
			exportXALPanel.add(exportFallback, GuiUtil.setConstraints(0,2,1.0,1.0,GridBagConstraints.BOTH,0,5,0,5));
		}
	}
}
 
源代码12 项目: snap-desktop   文件: PixelInfoTopComponent.java
public PixelInfoTopComponent() {
    setName(Bundle.CTL_PixelInfoTopComponentName());
    setToolTipText(Bundle.CTL_PixelInfoTopComponentDescription());
    putClientProperty(TopComponent.PROP_MAXIMIZATION_DISABLED, Boolean.TRUE);
    putClientProperty(TopComponent.PROP_KEEP_PREFERRED_SIZE_WHEN_SLIDED_IN, Boolean.TRUE);
    pixelPositionListener = new MyPixelPositionListener();
    pinSelectionChangeListener = new PinSelectionChangeListener();
    pinChangedListener = new PinChangedListener();
    pixelInfoView = new PixelInfoView();
    pinCheckbox = new JCheckBox("Snap to selected pin");
    pinCheckbox.setName("pinCheckbox");
    pinCheckbox.setSelected(false);
    pinCheckbox.addActionListener(e -> updatePixelInfo());
    setLayout(new BorderLayout());
    add(pixelInfoView, BorderLayout.CENTER);
    add(pinCheckbox, BorderLayout.SOUTH);

    final SnapApp snapApp = SnapApp.getDefault();
    snapApp.getProductManager().addListener(new PxInfoProductManagerListener());
    setCurrentView(snapApp.getSelectedProductSceneView());
}
 
源代码13 项目: Math-Game   文件: OptionMenu.java
/**
 * Initializes the types panel
 */
private void initTypes() {
	types = new ArrayList<JCheckBox>();
	for (String s : typeNames) {
		types.add(new JCheckBox(s));
	}
	typePanel = new JPanel();
	typePanel.setLayout(new GridBagLayout());
	typePanel.setOpaque(false);
	for (int i = 0; i < types.size(); i++) {
		types.get(i).setFont(eurostile24);
		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.gridx = 0;
		gbc.gridy = i; // Layout buttons going down same column
		typePanel.add(types.get(i), gbc);
		buttonMap.put(typeNames[i], types.get(i));
		types.get(i).setOpaque(false);
		// types.get(i).addActionListener(this);
	}
}
 
源代码14 项目: sldeditor   文件: FieldPanel.java
/**
 * Internal create optional checkbox.
 *
 * @param xPos the x pos
 */
private void internalCreateOptionalCheckbox(int xPos) {
    optionalCheckbox = new JCheckBox();
    optionalCheckbox.setBounds(
            xPos + 5 + BasePanel.LABEL_WIDTH,
            0,
            BasePanel.CHECKBOX_WIDTH,
            BasePanel.WIDGET_HEIGHT);
    optionalCheckbox.setVisible(false);
    optionalCheckbox.addActionListener(
            new ActionListener() {

                @Override
                public void actionPerformed(ActionEvent e) {
                    handleOptionalValue();
                }
            });
    add(optionalCheckbox);
}
 
源代码15 项目: chuidiang-ejemplos   文件: JCheckBoxExample.java
public static void main(String[] args) {
   JFrame frame = new JFrame("JCheckBox Example");
   check = new JCheckBox("Check here ", new ImageIcon("C:/Users/BEEP/Pictures/eclipse-debugger-continuar.png"));
   check2 = new JCheckBox("I'm a mirror");
   
   frame.getContentPane().add(check);
   frame.getContentPane().setLayout(new FlowLayout());
   frame.getContentPane().add(check2);
   frame.pack();
   frame.setLocationRelativeTo(null);
   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   frame.setVisible(true);
   
   check.addActionListener(new ActionListener() {
      
      @Override
      public void actionPerformed(ActionEvent event) {
         check2.setSelected(((JCheckBox)event.getSource()).isSelected());
      }
   });
   
   
}
 
源代码16 项目: netbeans   文件: MarkOccurencesPanel.java
public void store() {
    Preferences node = MarkOccurencesSettings.getCurrentNode();
    for (javax.swing.JCheckBox box : boxes) {
        boolean value = box.isSelected();
        boolean original = node.getBoolean(box.getActionCommand(),
                                           DEFAULT_VALUE);

        if (value != original) {
            node.putBoolean(box.getActionCommand(), value);
        }
    }
    try {
        node.flush();
    } catch (BackingStoreException ex) {
        Exceptions.printStackTrace(ex);
    }
}
 
源代码17 项目: stendhal   文件: SettingsComponentFactory.java
static JCheckBox createSettingsToggle(final String parameter, boolean defaultValue, String label, String tooltip) {
	boolean selected = false;
	JCheckBox toggle = new JCheckBox(label);
	toggle.setToolTipText(tooltip);
	selected = WtWindowManager.getInstance().getPropertyBoolean(parameter, defaultValue);
	toggle.setSelected(selected);

	toggle.addItemListener(new ItemListener(){
		@Override
		public void itemStateChanged(ItemEvent e) {
			boolean enabled = (e.getStateChange() == ItemEvent.SELECTED);
			WtWindowManager.getInstance().setProperty(parameter, Boolean.toString(enabled));
		}
	});
	return toggle;
}
 
源代码18 项目: netbeans   文件: FmtOptions.java
/** Very smart method which tries to set the values in the components correctly
 */
private void loadData( JComponent jc, String optionID, Preferences node ) {

    if ( jc instanceof JTextField ) {
        JTextField field = (JTextField)jc;
        field.setText( node.get(optionID, provider.getDefaultAsString(optionID)) );
    }
    else if ( jc instanceof JCheckBox ) {
        JCheckBox checkBox = (JCheckBox)jc;
        boolean df = provider.getDefaultAsBoolean(optionID);
        checkBox.setSelected( node.getBoolean(optionID, df));
    }
    else if ( jc instanceof JComboBox) {
        JComboBox cb  = (JComboBox)jc;
        String value = node.get(optionID, provider.getDefaultAsString(optionID) );
        ComboBoxModel model = createModel(value);
        cb.setModel(model);
        ComboItem item = whichItem(value, model);
        cb.setSelectedItem(item);
    }

}
 
源代码19 项目: netcdf-java   文件: VariableTable.java
/**
 *
 */
public void createTable() {
  this.setLayout(new BorderLayout());

  JTable table = new JTable(dataModel);
  table.setPreferredScrollableViewportSize(new java.awt.Dimension(500, 70));
  if (col0isDate) {
    table.getColumnModel().getColumn(0).setCellRenderer(new DateRenderer());
  }
  table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);

  // Create the scroll pane and add the table to it.
  JScrollPane scrollPane = new JScrollPane(table);

  // Add the scroll pane to this panel.
  this.removeAll();
  table.setFillsViewportHeight(true);

  add(scrollPane);

  includeGlobals = new JCheckBox("Export Attributes");

  JButton export = new JButton("Export");
  export.addActionListener(e -> export());

  JPanel holderPanel = new JPanel(new BorderLayout());
  holderPanel.add(export, BorderLayout.EAST);
  holderPanel.add(includeGlobals, BorderLayout.CENTER);
  add(holderPanel, BorderLayout.PAGE_END);
}
 
源代码20 项目: snap-desktop   文件: ProductChooser.java
private void addProductCheckers(final StringBuffer description, final JPanel checkersPane,
                                final GridBagConstraints gbc) {
    final ActionListener checkListener = createActionListener();
    for (int i = 0; i < allProducts.length; i++) {
        Product product = allProducts[i];
        boolean checked = false;
        for (Product selectedProduct : selectedProducts) {
            if (product == selectedProduct) {
                checked = true;
                numSelected++;
                break;
            }
        }

        description.setLength(0);
        description.append(product.getDescription() == null ? "" : product.getDescription());

        final JCheckBox check = new JCheckBox(getDisplayName(product), checked);
        check.setFont(SMALL_PLAIN_FONT);
        check.addActionListener(checkListener);

        final JLabel label = new JLabel(description.toString());
        label.setFont(SMALL_ITALIC_FONT);

        gbc.gridy++;
        GridBagUtils.addToPanel(checkersPane, check, gbc, "weightx=0,gridx=0");
        GridBagUtils.addToPanel(checkersPane, label, gbc, "weightx=1,gridx=1");

        checkBoxes[i] = check;
    }
}
 
源代码21 项目: jdk8u60   文件: MetalworksPrefs.java
public JPanel buildConnectingPanel() {
    JPanel connectPanel = new JPanel();
    connectPanel.setLayout(new ColumnLayout());

    JPanel protoPanel = new JPanel();
    JLabel protoLabel = new JLabel("Protocol");
    JComboBox protocol = new JComboBox();
    protocol.addItem("SMTP");
    protocol.addItem("IMAP");
    protocol.addItem("Other...");
    protoPanel.add(protoLabel);
    protoPanel.add(protocol);

    JPanel attachmentPanel = new JPanel();
    JLabel attachmentLabel = new JLabel("Attachments");
    JComboBox attach = new JComboBox();
    attach.addItem("Download Always");
    attach.addItem("Ask size > 1 Meg");
    attach.addItem("Ask size > 5 Meg");
    attach.addItem("Ask Always");
    attachmentPanel.add(attachmentLabel);
    attachmentPanel.add(attach);

    JCheckBox autoConn = new JCheckBox("Auto Connect");
    JCheckBox compress = new JCheckBox("Use Compression");
    autoConn.setSelected(true);

    connectPanel.add(protoPanel);
    connectPanel.add(attachmentPanel);
    connectPanel.add(autoConn);
    connectPanel.add(compress);
    return connectPanel;
}
 
源代码22 项目: openjdk-jdk8u-backup   文件: MetalworksPrefs.java
public JPanel buildConnectingPanel() {
    JPanel connectPanel = new JPanel();
    connectPanel.setLayout(new ColumnLayout());

    JPanel protoPanel = new JPanel();
    JLabel protoLabel = new JLabel("Protocol");
    JComboBox protocol = new JComboBox();
    protocol.addItem("SMTP");
    protocol.addItem("IMAP");
    protocol.addItem("Other...");
    protoPanel.add(protoLabel);
    protoPanel.add(protocol);

    JPanel attachmentPanel = new JPanel();
    JLabel attachmentLabel = new JLabel("Attachments");
    JComboBox attach = new JComboBox();
    attach.addItem("Download Always");
    attach.addItem("Ask size > 1 Meg");
    attach.addItem("Ask size > 5 Meg");
    attach.addItem("Ask Always");
    attachmentPanel.add(attachmentLabel);
    attachmentPanel.add(attach);

    JCheckBox autoConn = new JCheckBox("Auto Connect");
    JCheckBox compress = new JCheckBox("Use Compression");
    autoConn.setSelected(true);

    connectPanel.add(protoPanel);
    connectPanel.add(attachmentPanel);
    connectPanel.add(autoConn);
    connectPanel.add(compress);
    return connectPanel;
}
 
源代码23 项目: importer-exporter   文件: CheckBoxListDecorator.java
public CheckBoxListDecorator(JList<T> list) {
	this.list = list;

	list.setCellRenderer(new CheckBoxListCellRenderer<T>());
	list.addMouseListener(this); 
	list.addPropertyChangeListener(this);
	list.registerKeyboardAction(this, KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0), JComponent.WHEN_FOCUSED); 

	checkBoxSelectionModel = new DefaultListSelectionModel();
	checkBoxSelectionModel.addListSelectionListener(this);

	enabled = new HashMap<Integer, Boolean>();
	width = new JCheckBox().getPreferredSize().width;
}
 
源代码24 项目: netbeans   文件: STSConfigServicePanel.java
private void setChBox(JCheckBox chBox, Boolean enable) {
    if (enable == null) {
        chBox.setSelected(false);
    } else {
        chBox.setSelected(enable);
    }
}
 
源代码25 项目: importer-exporter   文件: AddressPanel.java
private void initGui() {
	importXAL = new JCheckBox();
	importXAL.setIconTextGap(10);

	setLayout(new GridBagLayout());
	{
		importXALPanel = new JPanel();
		add(importXALPanel, GuiUtil.setConstraints(0,0,1.0,0.0,GridBagConstraints.BOTH,5,0,5,0));
		importXALPanel.setBorder(BorderFactory.createTitledBorder(""));
		importXALPanel.setLayout(new GridBagLayout());
		{
			importXALPanel.add(importXAL, GuiUtil.setConstraints(0,0,1.0,1.0,GridBagConstraints.BOTH,0,5,0,5));
		}
	}
}
 
源代码26 项目: Astrosoft   文件: MuhurthaInput.java
public void initComponents(){
    
    //Init controls
    nakPanel = new RasiNakshathraChooser(DisplayStrings.NAK_STR.toString(Language.ENGLISH), nakChooserSize);
    JPanel filterPanel = new JPanel(new AbsoluteLayout());
    chandraFilter = new JCheckBox(DisplayStrings.FILTER_BY_CHANDRA_STR.toString(), true);
    nakFilter = new JCheckBox(DisplayStrings.FILTER_BY_MUHURTHA_STR.toString());
    okButton = new JButton("Ok");
    filterPanel.setBorder(UIConsts.getTitleBorder(DisplayStrings.FILTER_STR.toString()));
    okButton.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e){
            okButtonClicked();
        }
    });
    
    //Create filter panel
    LocationGenerator locGen = new LocationGenerator(origin, 0, 20);
    filterPanel.add(chandraFilter, new AbsoluteConstraints(locGen.getNextRow(), new Dimension(200,20)));
    filterPanel.add(nakFilter, new AbsoluteConstraints(locGen.getNextRow(), new Dimension(200,20)));
    
    //Add nak chooser and filter panel
    dlgPanel.add(nakPanel, new AbsoluteConstraints(nakPanelLoc.getLocation(), nakPanelLoc.getSize()));
    dlgPanel.add(filterPanel, new AbsoluteConstraints(filterPanelLoc.getLocation(), filterPanelLoc.getSize()));
    
    // Add button
    Dimension okButSize = new Dimension(60, 20);
    dlgPanel.add(okButton, new AbsoluteConstraints(new Point((dlgSize.width - okButSize.width) / 2 ,270), okButSize));
    
    // Add outer panel
    add(dlgPanel);
    setBackground(UIConsts.THEME_CLR);
    setVisible(true);
}
 
源代码27 项目: openAGV   文件: BooleanPropertyCellEditor.java
@Override
public Component getTableCellEditorComponent(
    JTable table, Object value, boolean isSelected, int row, int column) {

  setValue(value);
  JCheckBox checkBox = (JCheckBox) getComponent();
  checkBox.setBackground(table.getBackground());

  if (property().getValue() instanceof Boolean) {
    checkBox.setSelected((boolean) property().getValue());
  }

  return fComponent;
}
 
private Component createKmzExportPanel(BindingContext bindingContext) {
    final TableLayout tableLayout = new TableLayout(1);
    tableLayout.setTablePadding(4, 4);
    tableLayout.setTableWeightX(1.0);
    tableLayout.setTableWeightY(0.0);
    tableLayout.setTableFill(TableLayout.Fill.BOTH);
    tableLayout.setTableAnchor(TableLayout.Anchor.NORTHWEST);
    final JPanel panel = new JPanel(tableLayout);
    final JCheckBox exportKmzBox = new JCheckBox("Export output coordinates to Google Earth (KMZ)");
    bindingContext.bind("exportKmz", exportKmzBox);
    panel.add(exportKmzBox);
    return panel;
}
 
源代码29 项目: netbeans   文件: StringEditor.java
@Override
protected Component createCustomEditorGUI(Component resourcePanelGUI) {
    if (resourcePanelGUI == null && ResourceSupport.isResourceableProperty(property)) {
        // not usable for full resourcing, only for internationalization
        // add a NOI18N checkbox so the user can mark the property as not to be internationalized
        Component customEd = delegateEditor.getCustomEditor();
        JPanel panel = new JPanel();
        GroupLayout layout = new GroupLayout(panel);
        panel.setLayout(layout);
        noI18nCheckbox = new JCheckBox();
        Mnemonics.setLocalizedText(noI18nCheckbox, NbBundle.getMessage(StringEditor.class, "CTL_NOI18NCheckBox")); // NOI18N
        noI18nCheckbox.getAccessibleContext().setAccessibleDescription(
                NbBundle.getBundle(
                    StringEditor.class).getString("ACD_NOI18NCheckBox")); //NOI18N
        
        layout.setHorizontalGroup(layout.createParallelGroup()
                .addComponent(customEd)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap().addComponent(noI18nCheckbox).addContainerGap()));
        layout.setVerticalGroup(layout.createSequentialGroup()
                .addComponent(customEd).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(noI18nCheckbox));
        return panel;
    }
    else {
        noI18nCheckbox = null;
        return super.createCustomEditorGUI(resourcePanelGUI);
    }
}
 
源代码30 项目: ccu-historian   文件: DefaultNumberAxisEditor.java
@Override
protected JPanel createTickUnitPanel()
{
    JPanel tickUnitPanel = new JPanel(new LCBLayout(3));
    tickUnitPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));

    tickUnitPanel.add(new JPanel());
    JCheckBox autoTickUnitSelectionCheckBox = new JCheckBox(
            localizationResources.getString("Auto-TickUnit_Selection"),
            isAutoTickUnitSelection());
    autoTickUnitSelectionCheckBox.setActionCommand("AutoTickOnOff");
    autoTickUnitSelectionCheckBox.addActionListener(this);
    setAutoTickUnitSelectionCheckBox(autoTickUnitSelectionCheckBox);
    tickUnitPanel.add(getAutoTickUnitSelectionCheckBox());
    tickUnitPanel.add(new JPanel());

    tickUnitPanel.add(new JLabel(localizationResources.getString(
            "Manual_TickUnit_value")));
    this.manualTickUnit = new JTextField(Double.toString(
            this.manualTickUnitValue));
    this.manualTickUnit.setEnabled(!isAutoTickUnitSelection());
    this.manualTickUnit.setActionCommand("TickUnitValue");
    this.manualTickUnit.addActionListener(this);
    this.manualTickUnit.addFocusListener(this);
    tickUnitPanel.add(this.manualTickUnit);
    tickUnitPanel.add(new JPanel());

    return tickUnitPanel;
}
 
 类所在包
 同包方法