I'm using an overridden JPanel to act as a drawPanel for me to put bar charts in. The problem is, I can only see the graphics in the panel when I add it to the CENTER of the frame. Anywhere else, and it just won't appear on the frame. How can I set it up so that the drawpanel can be added to the SOUTH region?
Below is an example from Head First Java, if you switch the layouts of the button and the drawpanel, you will notice that the drawpanel will not appear.
when added to SOUTH, it is sized to it's preferredSize (0,0), so doesn't appear. when added to CENTER, borderlayout gives center all the remaining area of the size of the frame (after NORTH,SOUTH,EAST,WEST is allocated), regardless of the preferredSize of what's in CENTER.
test by including this in the constructor of your drawPanel setPreferredSize(new Dimension(100,100)); now add it to SOUTH
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.