Select « JCheckBox « Java Swing Q&A





1. Live tracking the number of selected items in a string    stackoverflow.com

In Java Swing I have a simple table where in each row the name of the element and a checkbox is included. Users can select any of the elements contained by ...

2. selected Checkbox    stackoverflow.com

I am new to swing, I would like to ask how can I make this code , so when the submit button is pressed to get the selected checkboxes and display ...

3. Java Swing - JCheckbox with 3 states (full selected, partially selected and deselected)    stackoverflow.com

I want a JCheckbox that has 3 states as shown below:

  1. Partially Selected
  2. Unselected
  3. Full Selected
Q1. Can I use the JCheckbox for the above purpose or have to go for some custom ...

4. Multi selection problem on Swing JCheckbox    stackoverflow.com

I have a list of checkboxes, but I can not make multi selection from this list, it disables the previous selection when I check a new box. how can I change ...

6. retrieve data from database and set JCheckbox to selected / unselected    coderanch.com

hi, I have a JCheckbox on a form and i want to store the info from that JCheckbox into a database (ms access) and also retrieve it back to the form i.e if the checkbox was selected when the form was saved, it should be selected when i retrieve the data. Thanks James

7. JCheckBox Allowable Selections    coderanch.com

How about this? import javax.swing.*; import java.awt.*; import java.awt.event.*; public class ScrollDemo2 extends JFrame { JScrollPane scrollpane; public ScrollDemo2() { super("JScrollPane Demonstration"); setSize(300, 200); setDefaultCloseOperation(EXIT_ON_CLOSE); init(); setVisible(true); } public void init() { JRadioButton form[][] = new JRadioButton[13][3]; String counts[] = { "", "1", "2" }; String categories[] = { "Household", "Office", "Extended Family", "Company (US)", "Company (World)", "Team", "Will", "Birthday Card ...

8. Can't select JCheckBox    coderanch.com

Hello, I created a JTree with checkboxes which I wnat to select, but I can't, why? class MyMenuHandler implements ActionListener, ItemListener { Explorer exp1; public MyMenuHandler(Explorer exp1) { this.exp1 = exp1; } public void actionPerformed(ActionEvent ae) { } public void itemStateChanged(ItemEvent ie) { } public void item2_actionPerformed(ActionEvent e) { FileChooser fc = new FileChooser(); } public void checkBoxStateChanged(ItemEvent e){ JCheckBox checkBox ...

9. TableViewer w/Checkbox Selection    coderanch.com

Hi All, we have an app with a TableViewer containing a check box (image) and our users have requested we provide them the ability to just "swipe" select each row, rather than having to individually click on each one. To be specific, the want to just hold down the left mouse button and drag it over the checkbox cells, to quickly ...





11. JCheckBox Single Selection Issue    coderanch.com

Hey guys, I'm having an issue setting the JCheckBox so that only one of the options can be selected. I made it so that only one can get selected, that works. But let's say if someone wanted to change there mind and switch to the other option, it won't allow them to do so. Instance Variables: private JCheckBox am; private ArrayList ...

12. selecting checkbox of parent node not resulting into selction of checkbox of all desc    java-forums.org

Hi All, Please help me! My code is working fine for parent and child case but child's child not get selected when parent is checked. Please guide me so that I can correct/add in my below written part of my code. {code} tree.setModel(new DefaultTreeModel(rootNode1) { public void valueForPathChanged(TreePath path, Object newValue) { Object currNode = path.getLastPathComponent(); super.valueForPathChanged(path, newValue); if ((currNode != ...

13. Gui Blocked after selected a Jcheckbox    java-forums.org

Hi guys , i wrote a progamm to print msesage while the Jchekbox is selected , but the problem is : my gui completely blocked when i check my box (also my jCheckBox is no more selectable). can someone tell me how to resolve the problem ? . here is my code : The red marked code block the gui ( ...

14. Finding which JCheckBox was selected and putting a 1 in an int array    forums.oracle.com

I have got another array, but of integers of length 32, which are initially set to all 0's. When the user selects a checkbox, I want to place a 1 in the int array at the appropriate index. E.g., if the user selects the 5th checkbox then a 1 is placed at the 5th value in the int array like so ...