Full Screen Frame Resolution Problem
Hello, I am working on a project where I use a full size undecorated frame for my GUI.
My problem is that everything looks perfect on my laptop that I work on (I don't know the resolution because I'm at school) As I was testing cross platform issues I discovered that my GUI will mess up under certain resolutions.
This is my Frame
Within my frame I add various layers of Panels for different sections of the GUI, they are added either by:
Toolkit toolkit = Toolkit.getDefaultToolkit ();
Dimension screenDimension = toolkit.getScreenSize();
Where the size of the Panel is directly related to the Frame size, OR
leftPanel.setPreferredSize(new Dimension((int)(tableFrame.getWidth()*(infoBarSizePercent)), tableFrame.getHeight()));
leftPanel.setSize(new Dimension((int)(tableFrame.getWidth()*(infoBarSizePercent)), tableFrame.getHeight()));
Where the size of the Panel is directly related to the size of another Panel.
topPlayerDeckCount.setPreferredSize(new Dimension(topPlayerCardCount.getWidth(), (topPlayerCardCount.getHeight()/5)));
All Panels and the Frame have a FlowLayout set to have no spacing between objects
When the panel does not span the entire section it is in it is either divided by a number that corresponds to how many panels will be added there (they will all be the same size) or it will be a percent of the total space available with slight compensation. An example would be the top half will be height*0.2 and the bottom half would be height*0.81.
Okay so there are two problems: The first is that under certain resolutions everything is perfect where as under most others there are spaces between the panels as can be seen in the following example at 1280X1024:
(remove the ???, it wont let me post links)
I have just colored all the panels so you can see where they are.
Note that on the Left side there is a section of small boxes that look somewhat like a rainbow, when using the resolution 1400-1050 (and other resolutions) There may also be spaces between panels but more importantly that group of rainbow boxes are not even present as can be seen in the following example:
This problem is my main concern.
The entire class can be found here if I have left something out:
Any advice on why this is happening and how to fix it would be greatly appreciated.