Skip to main content

Desktop Java demos for learning

3 replies [Last post]
ylzhao
Offline
Joined: 2004-08-22

Hi,
after some time learning Swing basics like layout design, painting
and event handling, when I want to write a more actual and better GUI
app with Swing, I also do not know how to start.
JDK bundled demos and Swing tutorial are fundamental, and do not
describe how to write a good Swing app.
Are there some good desktop Java demos written in Swing which I can learning:
1. How to design and implement a modern GUI?
2. How to separate GUI with code?
3. How to handle GUI events with delegates?
4. How to implement a hign responsive GUI which may use SwingWorker?
5. How to use design patterns(like MVC, MVP, Command etc) in Swing GUI?
Thanks!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
janerik
Offline
Joined: 2004-01-09

I am not a JFC/Swing expert (I build websites for a living) But here are some musings about JFC/Swing development.

* Learn how to use javax.swing.AbstractAction.
* Never extend JFrame. Use JPanel or JComponent instead. Think components for IDE's etc.
* If you create throwaway layout code.. you will throw it away.
* new ActionListener() { actionPerformed() { someMethod(); }} is not a good idea. I don't like Microsoft's delegates either. Use AbstractAction if it makes sense. If you have a lot of inner classes, it will probably increase your blood pressure and reduce code reuse.
* Don't extend JButton because "it's not good enough". The programmer, and not the API, is usually the problem.
* Don't add "pretty colors and stuff" to Swing components without testing them on Macs or Mac users will hate you for it.
* Support the keyboard. Add mnemonics and shortcuts. Solve component focus problems.

The rest is here.. was kinda bored yesterday.
http://fabric.no/weblog/archives/2007/01/jfcswing_musings.html

Threading links
http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html
http://foxtrot.sourceforge.net/docs/index.php
http://spin.sourceforge.net/
http://java.sun.com/docs/books/tutorial/uiswing/TOC.html

Side note: According to this forum I registered my java.net account in 1969. Almost 9 years before I was born :)

Scott Violet

swing@javadesktop.org wrote:
> Hi,
> after some time learning Swing basics like layout design, painting
> and event handling, when I want to write a more actual and better GUI
> app with Swing, I also do not know how to start.
> JDK bundled demos and Swing tutorial are fundamental, and do not
> describe how to write a good Swing app.
> Are there some good desktop Java demos written in Swing which I can learning:
> 1. How to design and implement a modern GUI?
> 2. How to separate GUI with code?
> 3. How to handle GUI events with delegates?
> 4. How to implement a hign responsive GUI which may use SwingWorker?
> 5. How to use design patterns(like MVC, MVP, Command etc) in Swing GUI?
> Thanks!
> [Message sent by forum member 'ylzhao' (ylzhao)]

We are most definitely lacking in this area and realize it. JSR 296
(Swing Application Framework) will include example apps. I believe
Karsten (of JGoodies fame) has published a number of examples and white
papers.

-Scott

acerhigh
Offline
Joined: 2005-05-17

My recommendation is to look into "Spring Rich Client" project which is a a spring port for Desktop application development. Perhaps not the best entry point if you don't know any thing about spring, but if spring is not a new concept for you Spring Rich Client is a very good framework to look into.

Spring Rich Client - http://spring-rich-c.sourceforge.net/

Spring - http://www.springframework.org/