File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Swing and Scripting Languages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Swing and Scripting Languages" Watch "Swing and Scripting Languages" New topic
Author

Swing and Scripting Languages

Michael Wexler
Greenhorn

Joined: Apr 06, 2004
Posts: 10
Obviously, there are great languages which work on the JVM, like Pnuts, Groovy or Jython. Does anyone have any suggestions as to which ones would make building some GUIs easier? I struggle with the Sun samples, and it seems like lots of repetitive coding which a scripting langugage could hide from me. It would also be nice if the language was not too hard for a beginnner.
Either that, or a "beginners framework" which would help hide some of the pain.
(or, perhaps, winning a book here... 8-) )
Anyway, suggestions, pointers, etc are appreciated.
Michael
Matt Fury
Greenhorn

Joined: Mar 04, 2002
Posts: 23
Have you looked into SWT yet? I am quite impressed with the speed among other things with Eclipse. By far the best editor out there.


-------<br />Sun Certified Java 2 Programmer<br /><a href="http://www.lfhsolutions.com" target="_blank" rel="nofollow">http://www.lfhsolutions.com</a><br />matt@lfhsolutions.com
John Wetherbie
Rancher

Joined: Apr 05, 2000
Posts: 1441
The SWT homepage.


The only reason for time is so that everything doesn't happen all at once.
- Buckaroo Banzai
Glenn Murray
Ranch Hand

Joined: Dec 07, 2001
Posts: 74
While it's true that Swing has been called the "747 cockpit" of user
interface design, It's probably a mistake to think
that learning a scripting language to do Java gui's is going to be
easier than learning Swing. For the simple stuff you need only to
learn about a few layouts and widgets.
Eclipse is an advanced IDE (but an average editor) which uses a
non-Swing gui toolkit called SWT. I think SWT is losing favor
as Swing improves. Some interesting remarks about SWT and the
latest Eclipse are at http://jroller.com/page/BillDudney/20040331

Cheers,
Glenn
[ April 27, 2004: Message edited by: Glenn Murray ]

Glenn Murray
Author of Yo Soy Una Vaca De Hoy
Matt Fury
Greenhorn

Joined: Mar 04, 2002
Posts: 23
Eclipse is an advanced IDE (but an average editor) which uses a
non-Swing gui toolkit called SWT

Yes, I should have called it an IDE. My mistake!
I, personally, and more concerned about the speed of the application as most end-users are. I believe Java application development will take off if we can get the response time down between Windows and the App. Here's to hoping so. I love writing Java apps!
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

Originally posted by Matt Fury:
By far the best editor out there.

Hmm, debatable. I think IDEA is the best.
Originally posted by Matt Fury:
I, personally, and more concerned about the speed of the application as most end-users are. I believe Java application development will take off if we can get the response time down between Windows and the App. Here's to hoping so. I love writing Java apps!

It's good to know there are other people out there that like writing Java Desktop Apps. FYI - Java 1.5 has some pretty significant changes in the startup time of the VM. So apps launch quite a bit faster.
Also note that with the final release of 1.5, the Linux version of java will use OpenGL for rendering in the Graphics2D API which is what Swing uses to draw all it's widgets, so that will increase some speed as well.
One last note is that Swing apps aren't slow if you code them correctly. And SWT is just plain ugly and has been way overhyped due to the success of Eclipse.
IntelliJ IDEA runs just as good as Eclipse and it is all Swing.
[ April 27, 2004: Message edited by: Gregg Bolinger ]

GenRocket - A Test Data Generation Platform
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

Now back to are regularly scheduled program....
Originally posted by Michael Wexler:
Obviously, there are great languages which work on the JVM, like Pnuts, Groovy or Jython. Does anyone have any suggestions as to which ones would make building some GUIs easier? I struggle with the Sun samples, and it seems like lots of repetitive coding which a scripting langugage could hide from me. It would also be nice if the language was not too hard for a beginnner.
Either that, or a "beginners framework" which would help hide some of the pain.
(or, perhaps, winning a book here... 8-) )
Anyway, suggestions, pointers, etc are appreciated.
Michael

You might want to look at something like Swixml.
Matt Fury
Greenhorn

Joined: Mar 04, 2002
Posts: 23
One last note is that Swing apps aren't slow if you code them correctly. And SWT is just plain ugly and has been way overhyped due to the success of Eclipse.

This is true. Multi-threading really helps. Although I guess we could debate all day one whether Java Apps will ever rival native C/C++ apps.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

Originally posted by Matt Fury:

This is true. Multi-threading really helps. Although I guess we could debate all day one whether Java Apps will ever rival native C/C++ apps.

It depends on the domain in which we are speaking. If I was programming for Windows and only Windows, really there is no reason to NOT use MS's development languages (VS.NET).
On the other hand, if I need it to run anywhere, then Java is really my only option. It's not a matter of comparing the 2, it's a matter choosing the best tool for the job.
Matt Fury
Greenhorn

Joined: Mar 04, 2002
Posts: 23
It depends on the domain in which we are speaking. If I was programming for Windows and only Windows, really there is no reason to NOT use MS's development languages (VS.NET).

Ya, unfortunately when we talk about GUI Applications, Windows is usually the only option. I don't know too many people that run Linux / Unix as a desktop.
Personally I don't know why MS would want to create another layer to run Desktop apps with .NET. If anything that will bring it down to the level of Java.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Matt Fury:
Personally I don't know why MS would want to create another layer to run Desktop apps with .NET. If anything that will bring it down to the level of Java.
My guess would be that they were afraid of their developer base migrating to Java for serious applications (Java was a lot easier than C++ from the get go and performance was bound to get better over the years). That would explain the creation of C#. From there, it's not such a weird decision to aim for a single platform bringing together all the "MS languages."


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Matt Fury
Greenhorn

Joined: Mar 04, 2002
Posts: 23
That would explain the creation of C#. From there, it's not such a weird decision to aim for a single platform bringing together all the "MS languages."

No, I understand why they are trying to do managed layer of code but to me that's exactly what it is.. another LAYER to bog down the performance.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Matt Fury:
I understand why they are trying to do managed layer of code but to me that's exactly what it is.. another LAYER to bog down the performance.
You can always use straight C++ with Win32 APIs and not enter the dotnetland at all...
Michael Wexler
Greenhorn

Joined: Apr 06, 2004
Posts: 10
Thanks all for your suggestions. I've done some playing around, and here are my findings:
1) SWT is about as hard as SWING, in part b/c you still have to add your buttons, give them event listeners, etc., so it isn't all that much different to code. In fact, SWT is halfway between that old AWT and the newer SWING, in that some repaints that swing takes care of you still need to deal with in AWT. But I didn't worry about that; if I can get the frame to appear, then everything else I'll just learn on the way.
2) Drawing the gui on Eclipse (or netbeans or jdeveloper) is something I've tried, but then I found that I couldn't understand the code it generated. So, I couldn't understand how to make it do the things I wanted.
3) XML things which all use a defin file (like xul) are interesting ideas also, but one still needs to understand lots of swing to make it work. I found the examples often assumed lots of undestanding of how one would code in java and translate to XML, and I'm just not good enough yet. But it was all cool stuff (Thinlets, xul, and the mentioned swixml).
These are all wonderful suggestions, and I've learned lots. Other suggestions included Groovy (which has a "swingbuilder" portion) and Judoscript http://www.judoscript.com which has a very javascript like syntax.
I guess what I really want is:
Frame("Myframe");
AddButton(Name="PressMe", Action=button1Press, color=Green);
and not have to worry about making new ones, assigning listeners, etc.
Lazy guy, I guess. Perhaps GUIs are harder than I want them to be!
Thanks again to all,
Michael
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

Originally posted by Michael Wexler:

I guess what I really want is:
Frame("Myframe");
AddButton(Name="PressMe", Action=button1Press, color=Green);
and not have to worry about making new ones, assigning listeners, etc.
Lazy guy, I guess. Perhaps GUIs are harder than I want them to be!
Thanks again to all,
Michael

Well, if it were that easy, then everyone could do it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Swing and Scripting Languages
 
Similar Threads
What languages for Android
Where to post Scala discussions
how database is connected by xml
Scripting in java 6
Is Ruby a scripting or a programming Language?