In your example, you are not registering an ActionListener
to profsBtn
or officeSpBtn
, you keep registering to coursesBtn
JRadioButton coursesBtn = new JRadioButton("Courses");
//...
coursesBtn.addActionListener(this);
JRadioButton profsBtn = new JRadioButton("Professors");
//...
coursesBtn.addActionListener(this);
JRadioButton officeSpBtn = new JRadioButton("Office Spaces");
//...
coursesBtn.addActionListener(this);
Once I register the ActionListener
to the correct buttons, it works fine
manpreet
Best Answer
2 years ago
I've removed most of my GUI to keep the code short.
I have a buttongroup of 3 JRadioButtons to select the table schema i want to display in my JTable, which is contained in a JScrollPane
I have tried to use
fireTableStructureChanged()
andfireTableDataChanged()
as well asJTable.repaint()
to no avail. Can anyone help me?Here is a simple example that runs a window with my configuration but does not update the table.