本文整理汇总了Java中javax.swing.JCheckBox.addChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java JCheckBox.addChangeListener方法的具体用法?Java JCheckBox.addChangeListener怎么用?Java JCheckBox.addChangeListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JCheckBox
的用法示例。
在下文中一共展示了JCheckBox.addChangeListener方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: connect
import javax.swing.JCheckBox; //导入方法依赖的package包/类
void connect( JTree errorTree, DefaultTreeModel errModel, JComboBox severityComboBox,
JCheckBox tasklistCheckBox, JPanel customizerPanel,
JEditorPane descriptionTextArea) {
this.errorTree = errorTree;
this.errModel = errModel;
this.severityComboBox = severityComboBox;
this.tasklistCheckBox = tasklistCheckBox;
this.customizerPanel = customizerPanel;
this.descriptionTextArea = descriptionTextArea;
valueChanged( null );
errorTree.addKeyListener(this);
errorTree.addMouseListener(this);
errorTree.getSelectionModel().addTreeSelectionListener(this);
severityComboBox.addActionListener(this);
tasklistCheckBox.addChangeListener(this);
}
示例2: connect
import javax.swing.JCheckBox; //导入方法依赖的package包/类
void connect( JTree errorTree, JComboBox severityComboBox,
JCheckBox tasklistCheckBox, JPanel customizerPanel,
JEditorPane descriptionTextArea) {
this.errorTree = errorTree;
this.severityComboBox = severityComboBox;
this.tasklistCheckBox = tasklistCheckBox;
this.customizerPanel = customizerPanel;
this.descriptionTextArea = descriptionTextArea;
valueChanged( null );
errorTree.addKeyListener(this);
errorTree.addMouseListener(this);
errorTree.getSelectionModel().addTreeSelectionListener(this);
severityComboBox.addActionListener(this);
tasklistCheckBox.addChangeListener(this);
}
示例3: JGroup
import javax.swing.JCheckBox; //导入方法依赖的package包/类
public JGroup(String title, boolean selected)
{
inner = new JPanel();
JPanel outer = new JPanel(new GridLayout(1, 1));
outer.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(),
BorderFactory.createEmptyBorder(5, 5, 5, 5)));
outer.add(inner);
button = new JCheckBox(title, selected);
button.addActionListener(this);
button.addChangeListener(this);
super.setLayout(new BorderLayout());
add(button, BorderLayout.NORTH);
add(outer, BorderLayout.CENTER);
}
示例4: connect
import javax.swing.JCheckBox; //导入方法依赖的package包/类
void connect( final JTree errorTree, DefaultTreeModel errorTreeModel, JLabel severityLabel, JComboBox severityComboBox,
JCheckBox tasklistCheckBox, JPanel customizerPanel,
JEditorPane descriptionTextArea, final JComboBox configCombo, JButton editScript,
HintsSettings settings, boolean direct) {
this.errorTree = errorTree;
this.errorTreeModel = errorTreeModel;
this.severityLabel = severityLabel;
this.severityComboBox = severityComboBox;
this.tasklistCheckBox = tasklistCheckBox;
this.customizerPanel = customizerPanel;
this.descriptionTextArea = descriptionTextArea;
this.configCombo = configCombo;
this.editScript = editScript;
this.direct = direct;
if (configCombo.getSelectedItem() !=null) {
originalSettings = ((Configuration) configCombo.getSelectedItem()).getSettings();
} else if (settings != null) {
originalSettings = settings;
} else {
originalSettings = HintsSettings.getGlobalSettings();
}
writableSettings = new WritableSettings(originalSettings, direct);
valueChanged( null );
errorTree.addKeyListener(this);
errorTree.addMouseListener(this);
errorTree.getSelectionModel().addTreeSelectionListener(this);
this.configCombo.addItemListener(this);
severityComboBox.addActionListener(this);
tasklistCheckBox.addChangeListener(this);
}
示例5: addListeners
import javax.swing.JCheckBox; //导入方法依赖的package包/类
private void addListeners() {
ChangeListener cl = new CheckChangeListener();
for( JCheckBox box : boxes ) {
box.addChangeListener(cl);
}
}
示例6: createCollapseControl
import javax.swing.JCheckBox; //导入方法依赖的package包/类
protected Component createCollapseControl(String title, String tooltip) {
Box box = Box.createHorizontalBox();
expand = new JCheckBox(title);
expand.setBorder(new EmptyBorder(0, 4, 0, 0));
expand.setToolTipText(tooltip);
expand.setHorizontalTextPosition(JCheckBox.RIGHT);
expand.setIcon(new ArrowIcon(ArrowIcon.EAST));
setCollapsedIcon(new ArrowIcon(ArrowIcon.EAST));
setExpandedIcon(new ArrowIcon(ArrowIcon.SOUTH));
expand.setSelected(isExpanded());
expand.setFocusPainted(false);
expand.addChangeListener(new CollapseListener());
box.add(expand);
return box;
}
示例7: BoolInterpolator
import javax.swing.JCheckBox; //导入方法依赖的package包/类
public BoolInterpolator(float startVal, GetSet gs, ChangeListener... listeners) {
super(startVal, gs, listeners);
manualBox = new JCheckBox("Enable", startVal > .5f);
manualBox.addChangeListener(ce -> {
fireChangeEvent();
});
}
示例8: BracketingList
import javax.swing.JCheckBox; //导入方法依赖的package包/类
public BracketingList(String cname, int size)
{
super(new MigLayout("fill"), false);
model = new BracketingListModel();
required = size;
spinner = new JSpinner(new SpinnerNumberModel(size, size/2+1, size, 1));
spinner.addChangeListener(this);
ladiesCheck = new JCheckBox("Ladies Classes", true);
ladiesCheck.addChangeListener(this);
openCheck = new JCheckBox("Open Classes", true);
openCheck.addChangeListener(this);
bonusCheck = new JCheckBox("Bonus Style Dialins", true);
bonusCheck.addChangeListener(this);
table = new JTable(model);
table.setAutoCreateRowSorter(true);
table.setDefaultRenderer(Double.class, new D3Renderer());
table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
table.getColumnModel().getColumn(0).setMaxWidth(50);
table.getColumnModel().getColumn(1).setMaxWidth(200);
table.getColumnModel().getColumn(2).setMaxWidth(200);
table.getColumnModel().getColumn(3).setMaxWidth(75);
table.getColumnModel().getColumn(4).setMaxWidth(75);
mainPanel.add(new JLabel("Number of Drivers"), "split");
mainPanel.add(spinner, "gapbottom 10, wrap");
mainPanel.add(ladiesCheck, "wrap");
mainPanel.add(openCheck, "wrap");
mainPanel.add(bonusCheck, "gapbottom 10, wrap");
mainPanel.add(new JLabel("Click on column header to sort"), "center, wrap");
mainPanel.add(new JScrollPane(table), "width 400, height 600, grow");
}
示例9: redraw
import javax.swing.JCheckBox; //导入方法依赖的package包/类
public void redraw() {
if (data.hasResults() && data.areResultsOK()
&& data.getResults().getSaturationSectors().size() > 0) {
if (data.getClasses() == 2) {
this.removeAll();
painter2D = new Convex2DGraph(data, mainWin);
this.setLayout(new BorderLayout());
showLabelsBox = new JCheckBox(
JabaConstants.OPTION_SHOW_ONLY_BOTTLENECK, true);
showLabelsBox.setSelected(false);
showLabelsBox.addActionListener(this);
showLabelsBox.addChangeListener(this);
showLabelsBox.addItemListener(this);
this.add(showLabelsBox, BorderLayout.PAGE_START);
this.add(new JabaCanvas(painter2D), BorderLayout.CENTER);
this.add(new JLabel(JabaConstants.DESCRIPITION_CONVEX_2D_GRAPH),
BorderLayout.PAGE_END);
repaint();
} else if (data.getClasses() == 3) {
this.removeAll();
painter3D = new Convex3DGraph(data, mainWin);
this.setLayout(new BorderLayout());
this.add(make3DOptionPanel(), BorderLayout.EAST);
this.add(new JabaCanvas(painter3D), BorderLayout.CENTER);
this.add(new JLabel(JabaConstants.DESCRIPITION_GRAPH),
BorderLayout.PAGE_END);
repaint();
}
} else {
this.removeAll();
JEditorPane synView = new JTextPane();
synView.setContentType("text/html");
synView.setEditable(false);
JScrollPane synScroll = new JScrollPane(synView);
synScroll
.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
synScroll
.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
synView.setText("<html><body><center><font face=\"bold\" size=\"3\">Saturation Sectors will be here displayed once you solve the model.</font></center></body></html>");
this.add(synScroll);
repaint();
}
}
示例10: make3DOptionPanel
import javax.swing.JCheckBox; //导入方法依赖的package包/类
private JPanel make3DOptionPanel() {
JPanel omni = new JPanel(new BorderLayout());
omni.setBorder(BorderFactory.createEmptyBorder(BORDER_SIZE,
BORDER_SIZE, BORDER_SIZE, BORDER_SIZE));
JPanel res = new JPanel(new SpringLayout());
//FIRST ROW
String[] renderMode = {SOLID, WIREFRAME, POINTS};
renderModeComboBox = new JComboBox(renderMode);
renderModeComboBox.addActionListener(this);
res.add(new JLabel("Render mode"));
res.add(renderModeComboBox);
//SECOND ROW
res.add(new JLabel("View labels"));
showLabels3DBox = new JCheckBox(
"", true);
showLabels3DBox.addActionListener(this);
showLabels3DBox.addChangeListener(this);
showLabels3DBox.addItemListener(this);
res.add(showLabels3DBox);
//THIRD ROW
res.add(new JLabel("Show only bottlenecks "));
showOnlyBottleneckBox = new JCheckBox(
"", true);
showOnlyBottleneckBox.addActionListener(this);
showOnlyBottleneckBox.addChangeListener(this);
showOnlyBottleneckBox.addItemListener(this);
res.add(showOnlyBottleneckBox);
//FOURTH ROW
String stations[] = new String[data.getStations()+1];
stations[0] = null;
for (int i = 0; i < data.getStations(); i++)
stations[i+1] = data.getStationNames()[i];
stationList = new JComboBox(stations);
stationList.addActionListener(this);
res.add(new JLabel("Select"));
res.add(new JScrollPane(stationList));
SpringUtilities.makeCompactGrid(res, 4, 2, //rows, cols
6, 6, //initX, initY
6, 6);//xPad, yPad
//CENTER PANEL
omni.add(res, BorderLayout.NORTH);
omni.add(new JLabel(JabaConstants.CONVEX_HULL_VERTEX_EXPLANATION), BorderLayout.CENTER);
omni.add(new JLabel(" "), BorderLayout.SOUTH);
return omni;
}
示例11: CreditsFrame
import javax.swing.JCheckBox; //导入方法依赖的package包/类
public CreditsFrame() {
super("Credits");
setLayout(new GridBagLayout());
GridBagConstraints gbc = ViewUtils.createGBC();
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.weighty=1;
gbc.insets = new Insets(0, 10, 10, 10);
JLabel logoLabel = new JLabel(new ImageIcon(ImageTools.scaleToHeight(ImageTools.getResourceImage("icon.png"), 100, false)));
logoLabel.setText("<HTML>GIFKR © 2017 Caleb Kussmaul");
logoLabel.setHorizontalTextPosition(JLabel.CENTER);
logoLabel.setVerticalTextPosition(JLabel.BOTTOM);
add(logoLabel, gbc);
gbc.gridy++;
gbc.weighty=0;
JTextPane dedicationPane = new JTextPane();
dedicationPane.setText("Dedicated to my dad, Wes Kussmaul, for inspiring my passion for programming, creativity, and entrepreneurship.");
dedicationPane.setOpaque(false);
dedicationPane.setEditable(false);
ViewUtils.centerText(dedicationPane);
add(dedicationPane, gbc);
gbc.gridy++;
JTextPane copyrightPane = new JTextPane();
copyrightPane.setText("Referenced libraries:\nOpen-Imaging under Apache 2.0\nJavaCV under Apache 2.0\nFFmpeg under LGPL 2.1");
add(copyrightPane, gbc);
gbc.gridy++;
gbc.fill = GridBagConstraints.NONE;
gbc.anchor = GridBagConstraints.CENTER;
JCheckBox doNotShowBox = new JCheckBox("Do not show again", !GIFKRPrefs.showCreditsFrame());
doNotShowBox.addChangeListener(ce -> {
GIFKRPrefs.setShowCreditsFrame(!doNotShowBox.isSelected());
});
add(doNotShowBox, gbc);
setSize(500, 350);
setLocationRelativeTo(null);
setAlwaysOnTop(true);
}
示例12: SnifferControl
import javax.swing.JCheckBox; //导入方法依赖的package包/类
public SnifferControl() {
super();
setLayout(new FlowLayout(FlowLayout.LEFT, 2, 0));
_hostIpTextField = new JTextField(17);
_hostIpTextField.setText(Resources.getLabel("sniffer.host.tooltip"));
final FirstInputListener listener = new FirstInputListener(_hostIpTextField);
_hostIpTextField.addMouseListener(listener);
_hostIpTextField.addKeyListener(listener);
_hostIpTextField.setToolTipText(Resources.getLabel("sniffer.host.tooltip"));
add(_hostIpTextField);
final JLabel protocolLabel = new JLabel(Resources.getLabel("protocol.label"));
protocolLabel.setToolTipText(Resources.getLabel("protocol.desc"));
add(protocolLabel);
for (final Protocol type : Protocol.values()) {
if (type == Protocol.OTHER) {
continue;
}
final JCheckBox check = new JCheckBox(type.name(), type == Protocol.TCP);
_packets.put(type, check);
add(check);
}
final JLabel portLabel = new JLabel(Resources.getLabel("port.label"));
portLabel.setToolTipText(Resources.getLabel("port.desc"));
_allPortCheck = new JCheckBox(Resources.getLabel("all.port.label"));
_allPortCheck.setToolTipText(Resources.getLabel("all.port.desc"));
_allPortCheck.setSelected(false);
add(_allPortCheck);
_portTF = new JFormattedTextField();
_portTF.setText("80,443");
_portTF.setColumns(15);
// _portTF.setMaximumSize(new Dimension(30, _portTF.getPreferredSize().height));
add(portLabel);
add(_portTF);
_portTF.setEnabled(true);
_allPortCheck.addChangeListener(e -> _portTF.setEnabled(!_allPortCheck.isSelected()));
_filterPacketLengthCheck = new JCheckBox(Resources.getLabel("filter.length"));
_filterPacketLengthCheck.setToolTipText(Resources.getLabel("filter.length.desc"));
_filterPacketLengthCheck.setSelected(false);
add(_filterPacketLengthCheck);
_filterLengthTF = new JFormattedTextField(new NumberFormatterFactory());
_filterLengthTF.setText("128");
_filterLengthTF.setColumns(5);
add(_filterLengthTF);
_filterPacketLengthCheck.addChangeListener(e -> _filterLengthTF.setEnabled(_filterPacketLengthCheck.isEnabled() && _filterPacketLengthCheck.isSelected()));
_capturePeriod = new JFormattedTextField(new NumberFormatterFactory());
_capturePeriod.setText("0");
_capturePeriod.setColumns(5);
add(new JLabel(Resources.getLabel("capture.period")));
add(_capturePeriod);
_captureButton = new JButton(GO_IMG);
_captureButton.setToolTipText(Resources.getLabel("capture.packet.start"));
add(_captureButton);
_captureButton.addActionListener(arg0 -> start());
}