本文整理了Java中javax.swing.JCheckBox.<init>()
方法的一些代码示例,展示了JCheckBox.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JCheckBox.<init>()
方法的具体详情如下:
包路径:javax.swing.JCheckBox
类名称:JCheckBox
方法名:<init>
暂无
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
private JComponent createReplaceAllPanel() {
JPanel panel = new JPanel(new FlowLayout());
String text = UIUtil.replaceMnemonicAmpersand(RefactoringBundle.message("replace.all.occurences", myOccurrencesCount));
myReplaceAllCheckBox = new JCheckBox(text);
panel.add(myReplaceAllCheckBox);
return panel;
}
代码示例来源:origin: libgdx/libgdx
JPanel panel = new JPanel();
panel.add(new JLabel("Global"), new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
new Insets(0, 0, 0, 0), 0, 0));
panel.add(isGlobalCheckBox = new JCheckBox(), new GridBagConstraints(1, 0, 1, 1, 0, 0,
GridBagConstraints.WEST, GridBagConstraints.NONE,
new Insets(0, 0, 0, 0), 0, 0));
contentPanel.add(panel,new GridBagConstraints(0, 1, 1, 1, 0, 0,
GridBagConstraints.WEST, GridBagConstraints.NONE,
new Insets(0, 0, 0, 0), 0, 0));
JPanel spacer = new JPanel();
spacer.setPreferredSize(new Dimension());
contentPanel.add(spacer, new GridBagConstraints(6, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
代码示例来源:origin: libgdx/libgdx
private void initializeComponents () {
JPanel contentPanel = getContentPanel();
additiveCheckbox = new JCheckBox();
contentPanel.add(additiveCheckbox, new GridBagConstraints(1, 1, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
attachedCheckBox = new JCheckBox();
contentPanel.add(attachedCheckBox, new GridBagConstraints(1, 2, 1, 1, 1, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
continuousCheckbox = new JCheckBox();
contentPanel.add(continuousCheckbox, new GridBagConstraints(1, 3, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
alignedCheckbox = new JCheckBox();
contentPanel.add(alignedCheckbox, new GridBagConstraints(1, 4, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
behindCheckbox = new JCheckBox();
contentPanel.add(behindCheckbox, new GridBagConstraints(1, 5, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
premultipliedAlphaCheckbox = new JCheckBox();
contentPanel.add(premultipliedAlphaCheckbox, new GridBagConstraints(1, 6, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
代码示例来源:origin: skylot/jadx
public SearchBar(RSyntaxTextArea textArea) {
rTextArea = textArea;
JLabel findLabel = new JLabel(NLS.str("search.find") + ":");
add(findLabel);
add(searchField);
add(prevButton);
add(nextButton);
markAllCB = new JCheckBox(NLS.str("search.mark_all"));
markAllCB.addActionListener(new ForwardListener());
add(markAllCB);
regexCB = new JCheckBox(NLS.str("search.regex"));
regexCB.addActionListener(new ForwardListener());
add(regexCB);
matchCaseCB = new JCheckBox(NLS.str("search.match_case"));
matchCaseCB.addActionListener(new ForwardListener());
add(matchCaseCB);
wholeWordCB = new JCheckBox(NLS.str("search.whole_word"));
wholeWordCB.addActionListener(new ForwardListener());
add(wholeWordCB);
代码示例来源:origin: kiegroup/optaplanner
public ReportFinishedDialog(BenchmarkAggregatorFrame parentFrame, File reportFile) {
super(parentFrame, "Report generation finished");
this.parentFrame = parentFrame;
this.reportFile = reportFile;
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
refresh();
}
});
JPanel mainPanel = new JPanel(new BorderLayout(0, 10));
exitCheckBox = new JCheckBox("Exit application", exitApplicationWhenReportFinished);
mainPanel.add(exitCheckBox, BorderLayout.NORTH);
mainPanel.add(createButtonPanel(), BorderLayout.CENTER);
mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
getContentPane().add(mainPanel);
}
代码示例来源:origin: libgdx/libgdx
JPanel panel = new JPanel(new GridBagLayout());
EditorPanel.addContent(panel, i, 0, new JLabel("Shape"), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 0,0);
EditorPanel.addContent(panel, i++,1, shapeCombo = new JComboBox(new DefaultComboBoxModel(spawnShapes)), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 1,0);
EditorPanel.addContent(panel, i, 0, edgesLabel = new JLabel("Edges"), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 0,0);
EditorPanel.addContent(panel, i++, 1, edgesCheckbox = new JCheckBox(), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 0,0);
EditorPanel.addContent(panel, i, 0, sideLabel = new JLabel("Side"), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 0,0);
EditorPanel.addContent(panel, i++, 1, sideCombo = new JComboBox(new DefaultComboBoxModel(SpawnSide.values())), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 1, 0);
edgesCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);
代码示例来源:origin: stackoverflow.com
import java.awt.*;
import javax.swing.*;
class DisableMe {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JPanel gui = new JPanel(new GridLayout(1,0));
for (int ii=1; ii<7; ii++) {
JCheckBox cb = new JCheckBox(""+ii, ii%3==0);
cb.setEnabled(ii%2==0);
gui.add(cb);
}
JOptionPane.showMessageDialog(null, gui);
}
});
}
}
代码示例来源:origin: stackoverflow.com
PROGRESS_BAR.setMaximum( 100 );
OUTPUT_LABEL = new JLabel( "Processing" );
testFrame.getContentPane().add( PROGRESS_BAR, BorderLayout.CENTER );
testFrame.getContentPane().add( OUTPUT_LABEL, BorderLayout.SOUTH );
testFrame.getContentPane().add( new JCheckBox( "Click me to proof UI is responsive" ), BorderLayout.NORTH );
frame.setVisible( true );
代码示例来源:origin: stanfordnlp/CoreNLP
public FileTreeNode(File file, FileTreeNode parent) {
super(file);
this.setParent(parent);
this.file = file;
boolean isLeaf = file.isFile();
if(isLeaf) {
check = new JCheckBox(this.toString(),isLeaf);
check.setOpaque(true);
check.setBackground(Color.WHITE);
}
else
label = new JLabel(this.toString());
this.setAllowsChildren(!isLeaf);
}
代码示例来源:origin: stackoverflow.com
final Image image = ImageIO.read(new URL("http://sstatic.net/so/img/logo.png"));
final JFrame frame = new JFrame();
frame.add(new ImagePanel(image));
frame.setSize(800, 600);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
this.image = image;
this.tile = false;
final JCheckBox checkBox = new JCheckBox();
checkBox.setAction(new AbstractAction("Tile") {
public void actionPerformed(ActionEvent e) {
add(checkBox, BorderLayout.SOUTH);
};
代码示例来源:origin: skylot/jadx
private SettingsGroup makeDecompilationGroup() {
JCheckBox fallback = new JCheckBox();
fallback.setSelected(settings.isFallbackMode());
fallback.addItemListener(e -> {
JCheckBox showInconsistentCode = new JCheckBox();
showInconsistentCode.setSelected(settings.isShowInconsistentCode());
showInconsistentCode.addItemListener(e -> {
JCheckBox resourceDecode = new JCheckBox();
resourceDecode.setSelected(settings.isSkipResources());
resourceDecode.addItemListener(e -> {
JCheckBox autoStartJobs = new JCheckBox();
autoStartJobs.setSelected(settings.isAutoStartJobs());
autoStartJobs.addItemListener(e -> settings.setAutoStartJobs(e.getStateChange() == ItemEvent.SELECTED));
JCheckBox escapeUnicode = new JCheckBox();
escapeUnicode.setSelected(settings.escapeUnicode());
escapeUnicode.addItemListener(e -> {
JCheckBox replaceConsts = new JCheckBox();
replaceConsts.setSelected(settings.isReplaceConsts());
replaceConsts.addItemListener(e -> {
JCheckBox useImports = new JCheckBox();
useImports.setSelected(settings.isUseImports());
useImports.addItemListener(e -> {
代码示例来源:origin: stackoverflow.com
super();
this.setLayout(new BorderLayout());
checkBox = new JCheckBox();
add(checkBox, BorderLayout.CENTER);
setOpaque(false);
代码示例来源:origin: libgdx/libgdx
JPanel panel = new JPanel();
panel.add(new JLabel("Global"), new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
new Insets(0, 0, 0, 0), 0, 0));
panel.add(isGlobalCheckBox = new JCheckBox(), new GridBagConstraints(1, 0, 1, 1, 0, 0,
GridBagConstraints.WEST, GridBagConstraints.NONE,
new Insets(0, 0, 0, 0), 0, 0));
contentPanel.add(panel,new GridBagConstraints(0, 1, 1, 1, 0, 0,
GridBagConstraints.WEST, GridBagConstraints.NONE,
new Insets(0, 0, 0, 0), 0, 0));
JPanel spacer = new JPanel();
spacer.setPreferredSize(new Dimension());
contentPanel.add(spacer, new GridBagConstraints(6, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
代码示例来源:origin: ballerina-platform/ballerina-lang
@Nullable
@Override
public JComponent createComponent() {
FormBuilder builder = FormBuilder.createFormBuilder();
myCbUseRecursiveReferenceSearch = new JCheckBox("Use recursive reference search");
builder.addComponent(myCbUseRecursiveReferenceSearch);
JPanel result = new JPanel(new BorderLayout());
result.add(builder.getPanel(), BorderLayout.NORTH);
if (myIsDialog) {
result.setPreferredSize(new Dimension(300, -1));
}
return result;
}
代码示例来源:origin: libgdx/libgdx
private void initializeComponents () {
JPanel contentPanel = getContentPanel();
additiveCheckbox = new JCheckBox();
contentPanel.add(additiveCheckbox, new GridBagConstraints(1, 1, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
attachedCheckBox = new JCheckBox();
contentPanel.add(attachedCheckBox, new GridBagConstraints(1, 2, 1, 1, 1, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
continuousCheckbox = new JCheckBox();
contentPanel.add(continuousCheckbox, new GridBagConstraints(1, 3, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
alignedCheckbox = new JCheckBox();
contentPanel.add(alignedCheckbox, new GridBagConstraints(1, 4, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
behindCheckbox = new JCheckBox();
contentPanel.add(behindCheckbox, new GridBagConstraints(1, 5, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
premultipliedAlphaCheckbox = new JCheckBox();
contentPanel.add(premultipliedAlphaCheckbox, new GridBagConstraints(1, 6, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
代码示例来源:origin: deathmarine/Luyten
JLabel label = new JLabel("Find What:");
textField = new JTextField();
findButton = new JButton("Find");
findButton.addActionListener(new FindButton());
mcase = new JCheckBox("Match Case");
regex = new JCheckBox("Regex");
wholew = new JCheckBox("Whole Words");
classname = new JCheckBox("Classnames");
代码示例来源:origin: libgdx/libgdx
JPanel panel = new JPanel(new GridBagLayout());
EditorPanel.addContent(panel, i, 0, new JLabel("Shape"), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 0,0);
EditorPanel.addContent(panel, i++,1, shapeCombo = new JComboBox(new DefaultComboBoxModel(spawnShapes)), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 1,0);
EditorPanel.addContent(panel, i, 0, edgesLabel = new JLabel("Edges"), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 0,0);
EditorPanel.addContent(panel, i++, 1, edgesCheckbox = new JCheckBox(), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 0,0);
EditorPanel.addContent(panel, i, 0, sideLabel = new JLabel("Side"), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 0,0);
EditorPanel.addContent(panel, i++, 1, sideCombo = new JComboBox(new DefaultComboBoxModel(SpawnSide.values())), false, GridBagConstraints.WEST, GridBagConstraints.NONE, 1, 0);
edgesCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);
代码示例来源:origin: kornilova-l/FlameViewer
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
mainPanel = new JPanel();
mainPanel.setLayout(new BorderLayout(0, 0));
excludedMethodForm = new ExcludedMethodForm();
mainPanel.add(excludedMethodForm.$$$getRootComponent$$$(), BorderLayout.CENTER);
saveReturnValueCheckBox = new JCheckBox();
saveReturnValueCheckBox.setText("Save return value");
mainPanel.add(saveReturnValueCheckBox, BorderLayout.SOUTH);
}
代码示例来源:origin: stackoverflow.com
import javax.swing.*;
import java.awt.event.*;
public class Example extends JFrame{
public JCheckBox one;
public Example() {
one = new JCheckBox("CT scan performed");
one.addItemListener(new CheckBoxListener());
setSize(300,300);
getContentPane().add(one);
setVisible(true);
}
private class CheckBoxListener implements ItemListener{
public void itemStateChanged(ItemEvent e) {
if(e.getSource()==one){
if(one.isSelected()) {
System.out.println("one has been selected");
} else {System.out.println("nothing");}
}
}
}
public static void main(String[] args) {
new Example();
}
}
代码示例来源:origin: stackoverflow.com
add(checkBox, BorderLayout.WEST);
add(renderer, BorderLayout.CENTER);
private JTree tree = new JTree();
int hotspot = new JCheckBox().getPreferredSize().width;
内容来源于网络,如有侵权,请联系作者删除!