tellme
tellme

Reputation: 851

A better way to do Swing Applications

Is there a better way to develop Java Swing applications?

SWIXML? JavaFX? Anything else that developers out here have liked and recommend?

Upvotes: 7

Views: 1401

Answers (5)

VonC
VonC

Reputation: 1324228

Another "better way" is through the use of a better Layout Manager:

MigLayout:
an extremely flexible and easy to use Layout Manager that works for both Swing and SWT.
It can do what Table Layout, Form Layout and almost all Swing Layout Managers can with simple to understand String and/or API based coding.
It is targeted to be for manually coded layouts what Matisse/Group Layout is for IDEs.

JPanel panel = new JPanel(new MigLayout());

panel.add(firstNameLabel);
panel.add(firstNameTextField);
panel.add(lastNameLabel,       "gap unrelated");
panel.add(lastNameTextField,   "wrap");
panel.add(addressLabel);
panel.add(addressTextField,    "span, grow");

alt text
(source: miglayout.com)

Upvotes: 9

Binil Thomas
Binil Thomas

Reputation: 13779

If you like programming in Groovy instead of Java, check out Griffon: http://griffon.codehaus.org/

Upvotes: 2

Brendan Cashman
Brendan Cashman

Reputation: 4928

The Swing Application Framework is a light framework that simplifies the creation and maintaining of small- to medium-sized Java desktop applications. The framework consists of a Java class library that supports constructs for things such as the following:

  • Remembering state between sessions.
  • Easier managing of actions, including running as background tasks and specifying blocking behavior.
  • Enhanced resource management, including resource injection for bean properties.

Here's an article about it.

It's been integrated with Netbeans 6.0 and later.

Upvotes: 1

Aaron Digulla
Aaron Digulla

Reputation: 328594

I like to build the UI (HTML, SWT or Swing) with Groovy. It's just so much more simple with Groovy builders.

Upvotes: 4

VonC
VonC

Reputation: 1324228

JavaDesktop is a very complete source of information for this kind of question.

Lately, I found (but not used it directly myself) the Flamingo swing component suite impressive.
Especially because it allow to integrate one latest recent UI design: ribbons

(It is not a new way to develop in the sense it is still a classic Swing component, not - for instance - an XML-based swing specification, but I would look at other projects of javadestop for other illustrations to your question)

alt text

Upvotes: 5

Related Questions