2

I'm too far from Java technologies.

  • Just for curiosity what is the name of the technology/API/class which let us develop desktop applications with Java (like windows forms)?
  • I heard a toolkit named Swing. Is that the official GUI toolkit and is there any alternatives of Swing?
  • Is there a technology in Java corresponding to WPF of C#?
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Lupus
  • 1,519
  • 3
  • 21
  • 38
  • 4
    Since you've already heard of Swing, did you try to look it up and read some of the documentation? –  Sep 04 '12 at 09:28
  • 2
    Alternative to Swing: [Java FX 2.x](http://www.oracle.com/technetwork/java/javafx/overview/index.html) – assylias Sep 04 '12 at 09:29
  • 3
    Asking a single question per question would be nice. For example your last one was already asked and answered: [What is Java's answer to WPF?](http://stackoverflow.com/questions/285147/what-is-javas-answer-to-wpf) – Joey Sep 04 '12 at 09:31
  • 2
    comment upvote for being honest. ;) But you really should look it up before asking here. – brimborium Sep 04 '12 at 09:31
  • 2
    This question is discussed before and quite comprehensively. http://stackoverflow.com/questions/7358775/java-gui-frameworks-what-to-choose-swing-swt-awt-swingx-jgoodies-javafx – AurA Sep 04 '12 at 09:37
  • possible duplicate of [What is the best practice for setting JFrame locations in Java?](http://stackoverflow.com/questions/7777640/what-is-the-best-practice-for-setting-jframe-locations-in-java) – Andrew Thompson Sep 04 '12 at 10:11
  • @Tichodroma well if you have a guide before go ahaed to the road you move faster. – Lupus Sep 04 '12 at 10:32

5 Answers5

8

Java Swing is the most commonly used GUI toolkit for Java. There are alternatives (JavaFX, AWT, SWT), but Swing is a very good starting point if you start devolping desktop applications with Java. The only thing I would consider is looking at alternative LayoutManagers like MigLayout. But you can easily begin with the standard ones. There is a great visual guide to start off with Java Swing and the various LayoutManagers.

brimborium
  • 9,362
  • 9
  • 48
  • 76
  • *"Java Swing is the official GUI toolkit of Java"* Is it? – assylias Sep 04 '12 at 09:32
  • @assylias I did not find a link to proof it, but it is in the `javax` tree and is the successor of AWT. Also I don't know any newer toolkit within the official java package tree. Do you? – brimborium Sep 04 '12 at 09:37
  • Java FX 2.x is now part of the JDK (since JDK 7u6). It is meant to be the successor of Swing – assylias Sep 04 '12 at 09:38
  • @assylias Yeah, I just saw the comments in Peters answer. But as far as I can see, it isn't yet ready as successor of Swing. So especially for a beginner, I still would recommend Swing as there are much more (good) examples online... – brimborium Sep 04 '12 at 09:41
  • @assylias I fixed the formulation. Better now? ;) – brimborium Sep 04 '12 at 09:42
  • 1
    @brimborium Yes ;-) FX is getting readi-er quite fast and based on my testing I think it can already be used for real life application. But as you note, for a beginner, the amount of available support is less than for Swing because it's newer. – assylias Sep 04 '12 at 09:44
  • 1
    @assylias Oh wow, I just played around with FX a bit. It's amazing. But it is correct that there are more useful tutorials for Swing available right now. I hope FX is taking over though. ;) – brimborium Sep 12 '12 at 12:53
6

There is AWT, Swing, SWT, JavaFX, Android GUI.

The most common is Swing and while its not the prettiest, I would start with that unless you have specific requirements.

Java FX 2.x demo http://www.oracle.com/technetwork/java/javafx/samples/index.html

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
  • Java FX looks great (subjective) and is easier to use (subjective too). Drawback fo beginners: less support. Also worth noting it is now included in the JDK. – assylias Sep 04 '12 at 09:33
  • @assylias As you commented on the question `Java FX 2.x` looks great, I wouldn't use the original `Java FX` ;) – Peter Lawrey Sep 04 '12 at 09:35
  • 2
    I guess that is changing too... now JavaFX is installed by default, starting from Java 7 update 6. – AurA Sep 04 '12 at 09:36
  • @PeterLawrey Java FX 1.x EOL has been announced so obviously not a great choice. – assylias Sep 04 '12 at 09:37
  • Looking at the Ensemble demo it looks really great. :) I note it can be used with Swing so it doesn't have to be one or the other. – Peter Lawrey Sep 04 '12 at 09:46
  • @PeterLawrey Yes but... You can't embed Swing in JavaFX, only the opposite. And the integration of FX in Swing is still a bit buggy (most of those bugs seem to have been fixed in 2.2 though). – assylias Sep 04 '12 at 09:50
4

Java has the following options for GUI development:

(1) AWT
This is the old GUI development library

(2) Swing
This is the new GUI development library

(3) JavaFX
This is the latest GUI technology of Java,
it comes with FXML for fast UI development.

FXML is not compatible with XAML of .NET, but it can be considered equivalent.

jondinham
  • 8,271
  • 17
  • 80
  • 137
3

Yes, Swing is the official GUI toolkit of the Java Runtime Environment.

Philipp
  • 67,764
  • 9
  • 118
  • 153
3

in Java you can use many differen GUI technologies.

Swing is one of the technologies you can use. It is lightweight and it is the offical toolkit for Java. Furthermore you can take a look at SWT, AWT or JMonkey for 3D stuff.

What do you mean with similar with WPF? The MVVM Pattern?

Something similar to Silverlight but better is the GWT Toolkit.

CoolKiffings
  • 567
  • 1
  • 8
  • 16