Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Project Requirements aka Swing vs SWT  RSS feed

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are, and were in a past book promotion about SWT, a lot of posts regarding which is better, SWT or Swing. The most logical, intelligent, and common answer recently has been choose which ever API meets the needs of your project requirements. However, leaving it at that is insuffecient. We need a list of requirements that each API might fullfill. I'll start, please keep adding. Please provide an explination along with your posts rather than just saying something like "Native widgets".

SWT
-----
Native L&F/widgets - SWT provides widgets and a L&F native to the platform it is running on.

Swing
------
Extendability - Since swing does not rely on native code for drawing it's widgets (for the most part) customizing and extending widgets is a powerful feature of the Swing API.
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swing
-----
- amazing design (architectural), but sometimes overdesigned (slowing down)
- very well documented (regarding api)

--
./pope
[the_mindstorm]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ali Pope:
Swing
-----
- amazing design (architectural), but sometimes overdesigned (slowing down)
- very well documented (regarding api)

--
./pope
[the_mindstorm]


Could you elaborate a bit more on what you mean by "overdesigned (slowing down)"?
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take for example: how would you block the user to input a set of invalid characters? You should use the doublet JTextField - Document. While this is quite a generic and very nice desing, it would be much easier to have a setAllowedChars or setNotAllowedChars.

--
./pope
[the_mindstorm]

ps: this is just an example. there are some more :-)
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ali Pope:
While this is quite a generic and very nice desing, it would be much easier to have a setAllowedChars or setNotAllowedChars.


Ali,
I don't think SWT provide such method in its core API. So is SWT overdesigned(slowing down) as well?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess I am looking for more defining broad requirements. A textfield lacking a method is a little too precise and isn't what I mean. Maybe we are going at this at the wrong angle. Maybe someone should suggest some requirements for a project and then define reasons for choosing one over the other bases on those requirements.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SWT -- High responsiveness of the application, in addition to widgets and a L&F native to the platform it is running on(as you mentioned above, Gregg)

Swing -- If responsiveness does not matter for the project, due to the learning curve of SWT, Swing might be a better choice...
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ko Ko Naing:
SWT -- High responsiveness of the application, in addition to widgets and a L&F native to the platform it is running on(as you mentioned above, Gregg)

Swing -- If responsiveness does not matter for the project, due to the learning curve of SWT, Swing might be a better choice...


See, responsiveness is 100% debateble IMHO. So I can't consider that when making a decision.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gregg Bolinger:
So I can't consider that when making a decision.


Why, Gregg? Will you let the users of the application wait for 3 or 4 seconds(let's assume) using Swing, instead of 1 second of responsiveness using SWT?

Just my 2 cents...
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ko Ko Naing:


Why, Gregg? Will you let the users of the application wait for 3 or 4 seconds(let's assume) using Swing, instead of 1 second of responsiveness using SWT?

Just my 2 cents...


Intellij IDEA is faster than Eclipse for me. I know because I run both on the same PC. Intellij is 100% Swing and Eclipse is, of course, SWT. But that doesn't mean Swing is faster than SWT. All I am saying is it's a non-issue because the responsivness of an application depends on how the application is developed, not the underlaying API with regards to Swing and SWT.

Tell me how you came to decide SWT is faster than Swing? Or to put it more specifically, more responsive than Swing.
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gregg Bolinger:
I guess I am looking for more defining broad requirements. A textfield lacking a method is a little too precise and isn't what I mean. Maybe we are going at this at the wrong angle. Maybe someone should suggest some requirements for a project and then define reasons for choosing one over the other bases on those requirements.


Greg this would be definitely a better approach than just enumerating good/bad points in a very subjective way.

--
./pope
[the_mindstorm]
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gregg Bolinger:
Tell me how you came to decide SWT is faster than Swing? Or to put it more specifically, more responsive than Swing.


I have ever experienced in populating the values in JTable again and again... But I just feel(not calculating the real response time) that when I use org.eclipse.swt.widgets.Table of SWT, it seems the process of populating the values in table is faster than JTable...

I just feel like that... Or I might be wrong... If there is kind of benchmarking for the two technologies, it might be great...
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ko Ko Naing:


I have ever experienced in populating the values in JTable again and again... But I just feel(not calculating the real response time) that when I use org.eclipse.swt.widgets.Table of SWT, it seems the process of populating the values in table is faster than JTable...

I just feel like that... Or I might be wrong... If there is kind of benchmarking for the two technologies, it might be great...


Are we talking about populating them from a database or just by filling a table model with static data and then telling the table to render?
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gregg Bolinger:


Are we talking about populating them from a database or just by filling a table model with static data and then telling the table to render?


My applications already have data values ready to be renderred... So it is the case that they fill a table model with static data and then tell the table to render them...
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SWT
-----
ActiveX support - SWT offers the ability to embed OLE objets through ActiveX so it is possible to embed programs like Word and Excel into your application. Why on earth you would want to do this is beyond me, but the option is there.
[ January 20, 2005: Message edited by: Gregg Bolinger ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!