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. Returns a string representation of this JCheckBox. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations.

  4. setLayout(new GridLayout(3, 1)); add(new Checkbox("one", null, true)); add(new Checkbox("two")); add(new Checkbox("three"));

  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. addActionListener (ItemListener l): adds item listener to the component.

  6. 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 ...

  7. 22 kwi 2023 · var keyword in Java. The var reserved type name (not a Java keyword) was introduced in Java 10. Type inference is used in var keyword in which it detects automatically the datatype of a variable based on the surrounding context.

  1. Ludzie szukają również