Java Desktop application: SWT vs. Swing [closed]

Pros Swing: part of java library, no need for additional native libraries works the same way on all platforms Integrated GUI Editor in Netbeans and Eclipse good online tutorials by Sun/Oracle Supported by official java extensions (like java OpenGL) Cons Swing: Native look and feel may behave different from the real native system. heavy components … Read more

Invalid Thread Access Error with Java SWT

It is thrown because your listener code is called from outside the SWT Display thread. You run code on the display thread like this: Display.getDefault().syncExec(new Runnable() { public void run() { // … } }); or, asynchronously: Display.getDefault().asyncExec(new Runnable() { public void run() { // … } });

How to draw a tree representing a graph of connected nodes?

You might consider any of these: JHotDraw, cited here, a meta-library for creating custom graph editors. Prefuse visualization library, illustrated here and here. Batik, which implements SVG rendering. JGraph demo and user manual. GraphStream, illustrated here. JFreeChart XYBubbleRenderer A JTree, suggested here, with a custom TreeIcon. A custom renderer, with x based on a fraction … Read more

Java GUI frameworks. What to choose? Swing, SWT, AWT, SwingX, JGoodies, JavaFX, Apache Pivot? [closed]

Decision tree: Frameworks like Qt and SWT need native DLLs. So you have to ask yourself: Are all necessary platforms supported? Can you package the native DLLs with your app? See here, how to do this for SWT. If you have a choice here, you should prefer Qt over SWT. Qt has been developed by … Read more

Create cross platform Java SWT Application

I’ve just run into the same problem. I haven’t tried it yet, but I plan to include versions of swt.jar for all platforms and load the correct one dynamically in the start of the main method. UPDATE: It worked. build.xml includes all jars: <zipfileset dir=”/home/aromanov/workspace/foo/lib” includes=”swt_linux_gtk_x86.jar”/> <zipfileset dir=”/home/aromanov/workspace/foo/lib” includes=”swt_macosx_x86.jar”/> <zipfileset dir=”/home/aromanov/workspace/foo/lib” includes=”swt_win32_x86.jar”/> <zipfileset dir=”/home/aromanov/workspace/foo/lib” includes=”swt_linux_gtk_x64.jar”/> … Read more