Java Swing Program Structure

I am looking for some best practice guidelines for an application that uses Java Swing for structuring. I am usually a webapp guy and try to follow MVC. Is MVC typical of Swing applications? If so, how?

+5
source share
4 answers

You may find this very simple example and discussion useful.

+2
source

After MVC, this is a very good idea. As far as I know, there are no formal Java Swing structures, they all focus on the aspect of the View problem.

MVC - , , Griffon. Java - Groovy, . Griffon Swing- , Grails -.

http://griffon.codehaus.org/

+3

Swing MVC, . Swing , , ( ) . , , , Swing MVC Java-.

Swing VC: . , , , , . . , . , , , .. . , .

ActionListener buttonListener = new ActionListener() {
    public void actionPerformed(ActionEvent event) {
        // Controller code
    }
};

JButton button = new JButton("A Button");
button.addActionListener(buttonListener);

ActionListener - , , , button . Swing MVC, :

( )
view ( )

, :)

0

JSR (296), Swing, , , :

http://java.dzone.com/news/jsr-296-end-jframe

I found the following structures, initially based on it, that look promising:

It would be interesting to know how they work in practice. I hope they help.

0
source

All Articles