Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building a GUI in Java [closed]

What mechanism do you prefer for building a GUI: from scratch or using GUI-building software?

like image 546
Tolga E Avatar asked Jul 14 '09 17:07

Tolga E


People also ask

Can you build GUI with Java?

In Java applications, the components that comprise a GUI (Graphical User Interface) are stored in containers called forms. The Java language provides a set of user interface components from which GUI forms can be built.

Is Java GUI still used?

Majority of existing GUI java codebases are Swing and likely will stay that way until the codebase rots and nobody maintains it anymore.

Is Java Swing still developed?

Both toolkits are still part of the Java SE Specification and core to many other toolkits and applications that build on top of them. Oracle will continue developing Swing and AWT in Java SE 8 and Java SE 11 (18.9 LTS). This means they will be supported by Oracle through at least 2026.


2 Answers

If the question is about GUI development using Swing then IMO it is best to code everything manually without a WYSIWIG tool.

In order for a manual UI design/coding to be efficient a really good layout manager should be used. MigLayout is one of such layout managers. Since I've started using it I have never looked back at WYSIWIG tools -- a sheet of paper, a pencil, MigLayout and you get a full control over your design and code.

Also tools like Balsamiq simplify making GUI mock ups for quick prototyping if the paper and pencil approach is not suitable.

like image 185
01es Avatar answered Oct 05 '22 02:10

01es


My personal opinion is never use visual editors. Until there is a single standard for GUI-building in Java you will find yourself tied to an IDE. The best IDE for building Java GUI has switched around quite a bit in the last 10 years (I wonder how many projects were hit by a massive maintenance overhead from switching away from JBuilder for example).

For most applications, the actual layout of GUI code is probably something like 5-10% of the total amount of time you are likely to spend writing the app as a whole. Therefore even halving this by using a designer is not really saving you very much in the grand scheme of things.

Taking this together with the lack of flexibility and more complicated maintenance, it's almost always better just to write the GUI by hand.

like image 41
oxbow_lakes Avatar answered Oct 05 '22 02:10

oxbow_lakes