Donal.Lynch.Msc
Donal.Lynch.Msc

Reputation: 3615

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...

Upvotes: 2

Views: 704

Answers (3)

Andrew Thompson
Andrew Thompson

Reputation: 168845

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.

Upvotes: 9

user1142189
user1142189

Reputation:

No, Swing is not the only option but it is where you should start. Swing is the "new and improved" version of some of the GUI objects in java.awt. Most of the Swing objects build off of their AWT counter parts our are completely new. Both Swing and AWT are a part of the core Java API so it would be best to start with the tutorial that AVD linked you to (The Java Tutorial)

Upvotes: 2

KV Prajapati
KV Prajapati

Reputation: 94653

You have to learn core GUI API java.awt and its sub-packages along with (extended API) javax.swing and its sub-packages. You may start - The Java Tutorial.

Upvotes: 5

Related Questions