LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-27-2005, 09:26 AM   #1
PerfectReign
Member
 
Registered: Apr 2005
Location: Los Angeles
Distribution: openSUSE / Ubuntu
Posts: 294

Rep: Reputation: 33
Experiences with SWING & SWT?


I'm fairly new to Java, having ignored it for the past eight years. However, I'm liking it for many different reasons, not the least of which is that my company is now implementing a new zSeries IBM server, which has gobs of power and a native JVM.

Anyway, for desktop development, I've been learning Swing/AWT. I've alraeady taken three univeristy courses in it. However, I cannot seem to get over the complexity of Swing when creating applications. I've been reading a lot about SWT and how beautiful it is compared to Swing.

Do any of you have experiences with Swing vs. SWT? I'd be curious to see how they compare and if one is better reocmmended for a given purpose than another.

TIA
 
Old 06-27-2005, 11:40 AM   #2
lowpro2k3
Member
 
Registered: Oct 2003
Location: Canada
Distribution: Slackware
Posts: 340

Rep: Reputation: 30
Swing is fun

Sorry j/k, haven't used SWT. I remember my older friend from school, was muttering some choice words about it though. Hes been programming Java for 6 years before he came to school this year, he seemed to be a bigger fan of the Swing/AWT way of doing things, but I figure if you spend a long time doing things one way, it might take alot to change from those ways. He really helped me with my Java and I was very impressed with some of the apps he'd written.
 
Old 06-27-2005, 08:45 PM   #3
johnMG
Member
 
Registered: Jul 2003
Location: CT, USA
Distribution: Debian Sarge (server), Etch (work/home)
Posts: 601

Rep: Reputation: 32
I just recently read a thread somewhere about this very thing but can't recall where...

It may have been here: http://www.osnews.com/story.php?news_id=10433 but the link on that page no longer works. Hmm... Perhaps the comments to the story (also linked to there) will be useful to you.

Anyhow, what I recall from reading it was that the guy had spent lots of time with both Swing and SWT, and he found that he was unhappy with SWT for a number of reasons. One of which was that SWT primarily gets bug-fixes for stuff related to Eclipse and not much else.

I plan to have a look at Java-Gnome http://java-gnome.sourceforge.net/cgi-bin/bin/view as soon as time permits.
 
Old 06-27-2005, 11:20 PM   #4
PerfectReign
Member
 
Registered: Apr 2005
Location: Los Angeles
Distribution: openSUSE / Ubuntu
Posts: 294

Original Poster
Rep: Reputation: 33
Thanks for the link. I'm planning on taking a look. I'm also installing Eclipse on my KDE system as I write this. I'll post a personal account.
 
Old 06-28-2005, 07:40 PM   #5
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Swing might be more extensible... but swt is typically better performing... in the limited experience I have.
 
Old 06-29-2005, 02:56 PM   #6
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Rep: Reputation: 30
Are you kidding? I loved using the Swing API! I found it both intuitive and enjoyable, much more so than QT at the time (this was about 18 months ago). I made all kinds of cool Swing demo apps for my classes, like a simple paint program, a "duck hunt" game where each bird flew in it's own thread, a slide show viewer that would continuously apply random image distortion algorithms over and over (it made an awesome picture look even more awesome than before, which was awesome believe me). Too bad I don't have any old source code with me at the moment, otherwise I would share. I picked up the basics of Swing very quickly from the book Programming with Objects (http://www.programmingwithobjects.com/).


If I had spare time, I wouldn't mind cooking up some more simple GUI programs with AWT/Swing.
 
Old 06-30-2005, 11:27 AM   #7
PerfectReign
Member
 
Registered: Apr 2005
Location: Los Angeles
Distribution: openSUSE / Ubuntu
Posts: 294

Original Poster
Rep: Reputation: 33
I dunno. I had a heck of a time trying to get my GUI apps sized and layed (?) out correctly with Swing. Between GridBag, Flow, Border I've had it up to here with layouts.

I've installed Eclipse on both my WinXP box at work and my system at home. I then installed the Windowbuilder Pro plugin for Eclipse GUI development, and I'm already happy. I've only done about three little demos, but the layout and ability to control properties, not to mention the intellisence (I'm a reformed VB Coder.) in the code, is awesome.

http://www.perfectreign.com/stuff/ScreenShot093.jpg

I'm going to have to investigate further. My only concern is that I want my apps to be at home in both Linux and when I downgrade to XP at work.
 
Old 06-30-2005, 11:51 AM   #8
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
One of the BIG problems with SWT is that applications using it are no more pure java, they are dependant on native code unbundled with the JVM.

This breaks one of the java language goals: "write once, run anywhere ... "
 
Old 07-01-2005, 09:49 AM   #9
PerfectReign
Member
 
Registered: Apr 2005
Location: Los Angeles
Distribution: openSUSE / Ubuntu
Posts: 294

Original Poster
Rep: Reputation: 33
Hmm, that's a big problem? I don't actually see it that way. As it is, I have an application in mind (a binary Usenet download app improving on Newsbin / KLibidio / KNZB) which I have been designing and hope to have full cross-platform support right out of the gate. My first attempts at the view portion was to use Swing, but even there I would have different libraries loading depending on whether I want Motif or Metal or something else.

In this case I see myself setting up the view portion to simply determine what OS is being run, then instantiate the appropriate class libraries for the display - either on Darwin, GTK, or Win32. Once that's done all the background work will be handled the same. Hopefully this will match the MVC standard I read so much about.

So far, I've been writing everything to the CLI, since I want my program logic down before I even get to the GUI. This is forcing me to ensure my controller logic is going to be seperate from my view logic. At the same time, I want to make sure that my GUI looks good and is easy to implement/maintain when I get done.

Looking at apps like Azureus, which i use often both on Win2K and my SuSE box, I can see the benefits. Azureus just looks good and feels natural regardless of which platform I'm on. OTOH, I use Limewire on both platforms and I cringe every time - it feels and responds like a Java GUI. I know I can change the look/feel but it just doesn't feel as snappy as Azureus. (This is no slam on the ability of LW to work as intended. I grab "test" items all the time using LW.)

Or, maybe I should just write everything in VB6, right?
 
Old 07-01-2005, 10:04 AM   #10
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
My first attempts at the view portion was to use Swing, but even there I would have different libraries loading depending on whether I want Motif or Metal or something else.
Of course the JVM eventually need to load a library to access the physical hardware but this library is already there with SWING, the issue with SWT is that the needed library it is not bundled with the JVM, so code using SWT is not portable to any JVM supporting SWING, you have to install SWT too, and possibly install it from the source if no binary exists for your platform.
Also SWING need not a high level underlying library while SWT does.
 
Old 07-01-2005, 04:23 PM   #11
PerfectReign
Member
 
Registered: Apr 2005
Location: Los Angeles
Distribution: openSUSE / Ubuntu
Posts: 294

Original Poster
Rep: Reputation: 33
Hmm, valid point. Let me try this out on a few simple apps and see what I can do. My expectation is that I'll make an installer that puts everything in the app directory (I despise the idea of this.sub.directory.of.another.something.that.is.twenty.levels.deep) and references that.

I'll let you know.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SWT for Eclipse under FC4 max2004 Fedora 1 08-11-2005 09:29 PM
Routerboard44 - experiences & advice ? michaelsanford Linux - Networking 0 04-08-2005 05:24 PM
Netbeans & SWT apocolpse Programming 0 10-29-2004 12:07 PM
swt hello problem melinda_sayang Programming 1 08-11-2004 12:25 AM
I got it working & your experiences with Linux star2a LinuxQuestions.org Member Success Stories 1 06-10-2004 02:19 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration