Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (549)
Games in Android Showcase (137)
games submitted by our members
Games in WIP (594)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  What would you modify in Swing if you had to rewrite it?  (Read 5083 times)
0 Members and 1 Guest are viewing this topic.
Offline gouessej

« In padded room »

« Posted 2013-07-25 12:00:08 »

Hi

I use several APIs to write GUIs including SWT, Swing, Netbeans RCP and Eclipse RCP. I have a lot of experience with Swing, I know it has some design flaws, it is sometimes cumbersome to use and its hardware accelerated pipelines don't allow to get consistent speedups. According to some (unconfirmed) rumors, some source code is simply copied from AWT to JavaFX which will make it difficult to run under Android. I assume PureSwing required a lot of work, I don't feel able to rewrite Swing alone even though there is already an hardware accelerated implementation of Graphics2D based on JOGL (GLG2D). What would you modify in Swing if you had to rewrite it?

Personally, I would try to make the following changes:
- support touch screens and multi-touch (in the same way NEWT does)
- support gamepads
- add a build-in charting API (like JavaFX)
- better separate the general behavior of components from the look and feel
- emulate native look and feels instead of relying on native features
- use OpenGL hardware acceleration to draw every components
- try to remove some non uniform or incoherent behaviors (for example it is difficult to modify the font used in the edition zone of a combo box, there are other examples...)
- let the developer set the event dispatching thread to ease the interoperability with SWT, JavaFX, etc...
- support CSS (like JavaFX)
- expose some parts of the API that handle the data manipulated by the GPU to ease the integration in existing 3D engines (Ardor3D, JMonkeyEngine, 3DzzD, Xith3D, Java3D, ...)
- modify PhoneME Advanced For Android to support a larger subset of JavaSE instead of relying only on a very poor subset of J2ME
Offline pjt33
« Reply #1 - Posted 2013-07-25 13:04:47 »

- try to remove some non uniform or incoherent behaviors
Inconsistent - it's a false friend.

The biggest design problem I had with Swing is its reliance on java.util.Vector and java.util.Hashtable rather than genericised List and Map.
Offline gouessej

« In padded room »

« Reply #2 - Posted 2013-07-25 14:20:44 »

The biggest design problem I had with Swing is its reliance on java.util.Vector and java.util.Hashtable rather than genericised List and Map.
Where and how was it a problem? Can you elaborate please? Maybe in JTable and JList?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

« JGO Spiffy Duke »


Medals: 452
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #3 - Posted 2013-07-25 14:38:27 »

Yes, that was a massive arse, not being able pass in Lists to Swing models.

I must have been one of the few people who actually liked Swing. It was/is by far and away the best cross-platform UI and codebase I've used. Just look how wretched Qt is. Using the GIMP makes me want to hurt random people afterwards.

Cas Smiley

Offline princec

« JGO Spiffy Duke »


Medals: 452
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #4 - Posted 2013-07-25 14:43:54 »

Otherwise... by Java 7, GPU acceleration was pretty good if you ask me. Some long-standing bugs could have done with dealing with. The lack of a pure Java HTML5+CSS3 component was its main downfall.

Cas Smiley

Offline SHC

2: log() expects parameter 1 to be double, string given
File: /home/jgo/public_html/addon_appreciation.php
Line: 191