I have a JPanel on which 15 JCheckBoxes have been put. I want to put a vertical and horizontal JScrollBar so that i can scroll to the 15th JCheckBox. having 15 check boxes otherwise makes the window too bag. Sample code will be appreciated. I am desperately in need of this code snippet as early as possible.
Thanks Nathan, I had done that (putting the JCheckBoxes in the JPanel and then the JPanel in the JScrollPane) but the scroll pane doesnt show up. FYI I am not setting any layout for the JPanel in the JScrollPane. Waiting for your reponse. Thanks in advance.
Hi Give some size to the ScrollPane using setPreferredSize(new Dimension(int,int)); or else you could in the JScrollPane constructor itself specify whether you always want a vertical / horizontal scrollbar. Vinod