Questions tagged [jcheckbox]

JCheckBox is the Java Swing implementation of a check box, an item that can be selected or deselected, and which displays its state to the user.

613 questions
0
votes
1 answer

"Inline" list of checkboxes - auto line break

I have a JPanel (extended by my GeneralOptions class) implemented as: public GeneralOptions() { setLayout(new MigLayout("", "[grow]", "[][][][]")); JLabel lblWyzywienie = new JLabel("Food"); add(lblWyzywienie, "cell 0 0"); …
Jakub Matczak
  • 15,341
  • 5
  • 46
  • 64
0
votes
0 answers

JCheckBox dissapears when repaint is called

I have a JCheckBox on top of an image, but whenever repaint() is called the JCheckBox disappears. If I click on the position where it initially was it becomes visible again. I've tried setting it to setVisible(true) on every repaint but that didn't…
Rene Roosen
  • 168
  • 1
  • 6
0
votes
1 answer

How to check the number of JCheckboxes checked?

I was wondering if there was a way to check the number of checkboxes checked in Java. I found plenty of instruction on how to do in in javascript but not Java. Thanks for you help!
Rostro
  • 148
  • 2
  • 3
  • 15
0
votes
1 answer

JCheckboxes into a JScrollPane

Is there a way to add jcheckboxes into a jscrollpane? I have an array of checkboxes and I want to add them into a Jscrollpane, which i will then add into a JOptionPane. So far I have this: Object[] books = new Object[10000]; books[0] = "Choose…
Paolo Papa
  • 37
  • 4
0
votes
0 answers

JCheckbox in jtable storing values in mysql database

Hi I've this problem : I want to store the checkbox values in a mysql database and loading values for it from that database with this code: String [][]Database = new String[500][10]; String query=null; PreparedStatement pstmt=null; …
0
votes
2 answers

Know all the Checked item at when I press "ok" button SWING

When I click ok button it should print all the checked items. Here is what I tried. I tried the following code, but its not working. public class FilePermission extends JPanel implements ItemListener { static String[] videoAvailable = new…
Learner
  • 425
  • 5
  • 14
0
votes
1 answer

action when component state changed

I have a series of radio buttons generated as an array and displayed in a jPanel. I want a series of checkboxes in a second panel to be enbled when the radio buttons are in output state but not in the input (input or output are the radio choices). I…
Zac
  • 2,229
  • 9
  • 33
  • 41
0
votes
1 answer

Adding JCheckBox Array to JPanel in Netbeans

I've been trying to add an array of JCheckBoxes to a JPanel in Netbeans that has been automatically generated by the Netbeans GUI, when I create an array of the JCheckBoxes and then try to add them to the JPanel using JPanel.add(jCheckboxArray[x]) ,…
Zac
  • 2,229
  • 9
  • 33
  • 41
0
votes
2 answers

Unable to set background color of checkbox at runtime

There is a class AgentHome which extends JFrame. AgentHome has a JPanel rem_panel. Checkboxes are added dynamically into rem_panel…number of checkboxes depending on the number of entries in the database table from where the text to be displayed by…
user1748910
  • 105
  • 3
  • 5
  • 13
0
votes
1 answer

How to get item in a JList and remove it?

I am unable to remove an item from JList. The following code has been put on the JButton. DefaultListModel model = (DefaultListModel) list1.getModel(); int selectedIndex = list1.getSelectedIndex(); if (selectedIndex != -1) { …
VVV
  • 39
  • 1
  • 5
0
votes
1 answer

Adding KeyStroke to JCheckBox

I want to add KeyStrokes to group of CheckBoxes ,so when user hits 1, keystroke will selected / deselected first JCheckBox. I have made this part of code ,but its not working, can somebody point me into correct direction? for (int i=1;i<11;i++) …
Ľubomír
  • 1,075
  • 1
  • 12
  • 20
0
votes
2 answers

Can you create on the fly references to JCheckBox objects?

I am not sure how to ask this. The program I am working on is done, but it seems like it has excessive code. Here is part of the code: chkDef1 = new JCheckBox if (chkDef1.isSelected()) { actual = chkDef1.getText(); } else if…
user1793408
  • 113
  • 11
0
votes
1 answer

Use different datasets on the Same Jfreechart Piedataset

Hi Friends I have a DefaultPieDataset that am Creating this way: package business.intelligence.system; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.Rectangle; import…
Stanley Mungai
  • 4,044
  • 30
  • 100
  • 168
0
votes
0 answers

Improve the Look & Feel of a disabled CheckBox

There are set of check boxes and I select them in my program as required. Since I just need to display selected values, user should not be able to do actions on these check boxes.(i.e. selecting check boxes). Disabling these check boxes(i.e.…
Anuruddha
  • 1,367
  • 6
  • 19
  • 38
0
votes
1 answer

disable Combobox in jtable by click on checkbox

I am trying to do some simple application in java. I rendered some CheckBox and ComboBox in jTable. Now i am trying to do work on that item like getting value, Enable-disable combobox. But i am facing some problem. What i am facing now 1. I…
Sandip Armal Patil
  • 6,241
  • 21
  • 93
  • 160