import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
public class Sc
You should create your own panel that extends JPanel
containing all checkboxes and in this panel override getPreferredSize()
method like:
@Override
public Dimension getPreferredSize()
{
return new Dimension( 300,300 );
}
and use it in your code:
...
// creating the scroll pane that will scroll the panel.
JScrollPane jscrlPane = new JScrollPane( new MyPanelWithCheckboxes() );
jscrlPane.setBounds( 0, 0, 300, 300 );
...