javax.swing.JCheckBox.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(12.4k)|赞(0)|评价(0)|浏览(183)

本文整理了Java中javax.swing.JCheckBox.<init>()方法的一些代码示例,展示了JCheckBox.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JCheckBox.<init>()方法的具体详情如下:
包路径:javax.swing.JCheckBox
类名称:JCheckBox
方法名:<init>

JCheckBox.<init>介绍

暂无

代码示例

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

  1. private JComponent createReplaceAllPanel() {
  2. JPanel panel = new JPanel(new FlowLayout());
  3. String text = UIUtil.replaceMnemonicAmpersand(RefactoringBundle.message("replace.all.occurences", myOccurrencesCount));
  4. myReplaceAllCheckBox = new JCheckBox(text);
  5. panel.add(myReplaceAllCheckBox);
  6. return panel;
  7. }

代码示例来源:origin: libgdx/libgdx

  1. JPanel panel = new JPanel();
  2. panel.add(new JLabel("Global"), new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
  3. new Insets(0, 0, 0, 0), 0, 0));
  4. panel.add(isGlobalCheckBox = new JCheckBox(), new GridBagConstraints(1, 0, 1, 1, 0, 0,
  5. GridBagConstraints.WEST, GridBagConstraints.NONE,
  6. new Insets(0, 0, 0, 0), 0, 0));
  7. contentPanel.add(panel,new GridBagConstraints(0, 1, 1, 1, 0, 0,
  8. GridBagConstraints.WEST, GridBagConstraints.NONE,
  9. new Insets(0, 0, 0, 0), 0, 0));
  10. JPanel spacer = new JPanel();
  11. spacer.setPreferredSize(new Dimension());
  12. contentPanel.add(spacer, new GridBagConstraints(6, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,

代码示例来源:origin: libgdx/libgdx

  1. private void initializeComponents () {
  2. JPanel contentPanel = getContentPanel();
  3. additiveCheckbox = new JCheckBox();
  4. contentPanel.add(additiveCheckbox, new GridBagConstraints(1, 1, 1, 1, 0, 0, GridBagConstraints.WEST,
  5. GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
  6. attachedCheckBox = new JCheckBox();
  7. contentPanel.add(attachedCheckBox, new GridBagConstraints(1, 2, 1, 1, 1, 0, GridBagConstraints.WEST,
  8. GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
  9. continuousCheckbox = new JCheckBox();
  10. contentPanel.add(continuousCheckbox, new GridBagConstraints(1, 3, 1, 1, 0, 0, GridBagConstraints.WEST,
  11. GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
  12. alignedCheckbox = new JCheckBox();
  13. contentPanel.add(alignedCheckbox, new GridBagConstraints(1, 4, 1, 1, 0, 0, GridBagConstraints.WEST,
  14. GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
  15. behindCheckbox = new JCheckBox();
  16. contentPanel.add(behindCheckbox, new GridBagConstraints(1, 5, 1, 1, 0, 0, GridBagConstraints.WEST,
  17. GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
  18. premultipliedAlphaCheckbox = new JCheckBox();
  19. contentPanel.add(premultipliedAlphaCheckbox, new GridBagConstraints(1, 6, 1, 1, 0, 0, GridBagConstraints.WEST,
  20. GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));

代码示例来源:origin: skylot/jadx

  1. public SearchBar(RSyntaxTextArea textArea) {
  2. rTextArea = textArea;
  3. JLabel findLabel = new JLabel(NLS.str("search.find") + ":");
  4. add(findLabel);
  5. add(searchField);
  6. add(prevButton);
  7. add(nextButton);
  8. markAllCB = new JCheckBox(NLS.str("search.mark_all"));
  9. markAllCB.addActionListener(new ForwardListener());
  10. add(markAllCB);
  11. regexCB = new JCheckBox(NLS.str("search.regex"));
  12. regexCB.addActionListener(new ForwardListener());
  13. add(regexCB);
  14. matchCaseCB = new JCheckBox(NLS.str("search.match_case"));
  15. matchCaseCB.addActionListener(new ForwardListener());
  16. add(matchCaseCB);
  17. wholeWordCB = new JCheckBox(NLS.str("search.whole_word"));
  18. wholeWordCB.addActionListener(new ForwardListener());
  19. add(wholeWordCB);

代码示例来源:origin: kiegroup/optaplanner

  1. public ReportFinishedDialog(BenchmarkAggregatorFrame parentFrame, File reportFile) {
  2. super(parentFrame, "Report generation finished");
  3. this.parentFrame = parentFrame;
  4. this.reportFile = reportFile;
  5. addWindowListener(new WindowAdapter() {
  6. @Override
  7. public void windowClosing(WindowEvent e) {
  8. refresh();
  9. }
  10. });
  11. JPanel mainPanel = new JPanel(new BorderLayout(0, 10));
  12. exitCheckBox = new JCheckBox("Exit application", exitApplicationWhenReportFinished);
  13. mainPanel.add(exitCheckBox, BorderLayout.NORTH);
  14. mainPanel.add(createButtonPanel(), BorderLayout.CENTER);
  15. mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
  16. getContentPane().add(mainPanel);
  17. }

代码示例来源:origin: libgdx/libgdx

  1. JPanel panel = new JPanel(new GridBagLayout());
  2. EditorPanel.addContent(panel, i, 0, new JLabel("Shape"), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 0,0);
  3. EditorPanel.addContent(panel, i++,1, shapeCombo = new JComboBox(new DefaultComboBoxModel(spawnShapes)), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 1,0);
  4. EditorPanel.addContent(panel, i, 0, edgesLabel = new JLabel("Edges"), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 0,0);
  5. EditorPanel.addContent(panel, i++, 1, edgesCheckbox = new JCheckBox(), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 0,0);
  6. EditorPanel.addContent(panel, i, 0, sideLabel = new JLabel("Side"), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 0,0);
  7. EditorPanel.addContent(panel, i++, 1, sideCombo = new JComboBox(new DefaultComboBoxModel(SpawnSide.values())), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 1, 0);
  8. edgesCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);

代码示例来源:origin: stackoverflow.com

  1. import java.awt.*;
  2. import javax.swing.*;
  3. class DisableMe {
  4. public static void main(String[] args) {
  5. SwingUtilities.invokeLater(new Runnable() {
  6. public void run() {
  7. JPanel gui = new JPanel(new GridLayout(1,0));
  8. for (int ii=1; ii<7; ii++) {
  9. JCheckBox cb = new JCheckBox(""+ii, ii%3==0);
  10. cb.setEnabled(ii%2==0);
  11. gui.add(cb);
  12. }
  13. JOptionPane.showMessageDialog(null, gui);
  14. }
  15. });
  16. }
  17. }

代码示例来源:origin: stackoverflow.com

  1. PROGRESS_BAR.setMaximum( 100 );
  2. OUTPUT_LABEL = new JLabel( "Processing" );
  3. testFrame.getContentPane().add( PROGRESS_BAR, BorderLayout.CENTER );
  4. testFrame.getContentPane().add( OUTPUT_LABEL, BorderLayout.SOUTH );
  5. testFrame.getContentPane().add( new JCheckBox( "Click me to proof UI is responsive" ), BorderLayout.NORTH );
  6. frame.setVisible( true );

代码示例来源:origin: stanfordnlp/CoreNLP

  1. public FileTreeNode(File file, FileTreeNode parent) {
  2. super(file);
  3. this.setParent(parent);
  4. this.file = file;
  5. boolean isLeaf = file.isFile();
  6. if(isLeaf) {
  7. check = new JCheckBox(this.toString(),isLeaf);
  8. check.setOpaque(true);
  9. check.setBackground(Color.WHITE);
  10. }
  11. else
  12. label = new JLabel(this.toString());
  13. this.setAllowsChildren(!isLeaf);
  14. }

代码示例来源:origin: stackoverflow.com

  1. final Image image = ImageIO.read(new URL("http://sstatic.net/so/img/logo.png"));
  2. final JFrame frame = new JFrame();
  3. frame.add(new ImagePanel(image));
  4. frame.setSize(800, 600);
  5. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  6. frame.setVisible(true);
  7. this.image = image;
  8. this.tile = false;
  9. final JCheckBox checkBox = new JCheckBox();
  10. checkBox.setAction(new AbstractAction("Tile") {
  11. public void actionPerformed(ActionEvent e) {
  12. add(checkBox, BorderLayout.SOUTH);
  13. };

代码示例来源:origin: skylot/jadx

  1. private SettingsGroup makeDecompilationGroup() {
  2. JCheckBox fallback = new JCheckBox();
  3. fallback.setSelected(settings.isFallbackMode());
  4. fallback.addItemListener(e -> {
  5. JCheckBox showInconsistentCode = new JCheckBox();
  6. showInconsistentCode.setSelected(settings.isShowInconsistentCode());
  7. showInconsistentCode.addItemListener(e -> {
  8. JCheckBox resourceDecode = new JCheckBox();
  9. resourceDecode.setSelected(settings.isSkipResources());
  10. resourceDecode.addItemListener(e -> {
  11. JCheckBox autoStartJobs = new JCheckBox();
  12. autoStartJobs.setSelected(settings.isAutoStartJobs());
  13. autoStartJobs.addItemListener(e -> settings.setAutoStartJobs(e.getStateChange() == ItemEvent.SELECTED));
  14. JCheckBox escapeUnicode = new JCheckBox();
  15. escapeUnicode.setSelected(settings.escapeUnicode());
  16. escapeUnicode.addItemListener(e -> {
  17. JCheckBox replaceConsts = new JCheckBox();
  18. replaceConsts.setSelected(settings.isReplaceConsts());
  19. replaceConsts.addItemListener(e -> {
  20. JCheckBox useImports = new JCheckBox();
  21. useImports.setSelected(settings.isUseImports());
  22. useImports.addItemListener(e -> {

代码示例来源:origin: stackoverflow.com

  1. super();
  2. this.setLayout(new BorderLayout());
  3. checkBox = new JCheckBox();
  4. add(checkBox, BorderLayout.CENTER);
  5. setOpaque(false);

代码示例来源:origin: libgdx/libgdx

  1. JPanel panel = new JPanel();
  2. panel.add(new JLabel("Global"), new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
  3. new Insets(0, 0, 0, 0), 0, 0));
  4. panel.add(isGlobalCheckBox = new JCheckBox(), new GridBagConstraints(1, 0, 1, 1, 0, 0,
  5. GridBagConstraints.WEST, GridBagConstraints.NONE,
  6. new Insets(0, 0, 0, 0), 0, 0));
  7. contentPanel.add(panel,new GridBagConstraints(0, 1, 1, 1, 0, 0,
  8. GridBagConstraints.WEST, GridBagConstraints.NONE,
  9. new Insets(0, 0, 0, 0), 0, 0));
  10. JPanel spacer = new JPanel();
  11. spacer.setPreferredSize(new Dimension());
  12. contentPanel.add(spacer, new GridBagConstraints(6, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,

代码示例来源:origin: ballerina-platform/ballerina-lang

  1. @Nullable
  2. @Override
  3. public JComponent createComponent() {
  4. FormBuilder builder = FormBuilder.createFormBuilder();
  5. myCbUseRecursiveReferenceSearch = new JCheckBox("Use recursive reference search");
  6. builder.addComponent(myCbUseRecursiveReferenceSearch);
  7. JPanel result = new JPanel(new BorderLayout());
  8. result.add(builder.getPanel(), BorderLayout.NORTH);
  9. if (myIsDialog) {
  10. result.setPreferredSize(new Dimension(300, -1));
  11. }
  12. return result;
  13. }

代码示例来源:origin: libgdx/libgdx

  1. private void initializeComponents () {
  2. JPanel contentPanel = getContentPanel();
  3. additiveCheckbox = new JCheckBox();
  4. contentPanel.add(additiveCheckbox, new GridBagConstraints(1, 1, 1, 1, 0, 0, GridBagConstraints.WEST,
  5. GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
  6. attachedCheckBox = new JCheckBox();
  7. contentPanel.add(attachedCheckBox, new GridBagConstraints(1, 2, 1, 1, 1, 0, GridBagConstraints.WEST,
  8. GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
  9. continuousCheckbox = new JCheckBox();
  10. contentPanel.add(continuousCheckbox, new GridBagConstraints(1, 3, 1, 1, 0, 0, GridBagConstraints.WEST,
  11. GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
  12. alignedCheckbox = new JCheckBox();
  13. contentPanel.add(alignedCheckbox, new GridBagConstraints(1, 4, 1, 1, 0, 0, GridBagConstraints.WEST,
  14. GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
  15. behindCheckbox = new JCheckBox();
  16. contentPanel.add(behindCheckbox, new GridBagConstraints(1, 5, 1, 1, 0, 0, GridBagConstraints.WEST,
  17. GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
  18. premultipliedAlphaCheckbox = new JCheckBox();
  19. contentPanel.add(premultipliedAlphaCheckbox, new GridBagConstraints(1, 6, 1, 1, 0, 0, GridBagConstraints.WEST,
  20. GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));

代码示例来源:origin: deathmarine/Luyten

  1. JLabel label = new JLabel("Find What:");
  2. textField = new JTextField();
  3. findButton = new JButton("Find");
  4. findButton.addActionListener(new FindButton());
  5. mcase = new JCheckBox("Match Case");
  6. regex = new JCheckBox("Regex");
  7. wholew = new JCheckBox("Whole Words");
  8. classname = new JCheckBox("Classnames");

代码示例来源:origin: libgdx/libgdx

  1. JPanel panel = new JPanel(new GridBagLayout());
  2. EditorPanel.addContent(panel, i, 0, new JLabel("Shape"), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 0,0);
  3. EditorPanel.addContent(panel, i++,1, shapeCombo = new JComboBox(new DefaultComboBoxModel(spawnShapes)), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 1,0);
  4. EditorPanel.addContent(panel, i, 0, edgesLabel = new JLabel("Edges"), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 0,0);
  5. EditorPanel.addContent(panel, i++, 1, edgesCheckbox = new JCheckBox(), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 0,0);
  6. EditorPanel.addContent(panel, i, 0, sideLabel = new JLabel("Side"), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 0,0);
  7. EditorPanel.addContent(panel, i++, 1, sideCombo = new JComboBox(new DefaultComboBoxModel(SpawnSide.values())), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 1, 0);
  8. edgesCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);

代码示例来源:origin: kornilova-l/FlameViewer

  1. /**
  2. * Method generated by IntelliJ IDEA GUI Designer
  3. * >>> IMPORTANT!! <<<
  4. * DO NOT edit this method OR call it in your code!
  5. *
  6. * @noinspection ALL
  7. */
  8. private void $$$setupUI$$$() {
  9. mainPanel = new JPanel();
  10. mainPanel.setLayout(new BorderLayout(0, 0));
  11. excludedMethodForm = new ExcludedMethodForm();
  12. mainPanel.add(excludedMethodForm.$$$getRootComponent$$$(), BorderLayout.CENTER);
  13. saveReturnValueCheckBox = new JCheckBox();
  14. saveReturnValueCheckBox.setText("Save return value");
  15. mainPanel.add(saveReturnValueCheckBox, BorderLayout.SOUTH);
  16. }

代码示例来源:origin: stackoverflow.com

  1. import javax.swing.*;
  2. import java.awt.event.*;
  3. public class Example extends JFrame{
  4. public JCheckBox one;
  5. public Example() {
  6. one = new JCheckBox("CT scan performed");
  7. one.addItemListener(new CheckBoxListener());
  8. setSize(300,300);
  9. getContentPane().add(one);
  10. setVisible(true);
  11. }
  12. private class CheckBoxListener implements ItemListener{
  13. public void itemStateChanged(ItemEvent e) {
  14. if(e.getSource()==one){
  15. if(one.isSelected()) {
  16. System.out.println("one has been selected");
  17. } else {System.out.println("nothing");}
  18. }
  19. }
  20. }
  21. public static void main(String[] args) {
  22. new Example();
  23. }
  24. }

代码示例来源:origin: stackoverflow.com

  1. add(checkBox, BorderLayout.WEST);
  2. add(renderer, BorderLayout.CENTER);
  3. private JTree tree = new JTree();
  4. int hotspot = new JCheckBox().getPreferredSize().width;

相关文章

JCheckBox类方法