PDA

View Full Version : Java Swing HELP! - BorderLayout


SniperWolf
06-06-2005, 09:28 AM
FIrst off, Hello everyone, I am new here so give me some time, lol, anyways i have been doin java for about a year and I am loving it. ANyways I am currently working on a student gradeBook program which iam doing in Swing. This was my first approach with swing so I am discovering a lot of new concepts. Anyways, back to my question of help. The layout I am using for the Frame is BorderLayout, i have everything nice and organized the way i want it. But one problem, when you run the program its size is (800, 600). That size is when everything such as the buttons are in perfect size and shape. but when i maximize the program every thing changes. the buttons become big as hell and etc. What can i do so when the user changes the size of the frame, its components such as the buttons and textfield dont change in size or shape! Please help!! thats about the last steps i need to complete to finish the whole program! Thank You! :thumbsup: :confused: :mad: :p

suryad
06-06-2005, 10:19 PM
Just curious I wonder if you have used the frame.pack() method. Also when using layouts, I think it is always a good idea to constrict the sizes of the components in the Frame. It makes life a lot easier. As an example, something like the following:
jScrollPane1.setPreferredSize(new Dimension(300, 640));

That is just a simple example...and that should give you a good idea...that way whether you resize and what not things stay the same. Hope this helps. Also I would recommend studying the JFC tutorial on Sun's website :thumbsup: and the tutorial and example demos help get a lot of :confused: looks converted to a lot of :cool: