The Artima Developer Community
Sponsored Link

Java Community News
JSR 296 Swing App Framework Prototype Released

6 replies on 1 page. Most recent reply: Feb 5, 2007 4:03 AM by Achilleas Margaritis

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 6 replies on 1 page
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

JSR 296 Swing App Framework Prototype Released Posted: Jan 31, 2007 11:00 AM
Reply to this message Reply
Summary
Hans Muller released the first prototype implementation of JSR 296, Swing Application Framework. JSR 296 promises to simplify the development of rich-client applications by providing functionality that encapsulates Swing best practices.
Advertisement

JSR 296, Swing Application Framework, spec lead Hans Muller released the long-anticipated first prototype of what will become a standard framework for constructing rich-client Swing applications.

In an interview with Artima, Muller noted the difference between having a UI toolkit API, such as Swing, and a more specialized framework targeted at desktop application development:

Generally speaking, application developers need a process to follow for analyzing their own requirements and creating an implementation design. They also need API support for essential application parts—resources, actions, tasks, sessions—and support for putting those parts together in IDEs.

Most experienced Swing developers have sorted these issues out for themselves, and many of them are justifiably proud of their own skills. Novice Swing developers, however, find the lack of guidance and support in these areas intimidating or frustrating.

What we're trying to do in JSR 296 is to move desktop application construction from the realm of artisans and specialists to straight ahead engineering. If we're successful, more high quality Swing applications will be built by developers with less experience and less frustration than ever before.

In releasing the first JSR 296 prototype, Muller commented that:

The intended audience for this snapshot is experienced Swing developers with a moderately high tolerance for pain. Although JSR-296's ultimate goal is to bridge the gap to novice developers, the project's current doc/spec/robustness qualities aren't a good match for novices just yet.

So we're looking for feedback at this point... We're not looking to adopt an existing framework or even for code contributions however if there's an existing Swing application framework you're fond of, then feedback of the form: "framework X has a feature that JSR-296 lacks and the reason X is important is ...", would be great. Reports about bugs in the current implementation would be welcomed too.

If building and deploying Swing applications became as easy as building browser-based applications, would that make you more likely to choose Swing as a UI for your projects?


Achilleas Margaritis

Posts: 674
Nickname: achilleas
Registered: Feb, 2005

Re: JSR 296 Swing App Framework Prototype Released Posted: Feb 1, 2007 5:45 AM
Reply to this message Reply
Cool, but instead of doing this:
public class SingleFrameExample3 extends SingleFrameApplication {
    public void startup(String[] args) {
        ExitListener maybeExit = new ExitListener() {
            public boolean canExit(EventObject e) {
                int option = JOptionPane.showConfirmDialog(null, "Really Exit?");
                return option == JOptionPane.YES_OPTION;
            }
        };
        addExitListener(maybeExit);
        JButton button = new JButton();
        button.setName("button");
        button.setAction(new ActionAdapter() {
                public void actionPerformed(ActionEvent e) {
                    exit();
                }
            });
        show(button);
    }
    public static void main(String[] args) {
        launch(SingleFrameExample3.class, args);
    }
}


mainFrame.title = ExitListener Demo
button.background = 255, 255, 255
button.foreground = 0, 0, 0
button.text = Click to Exit
button.font = Lucida-PLAIN-48
button.icon = exit.png

I would have preferred to do this:

(do-window (window-frame
title = 'exit listener demo'
(button
background = (color 255 255 255)
foreground = (color 0 0 0)
text = 'click to exit'
font = (font 'Lucida' 'PLAIN' 48)
icon = (bitmap 'exit.png')
click = {if ((do-message-box 'Exit' YES_NO) == YES)) then exit}
)
))

which is much simpler and nicer...but I guess I am asking too much from language designers :-)

Mark Nuttall

Posts: 13
Nickname: mnutty
Registered: Jan, 2007

Re: JSR 296 Swing App Framework Prototype Released Posted: Feb 1, 2007 12:27 PM
Reply to this message Reply
But what if, for one client you wanted to add a button before and after the other button? doing it in Java would easily allow this with out having two sets of the same code.

Achilleas Margaritis

Posts: 674
Nickname: achilleas
Registered: Feb, 2005

Re: JSR 296 Swing App Framework Prototype Released Posted: Feb 2, 2007 3:01 AM
Reply to this message Reply
> But what if, for one client you wanted to add a button
> before and after the other button? doing it in Java
> would easily allow this with out having two sets of the
> same code.

That's what functions are for.

Morgan Conrad

Posts: 307
Nickname: miata71
Registered: Mar, 2006

Re: JSR 296 Swing App Framework Prototype Released Posted: Feb 2, 2007 8:21 AM
Reply to this message Reply
I know it's just demo code, but whenever I see


JButton button = new JButton();
button.setName("button");
button.setAction(new ActionAdapter() {
public void actionPerformed(ActionEvent e) {
exit();
}
});


I cringe. The proper way to do this, is to define an Action first, then just go

JButton = new JButton(exitAction);

Mark Nuttall

Posts: 13
Nickname: mnutty
Registered: Jan, 2007

Re: JSR 296 Swing App Framework Prototype Released Posted: Feb 2, 2007 6:18 PM
Reply to this message Reply
> That's what functions are for.
So, you agree then. :)

Achilleas Margaritis

Posts: 674
Nickname: achilleas
Registered: Feb, 2005

Re: JSR 296 Swing App Framework Prototype Released Posted: Feb 5, 2007 4:03 AM
Reply to this message Reply
> > That's what functions are for.
> So, you agree then. :)

My point is that Java is too verbose, way more than it should be.

Flat View: This topic has 6 replies on 1 page
Topic: IoC in Method Signatures Previous Topic   Next Topic Topic: Romain Guy on Filthy Rich Clients

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use