Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 18 paź 2012 · If variable reach four, disable all of checkboxes with setEnabled(false) except those which are checked. When you'll decrease your variable from 4 to 3, set them to enabled. This is good example about ChangeListener: http://www.java2s.com/Code/Java/Event/CheckBoxItemListener.htm

  2. 25 kwi 2013 · You can easily have an int variable that stores how many checkboxes are currently checked... Then any time onCheckedChanged() is called, you check that variable and if it would already be a third checkbox to be checked, you just set it to unchecked again...

  3. 23 paź 2023 · Checkbox (String label, CheckboxGroup group, boolean state) Creates a checkbox with the given label, associates it with the specified CheckboxGroup, and sets the initial state. Methods of checkbox class are inherited by two classes: java.awt.Component. java.lang.Object.

  4. 5 lip 2019 · This article describes how to use JCheckBox component in Swing applications, including code examples, common practices and a demo program. Table of content: Creating a new JCheckBox object. Adding the check box to a container. Setting and getting selected state. Adding event listeners.

  5. 23 maj 2018 · JCheckBox(String text, Icon icon, boolean selected): creates a new checkbox with the string and the icon specified and the boolean value specifies whether it is selected or not. Methods to add Item Listener to checkbox.

  6. The javax.swing.JCheckBox component provides a box with a label that has two states: on and off. If the checkbox is selected, it is represented by a tick in a box. A checkbox can be used to show or hide a splash screen at startup, toggle visibility of a toolbar, etc.

  7. import javax.swing.*; import java.awt.event.*; public class CheckBoxExample { CheckBoxExample () { JFrame f= new JFrame ("CheckBox Example"); final JLabel label = new JLabel (); label.setHorizontalAlignment (JLabel.CENTER); label.setSize (400,100); JCheckBox checkbox1 = new JCheckBox ("C++"); checkbox1.setBounds (150,100, 50,50); JCheckBox ...

  1. Ludzie szukają również