Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Struggling to Learn Java GUI.  RSS feed

 
Mo Jay
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I just would like to ask about Java GUI especially Swing and how to get a handle of it.

I have been trying to use Swing and Awt on and off for quiet sometime now however I never got a good grasp of them, I want to know what's the best way to learn Swing with regard to the resources (books and materials) used and also the methods conducted (ex. do I have to remember all the syntax of those Swing API or just the concept).

Let me know what you think and also share your experience of learning Java GUI and how you did it.

Thank you in advance,
MJ
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd like to play golf like Tiger Woods.

No amount of reading books or listening to people's advice will get me what I want.

only practice, practice, practice, will get me on the way, and when I think I'm done, practice some more.

in Swing, 'practice' equates to writing code.

 
Pierre Sugar
Ranch Hand
Posts: 62
Java Ruby Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The easy way would be downloading Netbeans IDE at http://www.netbeans.org/downloads/ and designing your GUI with the integrated GUI builder Matisse. Afterwards you can view the generated source code.

If you would rather learn from scatch a good point to start is at http://java.sun.com/docs/books/tutorial/ui/index.html.

Have fun.
 
Campbell Ritchie
Sheriff
Posts: 55333
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pierre Sugar wrote:The easy way would be downloading Netbeans IDE at http://www.netbeans.org/downloads/ and designing your GUI with the integrated GUI builder Matisse.
Disagree. You will never understand what is going on from Matisse. Write the code by hand until you are familiar with Swing.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> The easy way would be downloading Netbeans IDE

that's the worst way to try and learn swing.

learners shouldn't even use an IDE with autocomplete,
the more they have to recall from memory, the quicker they will learn

a basic IDE, with a good 'help' link to the java apidocs, is all that is needed
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pierre Sugar wrote:The easy way would be downloading Netbeans IDE at http://www.netbeans.org/downloads/ and designing your GUI with the integrated GUI builder Matisse. Afterwards you can view the generated source code.

I'll agree with the others as the generated code is ugly and nothing really you can learn from. I liken using NetBeans to generate Swing code like ordering Pizza to be delivered. Your meal is ready quick, and it tastes pretty good too, but don't expect that by ordering your pizza you'll learn to cook.
 
Pierre Sugar
Ranch Hand
Posts: 62
Java Ruby Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
O.k. you convinced me, it wasn't a good idea to suggest using Matisse for to learn Swing. Yes I also do agree that it is not a good idea to try to learn to build Swing applications by looking at the generated code from Matisse.

Therefor I would rather suggest that you look at the Swing tutorials or use a book like "graphic Java" from David M. Geary or "core Java" from Horstmann and Cornell. This is the way I started with Swing and it helped me a lot. I still use it to look up certain things, even the books I have are from year 2000. Another book I frequently use is "Java look and feel design guide lines".
 
Campbell Ritchie
Sheriff
Posts: 55333
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pierre Sugar wrote:. . ."core Java" from Horstmann and Cornell. . . .
An excellent book
 
Mo Jay
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I would like to thank you all for the replies and advices you guys posted for this question.

I agree with the most of you that Swing and GUI in general needs to be learned from scratch and through continuous practice, I am also against the idea of depending on NetBeans or any IDE that will generate the code for you because you will never understand the how and why behind it.

I appreciate your feedbacks.

MJ


 
Campbell Ritchie
Sheriff
Posts: 55333
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!