Java interface layout

Posted on

Question :

I’m developing a program for a friend and I’m using the Java language for this.
I’m using the Netbeans IDE which has the feature of building the user interface (UI) by drag n ‘drop, using Swing.

I have a lot of trouble building UI, I’m pretty good on the back end, but I’m pretty weak on the front end.

From my friend’s specs I put the UI in this way:

I just used an Absolute Layout, and when I try to maximize it gets horrible.

I wanted to know first how I can develop for a Full Screen.

And what layouts are meant to make this canvas if you do not order too much.


Answer :

On Netbeans I recommend the GroupLayout . The IDE has excellent support and the layout is very flexible (allowing you to anchor elements, set policies for growth vertical and horizontal, etc.). You will have an experience very similar to Borland and Microsoft IDES development.

Keep in mind though that the code generated to position elements with GroupLayout will be very difficult to edit at hand. If you want more control I would suggest MiG Layout that is simple enough to use manually, yet powerful enough for most situations.

Finally, avoid the GridBagLayout . That’s why: Totally Gridbag .


Leave a Reply

Your email address will not be published. Required fields are marked *