Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do "professionals" make a GUI in java?

Thanks for your answers to my previous question about GUI in java. I now wonder what are the solutions chosen by professionals to get a nice GUI, for "real" applications. Do you use swing and JComponents and just change the "look and feel" ? Do you prefer awt or another library ?

Sorry if that question sounds weird, I'm a student and I don't really know how java is used in the real world...

like image 520
Jules Olléon Avatar asked Apr 11 '10 14:04

Jules Olléon


People also ask

What is the best way to create GUI in Java?

If you want to do it the standard way, you can try out Swing as it comes with Java (JFC to be precise) and has good tutorials and support. Here is the official tutorial: Swing tutorial. If you want to use something that uses the native OS components, then SWT is for you.

Can you make a GUI in 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.


2 Answers

In our company we use Swing, as that is supported by the JVM out of the box, but we do use color coded background colors for some panels and buttons.

If we'd use something different, like SWT or Jambi we'd also have to roll out those frameworks for all platforms, and test those frameworks for all OSses and (supported) java versions. Not nice at all.

It is however fairly tricky to create a nice responsive application with Swing; so you really need to use SwingWorker and the like. With a bit of experience however you can create a nice application that way.

And even if it isn't the fastest framework to develop in, development time is really small compared to defining the functional requirements of the user interface, and testing and support when the version is released.

That said, our target is desktops. If you target mobile devices or also need a web frontend your choices may vary.

like image 123
extraneon Avatar answered Oct 22 '22 17:10

extraneon


I don't believe anyone prefers AWT anymore. Swing supplanted it entirely eleven years ago, building on top of it to correct flaws in the AWT 1.0 design.

Swing isn't the only way that professionals make Java UIs. That works for desktops, but there's also JavaFX now. For the web, UIs are built using HTML, CSS, JavaScript, and JSPs.

like image 24
duffymo Avatar answered Oct 22 '22 17:10

duffymo