JPanel getSize() getWidth(); also force maximum size?
I have a Jpanel that has a BorderLayout.WEST and CENTER.
I would like the CENTER JPanel (has overridden paint component) to use All available space for the X size. Right now I have a custom setPreferredSize and I do not want to set the X size.
1 ) How can I have the X Dimension fill whats left of the X size?
2) If above isnt possible perhaps I can take the main JPanel getWidth() and subtract the WEST JPanel and use that number as the X Dimension. Is this possible?
note: I keep getting 0 for the returns for all getWidth() and getHeight(). I was successful once when I put the method in the overridden paintComponent.