• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

The Definitive Guide to SWT and JFace book :- Reader question

 
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, i have some experience on swing, can i easily to catch up SWT and Jface comcept? is this book cover for advanced reader or novice ?

can someone please explain what is SWT and Jface ? what is the good points to have SWT anf Jface ....thank you very much for your time !
 
author
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should be able to get up to speed on SWT and JFace with no problem, as you work through this book. It doesn't spend any time teaching Java, but it assumes no knowledge of SWT nor JFace. As a Swing developer, you're already familiar with GUI concepts, so your learning curve should not be bad at all.

In a nutshell, SWT is a widget toolkit (buttons, menus, tables, trees, et al.), that uses native widgets to ensure precise desktop integration and best performance. JFace is an abstraction layer that rides on top of SWT--sort of an MVC layer. You can use SWT without using JFace, but in many cases JFace makes development easier.
 
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eh, not necessarily so. The biggest difference, and one which I've found to be consistenly tricky when you're out of practice, is whereas in Swing, where GUI resource management is handled automatically, in SWT and JFace, you need to allocate and release handles to manage resources.

It's just one of those things that you need to be extra-vigilant about until you get the hang of it.

RK
 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alvin, me too... I used to do Swing in the past, especially in my universtiy life... I was even addicted to Swing GUI developement. I like the appearance of GUI and I felt like I am proud of my Swing GUI appearance, different from other students' VB project...

But when I graduated and came into the working life, Swing got no place in the industry, at least in Thailand, the country I am currently residing... But I just heard about SWT two months ago and I am really interested in that... As Mr.Rob encouragement to us(the former Swing aspirants), I got inspired by his words and started to do some little tests in SWT... I've never tried SWT before as well... I believe that in no time, I can catch up the concept of SWT...

And JFace coming together with SWT is interesting too... Such kind of abstraction does not exist in Swing...
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Robert Konigsberg:
in SWT and JFace, you need to allocate and release handles to manage resources.
It's just one of those things that you need to be extra-vigilant about until you get the hang of it.



It is like C++ Windows programming technique... We need to get a handle to access resources and we need to release it, not to affect the performance of the application... So we need to manage the trade-off between performance of SWT and less resource-management property of Swing....

Just my 2 cents...
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Eh, not necessarily so. The biggest difference, and one which I've found to be consistenly tricky when you're out of practice, is whereas in Swing, where GUI resource management is handled automatically, in SWT and JFace, you need to allocate and release handles to manage resources.

It's just one of those things that you need to be extra-vigilant about until you get the hang of it.



Is the manual management of resources in SWT/JFace that noticeable, or it's like the thought of "creating optimized application as much as possible" makes SWT preferable that Swing? If its not that big a difference, might as well stick to Swing...? Of course, learning new things in Java would be great
 
Rob Warner
author
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
SWT does require some manual management of resources, since the resources are actual native resources. The work is not that extensive, however, since most of what you create (e.g. buttons on a dialog) are automatically disposed when the parent is closed. When you create a resource that doesn't "belong" to another resource however, like a color or a font that you can use in many different widgets, it's up to you to dispose it manually.
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

In a nutshell, SWT is a widget toolkit (buttons, menus, tables, trees, et al.), that uses native widgets to ensure precise desktop integration and best performance. JFace is an abstraction layer that rides on top of SWT--sort of an MVC layer. You can use SWT without using JFace, but in many cases JFace makes development easier.



Mr.Rob Warner, swt is only use for desktop application right? it means swing will be replace by swt since it is faster with native code design ? please correct me ..
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and does SWT and jFace provide API as well ? is there any formal web site for these references ?
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i found the SWT API,

anyway, SWT only can use in desktop application ? thank you !
[ July 08, 2004: Message edited by: Alvin chew ]
 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Alvin,

yes, SWT is only for desktop applications, so no applets!

Jan
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks, jan ..

i actually admire on netbeans IDE which provide drag n drop(VB like) interface for swing , but for SWT , is there any IDE doing it so ? thank you !
 
Rob Warner
author
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
SWTworkbench and SWT Designer are a couple. Be sure to check Eclipse Plugin Central for a wealth of Eclipse plugins.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jan Rotthaus:
Hi Alvin,

yes, SWT is only for desktop applications, so no applets!

Jan



But you could use SWT with Java WebStart.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rob Warner:
SWTworkbench and SWT Designer are a couple.



I've just checked them out... They are not free... But there are at least trial version of SWT Designer and Open Source version of SWTworkbench for us(developers) to taste...
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a very interesting article from IBM developerWorks that show how to create standalone SWT/JFace applications. This is a 2 parts series:
Using the Eclipse GUI outside the Eclipse Workbench
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ko ko , i have try both jigloo and SWT designer .. for SWT designer, you need to buy a license for full function , whereas jigloo allow you try full function for the plugin ...

my personal suggestion was using jigloo plugin, which is make me feel comfortable on Swing design but for SWT , i still learning ...

anyway, thank for Mr. ROb to provide information ...
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
good link jean, i trying a sample code there , get problem in compile ..do anyone know where to get API for jFace ? thank you !

problem : FileTreeContentProvider can't resolved



i do import following :

import java.io.*;

import org.eclipse.jface.viewers.*;
import org.eclipse.jface.window.*;
import org.eclipse.swt.widgets.*;
[ July 08, 2004: Message edited by: Alvin chew ]
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Alvin chew:
do anyone know where to get API for jFace ? thank you !



You can get Javadoc for SWT & JFace by following this instruction.

http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-home/faq.html#wherecanIgetJavadoc
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
refer to previous code section, i do a mistake ...forgot to code another class ....sorry ! :roll:
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the link , jiayun !

 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
do anyone know how to display graph in swt ? thank you !
 
JiaYun Jia
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Alvin chew:
do anyone know how to display graph in swt ? thank you !



Here's a sample code that I modified from a SWT example snippet. ( http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-home/snippits/snippet34.html )

 
Anything worth doing well is worth doing poorly first. Just look at this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic