Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

For Eric and Dan: Swing -> SWT

 
Mikalai Zaikin
Ranch Hand
Posts: 3353
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Assuming I have some GUI Swing application (GUI JavaBean editor - some properties and some presentation of JavaBean), and I would like to convert this application to be an Eclipse plugin.

Is there any feasible way to do this (I mean to convert existing Swing app to Eclipse plugin)? Can be Eclipse plugin written with Swing library? Or is there any "adapter" library to utilize existing Swing applications in Eclipse ?

Sorry for maybe stupid question, this is new for me....

regards,
MZ
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can use Swing inside Eclipse plugins.
 
Eric Clayberg
author
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming I have some GUI Swing application (GUI JavaBean editor - some properties and some presentation of JavaBean), and I would like to convert this application to be an Eclipse plugin. Is there any feasible way to do this (I mean to convert existing Swing app to Eclipse plugin)? Can be Eclipse plugin written with Swing library? Or is there any "adapter" library to utilize existing Swing applications in Eclipse ?

Yes. You can use the Eclipse SWT_AWT bridge to run Swing widgets within an Eclipse view or editor.

Another alternative might be to use SwingWT which provides an implementation of Swing on top of SWT.

Yet another possibility would be to convert your Swing code into SWT code using the Swing to SWT (S2S) conversion tool (I have not used this tool).
 
Barry Andrews
Ranch Hand
Posts: 523
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would say that you would not want to use Swing inside SWT because it will not look good. You can use the appropriate look and feel for the platform to try and make it match SWT, but it's just not going to look quite the same.
 
Mikalai Zaikin
Ranch Hand
Posts: 3353
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for clarification !
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Eric Clayberg:

Yes. You can use the Eclipse SWT_AWT bridge to run Swing widgets within an Eclipse view or editor.

Another alternative might be to use SwingWT which provides an implementation of Swing on top of SWT.

Yet another possibility would be to convert your Swing code into SWT code using the Swing to SWT (S2S) conversion tool (I have not used this tool).


I'm not using that Swing to SWT (S2S) converstion tool... It's not open source and we need to pay for that... I am currently and gradually migrating my Swing appications to pure SWT, which is the best approach to take advantage of SWT performance, I guess...

Just my 2 cents...
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ko Ko Naing:


I'm not using that Swing to SWT (S2S) converstion tool... It's not open source and we need to pay for that... I am currently and gradually migrating my Swing appications to pure SWT, which is the best approach to take advantage of SWT performance, I guess...

Just my 2 cents...


It mostly depends on the volume/costs of work involved. I believe an automatic tool is not 100% guaranteed (keeping in mind that the 2 solutions are quiet different), but it may save a lot of hours. You can afterwards concentrate on the important migration stuff.

my 2cents come from 3 years of development in/with migration world ;-).

./pope
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ilja Preuss:
Yes, you can use Swing inside Eclipse plugins.




Swing Designer


Vistual Editor Project
[ October 01, 2004: Message edited by: somkiat puisungnoen ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic