I have a Java connection with MySQL database. I inserted 30 variable to a MySQL table. I would like to create a graphical interface with Jframe where I can select the variables from the table using a checkbox.
I plan to do something similar as Java Swing Group of checkbox multiple selection handler
But I do not know how I can use it with NetBeans? I tried to add a newJFrame where I add a jScrollPane and I wanted to add multiple jCheckBoxes but I can add only one to jScrollPane.
Could someone let me know how I should add a group of checkboxes to jScrollPane?
You have to add a JPanel to your JScrollPane, then add checkboxes to that JPanel.
JPanel panel = new JPanel(layout);
panel.add(checkbox1);
panel.add(checkbox2);
JScrollPane scrollPane = new JScrollPane(panel);