Resizing JFrame Window messes up the contents of the window
Hello All,
I have a Jaframe Window and the content of this window are 2 panels,
1. JPanel which contains another panel and is using GridBagLayout
2. JPanel which is a status panel
so my code could be summerized to..
JPanel mainPanel = new JPanel(GridBagLayout());
JPanel dataPanel = new JPanel();
mainPanel.add(DataPanel, c);
JPanel statusPanel = new JPanel()
frame.getContentPane.add(mainPanel, BorderLayout.CENTER);
frame.getContentPane.add(statusPanel, BorderLayout.SOUTH);
Everything works fine,
I have not deliberately added a scrollpane to the window, because i dont want to see the scroll bars, that is a requirement for the application, user does not want scroll bars.
When the window resizes, i need to scale my data panel and it is working fine.
But the problem is, when i click on the window border, for resizing the window, my data panel get shifted so that i see only top left portion of the data panel.
But after i am done with resizing the window, i have placed code to put the data panel in the center of the window and that is working fine.
But the problem is when i click on the window border to resize, it messes up the data panel, shifts it and it is not even visible completely.
I read about continuous layout and tried to turn it off, but Window resize gets messy when window sizze is bigger than my content panel.
Please advice what do i need to do here inorder to stop the contents of my data panel shifting to some place when i click ont he window border, inorder to resize the window.
Any help is appreciated.
Thanks