While I am familiar java but i am basically new to creating a GUI using java. I need to make it so when a user clicks on a button another window pops up displaying various statistics about that product. The thing is the amount of information I need to display can't fit in one window vertically so I am trying to use a JScrollPane but the scroll bars dont show up. Oddly when fooling around and accidentally making everything appear on one line a horizontal scroll bar showed up but i have yet to get a vertical scroll bar to appear. Here is my code that uses the JScrollPane:
JFrame popupFrame=new JFrame();
String title=((JButton)event.getSource()).getText();
popupFrame.setTitle(title+" Statistics");
popupFrame.setSize(500,700);
JPanel popupPanel =new JPanel();
popupPanel.setLayout(null);
popupPanel=createLabels(popupPanel);
JScrollPane statPane= new JScrollPane(popupPanel);
popupFrame.add(statPane);
popupFrame.setLocation(500,100);
popupFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
return popupFrame;
I have looked online and I felt like I was doing it right but as i said im pretty new to this stuff.