Problems With Scroll
I have this problem with JScroll where no matter how I change the sizes, the scroll bar doesn't show up or it doesn't scroll when panels are added to the main panel. Btw, the mainPanel adds other panels too it, and when the amount of panels gets out of bounds, its suppose to scroll the panels. Heres the code
AddWorkout(){
//Panels.Dialg and Scroll
screen=new JDialog();
mainPanel=new JPanel();
scroll=new JScrollPane(mainPanel, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
//Objects
frame=new FrameChooser();
image=new ImageLoader();
chooserFrame=new JFrame();
//Screen size
dim = Toolkit.getDefaultToolkit().getScreenSize();
//Layouts
mainPanel.setLayout(null);
screen.setLayout(null);
//methods
frame.newObject(AddWorkout.this);
setDatePanel();
//Sizes
screen.setSize(600,dim.height-20);
mainPanel.setSize(600,dim.height-20);
scroll.setSize(600,dim.height-20);
mainPanel.setPreferredSize(new Dimension(300, 300));
scroll.setPreferredSize(new Dimension(300,300));
//Stuff that you need to worry About
frame.repButton.addActionListener(this);
frame.cooldownButton.addActionListener(this);
frame.stretchButton.addActionListener(this);
frame.warmupButton.addActionListener(this);
frame.longRunButton.addActionListener(this);
frame.fartlekButton.addActionListener(this);
chooserFrame.getContentPane().add(frame.options);
chooserFrame.setSize(500,200);
chooserFrame.setLocation(600,0);
chooserFrame.setVisible(true);
//Last Step
screen.setVisible(true);
screen.getContentPane().add(scroll);
}
Please Help

