[java] Preferred GUI design method

Started by
11 comments, last by NuffSaid 21 years, 4 months ago
I'm interested to know how most people design the GUI in Java? Do you use GUI builders like Netbeans, or do you manually code them? I've been writing GUIs in Java using Layout Managers, specifically BoxLayout, and quite frankly, its never caught on with me. GUI builders I've tried seem to work best when using the NULL layout. Using any other layout in a GUI builder just doesn't seem to work. I'm interested if anyone else feels that layout managers are a pain to use, and if there are any other alternatives? [edited by - NuffSaid on December 7, 2002 7:50:56 PM]
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
Advertisement
For games I can imagine few situations where a LayoutManager is going to make much sense.
Star Dart - Java Multiplayer Space Combat at http://www.stardart.net/
I like to handcode them GUIs, but haven't tried any other way of designing GUIs with java. I'm quite happy with BorderLayout in most cases. If you don't specify which layout you are using, I think it's just using the FlowLayout:

http://java.sun.com/j2se/1.4/docs/api/java/awt/FlowLayout.html

As longs a you just do small games, I don't think you really need to use anything but BorderLayout or BoxLayout, if any.

[edited by - hotohori on December 8, 2002 10:48:55 AM]
I handcode mine. The GUI builders I''ve tried have ranged from "not quite there" to "frustrating". I usually use a combination of JPanel with FlowLayouts and JFrames with a BorderLayout. It also gets you cleaner code.


50% of people are below average.
I''ve been revisiting GridBagLayouts, and I think that they seem to work. Sort of. Once you get used to Insets, and grid coordinates.

Guess I''ll be using that for now.
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
Hi,

I started creating GUIs armed only with TextPad and all went fine. Well ... until I tried NetBeans. It''s not that you couldn''t produce some c00l layout manually, it''s all about time.
Creating a JFrame (with a few inputs & some basic functionallity) manually can take some 15 minutes, but using some GUI builder it''s much faster - about three times faster for me.
The transition to GUI-builder creating the user interface was not easy. I refused to give up nursing the nice, small, innocent handcrafted components (hehe, but that''s how I really felt it those days)
But if you really have some idea (read - design), how that frame should look and what it should do, you''re better off with visual GUI creation.

I personally use NetBeans throughout my projects and also for the GUI.

have fun

Petr Stedry
Petr Stedry
I am using Netbeans. The GUI builder works fine, for a Java GUI builder. But it still isn''t great, especially if you''re used to products like Delphi and C++ Builder.

But guess that''s what I''ll use
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
Don''t get caught up being tied to a single layout manager on a single level. Layout managers were meant to be used together by nesting them inside one another.


Make it work, then
make it fast.

"I’m happy to share what I can, because I’m in it for the love of programming. The Ferraris are just gravy, honest!" --John Carmack: Forward to Graphics Programming Black Book
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][LWJGL Tutorials for NeHe][LWJGL Wiki][jMonkey Engine]
Hi,

why not use GridBagLayout as much as possible?
If anyone likes to nest 4-7 layouts deep just to have a nice looking GUI, why spoil the fun? But I personally prefer not to spend all my time on pushing components around from one container to the next. And this all just to have this Flow-in-Border-in-Box-in-GridLayout frame look sooooo pretty.

NuffSaid> Some time ago, I tried JBuilder (I think it was v4) and it''s GUI builder was quite a lot better than that of NetBeans. But the code completion engine and many other features (error trackin, debugging & price ) were inferior, compared to NetBeans. And that''s why I use NetBeans now.

have a nice day

Petr Stedry
Petr Stedry
quote:Original post by NuffSaid
I''m interested to know how most people design the GUI in Java? Do you use GUI builders like Netbeans, or do you manually code them?

I''ve been writing GUIs in Java using Layout Managers, specifically BoxLayout, and quite frankly, its never caught on with me. GUI builders I''ve tried seem to work best when using the NULL layout. Using any other layout in a GUI builder just doesn''t seem to work. I''m interested if anyone else feels that layout managers are a pain to use, and if there are any other alternatives?

[edited by - NuffSaid on December 7, 2002 7:50:56 PM]


It depends on what I doing. If I am writting something more complex I''ll use a program like JBuilder (personal edition) and draw GUI like you do in VB, but if it''s simple I''ll just write the code to use the layout managers myself.


I agree layout managers can be a pain, but I am unaware of any other way to setup a GUI with Java.
Patrick

This topic is closed to new replies.

Advertisement