tags:

views:

291

answers:

7

Hello, first I want to apologize about my english, it may not be clear enough.

Well, I'm new to Java programming, and I've searched this website about the use of Swing, AWT, 2D, etc. but I didn't get the answer I was looking for. I want to know about a book or method to learn Java GUI programming (not even sure this is a proper term).

Previous answers guided me to Filthy Rich Clients by Romain Guy and also to The Swing Tutorial on Sun Web Page. No offense, but...the first one seems too complex and the second one a bit disorganized.

So I'm asking for a more "for dummies" resource.

Thanks

EDIT: Thanks everybody, you're very kind and serious. I want to clear some things that I didn't state for being my first question.

I don't want to use auto-generated code (Don't want to say why only focus on my question for consistency) Also I've read Deitel & Deitel and it's a good beginners book but it seems to me that doesn't cover layout (and other details)

Finally, I tried to read netbeans generated code but it's a mess find method by method and function by function the way that the IDE does it

I hope this edition helps to solve my question

A: 

If I were starting over again, I would build a GUI using the GUI builder built into the Netbeans IDE and then build a simple application that requires you to look at the generated code for debugging.

Soldier.moth
+1  A: 

There are quite a few different ways of doing Java GUI programming now, so I expect you'll get quite a few different answers.

Something I'll mention that you won't see in previous answers, however, is JavaFX. This is a new GUI toolkit (from Sun) which uses its own little language (to make writing GUIs quicker and more concise), but that runs on the Java Virtual Machine and uses Java classes fairly happily.

http://javafx.com/learn/

I'm sure the other answers you will get here will also be good suggestions.

William Billingsley
+2  A: 

There's no question that Sun's tutorials are a mess. Core Java books provide quite good tutorials on these topics, among others. Be sure to get both volumes (I and II).

Joonas Pulakka
A: 

You could take a look at "Swing: a beginners guide". (I've never read it, but it gets good reviews on Amazon ... FWTW.)

Stephen C
+1  A: 

You can use "Java how to program" that learn Java with simple user interface with swing.

Java How to Program, 7th Edition By Harvey M. Deitel, Paul J. Deitel

alt text

The Deitels' groundbreaking How to Program series offers unparalleled breadth and depth of object-oriented programming concepts and intermediate-level topics for further study. The Seventh Edition has been extensively fine-tuned and is completely up-to-date with Sun Microsystems, Inc.’s latest Java release — Java Standard Edition 6 (“Mustang”) and several Java Enterprise Edition 5 topics. Contains an extensive OOD/UML 2 case study on developing an automated teller machine . Takes a new tools-based approach to Web application development that uses Netbeans 5.5 and Java Studio Creator 2 to create and consume Web Services. Features new AJAX-enabled, Web applications built with JavaServer Faces (JSF), Java Studio Creator 2 and the Java Blueprints AJAX Components. Includes new topics throughout, such as JDBC 4, SwingWorker for multithreaded GUIs, GroupLayout, Java Desktop Integration Components (JDIC), and much more. A valuable reference for programmers and anyone interested in learning the Java programming language.

SjB
The links broken.
Zaki
@Zaki : link fixes
SjB
A: 

No longer a relevant answer since edits to the original question:

A good place to start would be by downloading Netbeans IDE and following the tutorials on the Netbeans homepage. They walk you through setting up Java GUI projects in Netbeans and building interfaces for simple programs. However, you should be careful though as it is very easy to miss the basics of GUI building when using Netbeans because takes care of writing much of the boiler plate GUI code for you. However if you take the time to look at and understand the code auto-generated by Netbeans I think it can be an invaluable tool in learning how to efficiently create GUIs in Java. Another note, there are differences in how other editors (like Eclipse) allow you to design GUIs and the code that they generate, so dont assume that the way Netbeans does it is the end-all-be-all of how to design GUIs.

instanceofTom
A: 

I'm sorry, but there isn't a quick fix. No tutorial will be perfect. It took me a while to learn how to create decent GUIs, and I'm still learning.

Learning how to make good GUIs takes a long time, and making them does too. Just keep looking around for tutorials, but here's my advice:

Stick to one. If you don't understand, go through each line and try to picture what it does. Look at each class in Swing and AWT. They all help a lot. In fact, I only used one tutorial, and that was for my first GUI. For the rest, I just looked through the documentation to find the class and method I needed for the rest.

Stuart