SWT or Swing?

R

richnjones

Hi all,

I am about to start writing a UI application and am thinking about
writing it in SWT. I have experience with Swing but never used SWT. I
thought it might be good to get to know another technology. I am
writing the application for a windows machine so portability is not a
primary concern of mine. I have heard SWT is a bit windows focussed
which for me is not an issue.

With the improvements with Swing under Java 5 and 6 which technology
does the group think I should use? Is speed much better in SWT when
compared to Swing? Is SWT a steep learning curve? I belive they both
paint on the event thread so bad programming in either would hit UI
performance.

TIA
Richard
 
A

Arne Vajhøj

I am about to start writing a UI application and am thinking about
writing it in SWT. I have experience with Swing but never used SWT. I
thought it might be good to get to know another technology.

Always good to know all the alternatives.
I am
writing the application for a windows machine so portability is not a
primary concern of mine. I have heard SWT is a bit windows focussed
which for me is not an issue.

SWT uses native GUI components, but they are available for
some other platforms than Windows.
With the improvements with Swing under Java 5 and 6 which technology
does the group think I should use? Is speed much better in SWT when
compared to Swing?

As a product strategy, then I do not see much point in SWT. SUN works
hard to improve Swing and my impression is that they keep improving
it.
Is SWT a steep learning curve?

Never tried it personally. But on my TODO list.
> I belive they both
paint on the event thread so bad programming in either would hit UI
performance.

That is generic for many GUI frameworks. It is the exact same issue in
..NET win forms.

Arne
 
A

alexanderg.13

Always good to know all the alternatives.


SWT uses native GUI components, but they are available for
some other platforms than Windows.


As a product strategy, then I do not see much point in SWT. SUN works
hard to improve Swing and my impression is that they keep improving
it.


Never tried it personally. But on my TODO list.

 >                                                   I belive they both


That is generic for many GUI frameworks. It is the exact same issue in
.NET win forms.

Arne

Does this involve with any software?
 
A

alexanderg.13

Does this involve with any software?- Hide quoted text -

- Show quoted text -

When writing an application therfore has to write with any software
because an application example UI will install that program to help
you torwards that domain name
 
L

Lew

Does this involve with any software?

I'm sorry but your question is not clear.

By "this" do you mean that you have to be careful about putting GUI actions on
the GUI thread?

What sort of "involvement" are you talking about?

All software that interacts with a GUI has to be careful that GUI events only
occur on the GUI thread.
 
L

Lew

When writing an application therfore has to write with any software
because an application example UI will install that program to help
you torwards that domain name

What are you talking about?
 
M

Mark Space

When writing an application therfore has to write with any software
because an application example UI will install that program to help
you torwards that domain name

Ah, so you're the guy who writes those manuals.
 
R

Roedy Green

With the improvements with Swing under Java 5 and 6 which technology
does the group think I should use? Is speed much better in SWT when
compared to Swing? Is SWT a steep learning curve? I belive they both
paint on the event thread so bad programming in either would hit UI
performance.

In terms of complexity it goes AWT, SWT, Swing.
SWT has better performance.
However, if you want help, Swing in where everyone is.
 
R

richnjones

In terms of complexity it goes AWT, SWT, Swing.
SWT has better performance.
However, if you want help, Swing in where everyone is.

Thanks for the replies. I know that SWT is available on other OS than
Windows although I seem to remember James Gosling saying it was very
windows centric. That was one of the criticisms he mentions if I
remember correctly.

Roedy: Does SWT have better performance that Swing after Java5. I know
Sun spent a lot of time trying to improve its performance? I am not
too bothered about individual tests for this but just a general feel.

TIA
 
R

Roedy Green

Roedy: Does SWT have better performance that Swing after Java5. I know
Sun spent a lot of time trying to improve its performance? I am not
too bothered about individual tests for this but just a general feel.

IIRC the main SWT app in the universe is Eclipse. Nobody does a big
app like that both ways for testing. Perhaps you will have to create
some representative app to see if it worth the hassle.

SWT came out before swing. So most of the impetus came from people
eager for fine control when Swing was not available. It has withered
somewhat since now Swing has even more elaborate functionality.

Further video hardware is breathtaking compared with what we had only
a few years ago. Once is it fast enough, further speed increases
don't matter. About the only people who have an insatiable lust for
video power are the gamers who want ever-higher resolution 3D
renderings that move faster than the eye of my age can follow.

Any Java App I have written, when run on my machine is fast enough
that it feels effectively psychologically instantaneous. The delays
are nearly all about the web.
 
A

Andrew Thompson

Roedy Green wrote:
....
Further video hardware is breathtaking compared with what we had only
a few years ago. Once is it fast enough, further speed increases
don't matter. About the only people who have an insatiable lust for
video power are the gamers who want ever-higher resolution 3D
renderings that move faster than the eye of my age can follow.

Surely, at that stage the developers are overriding paint(Component)
and the entire matter of widget toolkit (AWT/SWT/Swing) has become
irrelevant, no? Either that or the app. leverages the power of JOGL,
or Java3D, or (..insert other non Sun rendering APIs here) - which
ends up in the 'same difference' for all 3 widget toolkits.
 
R

richnjones

Roedy Green wrote:

...


Surely, at that stage the developers are overriding paint(Component)
and the entire matter of widget toolkit (AWT/SWT/Swing) has become
irrelevant, no?  Either that or the app. leverages the power of JOGL,
or Java3D, or (..insert other non Sun rendering APIs here) - which
ends up in the 'same difference' for all 3 widget toolkits.

Roedy/Andrew
Thanks for the replies. I use Eclipse and it does seem very
responsive. It is interested that you said SWT was before Swing. I
didnt realise that. It is also a very good point about graphics card/
processor speed - it will only get faster. I suppose both can be slow
with bad programming but I think I will opt for Swing at the moment.

Thanks!
 
D

Daniel Dyer

SWT came out before swing. So most of the impetus came from people
eager for fine control when Swing was not available. It has withered
somewhat since now Swing has even more elaborate functionality.

I'm pretty sure that Swing came first (around 1998). The Eclipse site
says that IBM considered using Swing for Eclipse and then decided to build
SWT instead.

The main reason not to use SWT is that it is neither part of the standard
library nor pure Java, so you need to bundle it with your application
(with different native libs for each platform that you deploy on). This
may be worth the hassle if SWT gives your application something
significant that Swing doesn't, but usually Swing is perfectly adequate.

Dan.
 
L

Lew

Andrew said:
<mock serious>Grasshopper, you have reached
enlightenment.</mock serious>

That's the key, really. Much of slowness in Java GUIs historically has been
due to misunderstanding of threading issues, a matter common to all GUI libraries.

More generally, GUIs suffer more from bad design and layout than they do from
slow platforms.

Many gurus have taught that algorithm affects speed more than anything else.
It's all about the big O - n-squared is bad, n*log(n) better, log(n) great,
and we adore the Holy Grail of O(1).

Getting work off the EDT is the big secret to Swing, it seems. Getting
graphics onto the EDT is the other one.
 
C

Christian

Hi all,

I am about to start writing a UI application and am thinking about
writing it in SWT. I have experience with Swing but never used SWT. I
thought it might be good to get to know another technology. I am
writing the application for a windows machine so portability is not a
primary concern of mine. I have heard SWT is a bit windows focussed
which for me is not an issue.

With the improvements with Swing under Java 5 and 6 which technology
does the group think I should use? Is speed much better in SWT when
compared to Swing? Is SWT a steep learning curve? I belive they both
paint on the event thread so bad programming in either would hit UI
performance.

TIA
Richard

SWT alone has not a chance to stand any comparison with SWING .. so
don't try to compare it to SWING this way.. If you want to learn a new
Technology that might give you some help in developing an UI application
try learning the eclipse RCP.

It will give you a lot of help with common isuues.. branding, native
starter, update functionality...
 
J

John W. Kennedy

I'm pretty sure that Swing came first (around 1998). The Eclipse site
says that IBM considered using Swing for Eclipse and then decided to
build SWT instead.

I believe it was in between. Swing was on the way, maybe even available
in prototype, but some feared that it would be a complete failure. And,
at the time, Swing wasn't part of standard Java, either.
--
John W. Kennedy
"But now is a new thing which is very old--
that the rich make themselves richer and not poorer,
which is the true Gospel, for the poor's sake."
-- Charles Williams. "Judgement at Chelmsford"
 
R

Ramon F Herrera

Hi all,

I am about to start writing a UI application and am thinking about
writing it in SWT. I have experience with Swing but never used SWT. I
thought it might be good to get to know another technology. I am
writing the application for a windows machine so portability is not a
primary concern of mine. I have heard SWT is a bit windows focussed
which for me is not an issue.

With the improvements with Swing under Java 5 and 6 which technology
does the group think I should use? Is speed much better in SWT when
compared to Swing? Is SWT a steep learning curve? I belive they both
paint on the event thread so bad programming in either would hit UI
performance.

TIA
Richard


The widget that best displays and illustrates the difference between
Swing and SWT is the File Chooser. Take a look at the "Open file..."
menu item in Eclipse. It looks like the real thing, because it is the
real thing. Unlike the Swing File Chooser you will be able to view the
files by Thumbnails, Tiles, Icons, List and Details.

http://www.eclipse.org/swt/

I have always used Swing (due to the Sun's gravitational influence and
inertia) but I look forward switching to SWT in my next projects.

Many users are surely turned off and consider Java an "inferior
product" (as defined by economists) when they experience the crappy
Swing emulation of a real native widget.

-Ramon
 
R

Ramon F Herrera

Thanks for the replies. I know that SWT is available on other OS than
Windows although I seem to remember James Gosling saying it was very
windows centric. That was one of the criticisms he mentions if I
remember correctly.


SWT is Windows-centric iff (sic) you are running it on a Windows
platform.

It is extremely Linux centric when you run on Linux, and it couldn't
be any more Solaris-centric when you run it in Solaris. If you happen
to be developing under the Mac, ...

Oh, well, I ran out of OSs. You get the point.

-Ramon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top