Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java - Building GUI for application

I've written a lot of Java applications over the years, but the vast majority of them have been simple command line programs with only a few hundred lines and (at most) several classes.

My question is this:

How do I now design/code an interface to this application?? Where do I start? I mean are there any tutorials/resources which describe the steps involved? I know Swing exists, but where do you start, and is it the only option?

Any help/assistance appreciated...

like image 361
Donal.Lynch.Msc Avatar asked Apr 02 '26 12:04

Donal.Lynch.Msc


1 Answers

The rich client GUI toolkits for Java are basically:

  • AWT Sun's Abstract Window Toolkit was the original component kit for making GUIs, a toolkit based around using native components. AWT still contains the core of very important parts of J2SE GUIs such as Graphics/Color/Java 2D, Image & BufferedImage, printing, D'n'D..
  • Swing The current, main-stream desktop app. component toolkit. Swing generates the components internally, and allows setting a Pluggable Look and Feel to the GUI. Swing offers components & functionality not available in AWT such as JTable, JTree, support for formatted documents (e.g. RTF & simple HTML) in Swing components.. For more information see things that Swing provides beyond AWT.
  • Java FX 2 Intended as an (eventual) replacement to Swing, AFAIU.
  • SWT is another choice, not written by Oracle, uses natives. I would not recommend it for someone learning rich client programming, since it is a lot easier to get answers in relation to Swing.
like image 124
Andrew Thompson Avatar answered Apr 04 '26 02:04

Andrew Thompson