Möchte Java-Programmieren lernen, soll ich Swing oder AWT benutzen ?

miki100

Grünschnabel
Hallo,
ich möchte Java lernen, benötige natürlich dazu auch die (Grafische) Entwicklungsumgebung.
Soll ich AWT oder Swing benutzen ?
Wo kann ich die Programme runterladen ?
Kann man die Programme für lernzwecke einfach benutzen ( Lizenzrechtlich ) ?

Gibt es irgendwo im Internet eine Schritt für Schtirr anleitung ?

Danke
miki
 
>Hallo,
>ich möchte Java lernen, benötige natürlich dazu auch die (Grafische) Entwicklungsumgebung.
>Soll ich AWT oder Swing benutzen ?

Swing ist moderner/neuer/schöner. Und afaik soll irgendwann das AWT herausfallen.

>Wo kann ich die Programme runterladen ?

Sind in der Klassenbibliothek enthalten. Einfach all die Komponenten benutzen, die ein J vorneweg haben. Z.B. JLabel, JButton usw. Einfach in der API umschauen.
Und dann im Programm auch importieren, damit Deine Klassen auch wissen, was ein JLabel ist:
import javax.swing.JLabel;
import javax.swing.JButton usw.

>Kann man die Programme für lernzwecke einfach benutzen ( Lizenzrechtlich ) ?

Klar, s.o.

>Gibt es irgendwo im Internet eine Schritt für Schtirr anleitung ?

>Danke
>miki

Üblicherweise sind die Sun-Tutorials schon recht hilfreich. Aber vermutlich solltest Du zunächst mit Java etwas vertrauter werden und vorab OOP intensivst anschauen
Außerdem gibt es im Java-Forum eine Linkliste, da kannst Du Dich umschauen.
 
...ergänzend zu Snapes Antwort solltest Du Dich fragen, ob Deine grafischen Komponenten im Browser als Applet laufen sollen, denn dann würde ich Dir AWT raten, weil viele Browser kein Swing verstehen. Für eine reine Java-Anwendung würde ich allerdings auch Swing verwenden.

CU schnuffie

http://entwickler.webnobis.com
 
Ich darf mal zitieren:

AWT vs. Swing

There are, of course, both pros and cons to using either set of components from the JFC in your Java applications. Here is a summary:

AWT:
Pros


  • Speed: use of native peers speeds component performance.
  • Applet Portability: most Web browsers support AWT classes so AWT applets can run without the Java plugin.
  • Look and Feel: AWT components more closely reflect the look and feel of the OS they run on.
Cons
  • Portability: use of native peers creates platform specific limitations. Some components may not function at all on some platforms.
  • Third Party Development: the majority of component makers, including Borland and Sun, base new component development on Swing components. There is a much smaller set of AWT components available, thus placing the burden on the programmer to create his or her own AWT-based components.
  • Features: AWT components do not support features like icons and tool-tips.
Swing:
Pros


  • Portability: Pure Java design provides for fewer platform specific limitations.
  • Behavior: Pure Java design allows for a greater range of behavior for Swing components since they are not limited by the native peers that AWT uses.
  • Features: Swing supports a wider range of features like icons and pop-up tool-tips for components.
  • Vendor Support: Swing development is more active. Sun puts much more energy into making Swing robust.
  • Look and Feel: The pluggable look and feel lets you design a single set of GUI components that can automatically have the look and feel of any OS platform (Microsoft Windows, Solaris, Macintosh, etc.). It also makes it easier to make global changes to your Java programs that provide greater accessibility (like picking a hi-contrast color scheme or changing all the fonts in all dialogs, etc.).
Cons
  • Applet Portability: Most Web browsers do not include the Swing classes, so the Java plugin must be used.
  • Performance: Swing components are generally slower and buggier than AWT, due to both the fact that they are pure Java and to video issues on various platforms. Since Swing components handle their own painting (rather than using native API's like DirectX on Windows) you may run into graphical glitches.
  • Look and Feel: Even when Swing components are set to use the look and feel of the OS they are run on, they may not look like their native counterparts.
 
Zurück