[GUI] BroderLayout Center Issues
I have a problem with trying to add a JPanel to the center of my Gui.
I have a JFrame we will call Main.
I also have a JPanel we will call Login.
Main extends JFrame. Main is laid out with a BorderLayout. Main then instatiates Login that extends JPanel and adds them to the CENTER of Main. I Have other things like a menu bar and toolbar taking up the spots of NORTH and SOUTH. EAST and WEST are not filled with anything as of yet.
From what i know, the Center condition for a BorderLayout will take up as much space is left over. So I was wondering if there was a way I could make Login to be in the center of my window with out it taking up all remaining space? I have tried to set its size to a specific size. But it ends up filling up the remaining space just like the BorderLayout.CENTER constraints says it should.
This is what it looks like now:
This is what i want it to look like:
I have tried to set the size to Login using:
None of them seem to have any effect on it. Any suggestions would be Awesome. Maybe I have been going at this the wrong way. Anyways Thanks