Forums Register Login

formatting the GUI

+Pie Number of slices to send: Send
Hi All,

I'm creating a GUI to sit on top of some already existing code. I'm doing it by hand, and staying away from the Netbeans auto gen stuff, because quite frankly my experience is they cause more problems then they solve.

Regardless.

In this effort I'm trying to stick with with the basic layout structures (Border/Grid). I'm using GridBag in very SMALL Areas because quite frankly I can't seem to get things to go how/where I want them on any sort of bigger panel.

I'm having a hard time getting things (most notably JTextFields) to be the size i want them to be. What I have been doing to adjust for this is creating blank panels and inserting them as needed to shrink things down. For example I might want four JTextlabels and four TTextFields in the upper left quadrant of a panel, so I'll add those items to it's own panel using a Grid Layout (2,2) and add that panel to another grid layout on another panel (2,2) I would then add 3 blank panels as either placeholders for things in the future, or simply for the blank space.

Is this a bad/unacceptable practice? IS there something better I should be doing?

+Pie Number of slices to send: Send
bad/ unacceptable? not as far as i know. there are many other features of swing some others might help you with. you can use horizontal glue for instance to space something over to the other side with blank in the middle. you can also set the preferred size of components to make them smaller for instance.
+Pie Number of slices to send: Send
It would seem that Box Layout is going to be helpful as well. Oh why did I ignore thee to start??
Fire me boy! Cool, soothing, shameless self promotion:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 794 times.
Similar Threads
Layout Manager help please????????
Adding Panels in Frame or in a Panel
Layout three GWT panels Horizontally
Layout Managers
Panes
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:12:59.