Answer the question
In order to leave comments, you need to log in
JCheckBox in JTable Not clickable?
I added a JCheckBox to the table but nothing happens when I click on it.
Its implementation
Random rnd = new Random();
for (int i = 0; i < n; i++) {
beans.add(new MyBean(nameb, priceb, quantityb, rnd.nextBoolean()));
}
public Class<?> getColumnClass(int column) {
switch (column) {
case 0:
return String.class;
case 1:
return Float.class;
case 2:
return Integer.class;
case 3:
return Boolean.class;
}
return Boolean.class;
}
Answer the question
In order to leave comments, you need to log in
Link to documentation
At the moment, the table works only for displaying the component (CellRenderer), you also need to edit (CellEditor). Open the documentation on the link above, skip the renderers and scroll down to the editors, you will understand everything on the ComboBox and ColorChooser primer.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question