Adding multiple JPanels to a JFrame
807603Dec 4 2007 — edited Dec 5 2007I want to be able to set up my interface so that it has two JPanels sat on the JFrame so when buttons on the first panel are clicked the second panel will update (will display different info). With one sat above the other, I know I could probably use one of the layout managers for this but I prefer absolute positioning as i'm not exactly sure how to use them properly.
I am trying to do this using absolute positioning to put the panels into the correct places but I get a nullPointerException when trying to call .setBounds() on the JPanels and am not quite sure how to proceed. I'm not quite sure how it can be pointing to nothing as I call the method on a specific panel and then use the add() method to place it onto the JFrame.
Thanks
Aaron