which library better for faster java application swt or swing?

which library better for faster java application swt or swing?

Asked by: Jack152 | Posted: 23-01-2022

Answer 1

Several years ago Swing was slow so SWT was developed to make native API calls on systems. However, Swing performance has greatly improved and this is no longer the case. SWT is non-standard, while Swing is officially part of the Java spec. JavaFX will also be built on top of Swing. Unless your job requires writing Eclipse plugins, I would use Swing.

To see a really good app developed in Swing, take a look at Jetbrain's Java IDE. You can try it for 30 days.


Of course, Sun's Netbeans is a pure Swing app too and it's free.


Answered by: Connie626 | Posted: 24-02-2022

Answer 2

There is no slow swing application. Just poorly written. And this also apply for SWT. The most application make better responses because of eclipse core architecture. Before J6 there were several problems with gray windows during unresponsive periods but this is quite solved using fully double buffered approach in swing PLAFs. There is no better UI framework. There is only better written program which appropriately uses multi-threading to avoid unresponsiveness of UI. Personally I prefer Swing :)

Answered by: Carlos778 | Posted: 24-02-2022

Answer 3

Today, both frameworks are fast. I suggest to check these criteria:

  1. SWT is more simple to use than Swing (especially if this is your first UI)
  2. Swing is older and you can find more components
  3. If you also use JFace, you will find many powerful widgets that work out of the box (where you would need a lot of additional configuration in Swing).
  4. Swing is available anywhere, SWT is not
  5. SWT is developed actively, you have the source and bugs are fixed quickly. Swing hasn't been touched in years, then there was suddenly a big update for Java 6. If you have an issue with Swing, well, Sun probably doesn't care.
  6. If you choose Swing, use a framework like SwingX. This will make your life much more simple.

Answered by: Ada992 | Posted: 24-02-2022

Answer 4

According to wikipedia there is no clear winner (although you can edit that if you want). Inevitably, you can write benchmarks which will show either much faster that the other. Swing has more freedom to optimise on the Java side of things. SWT can allow more optimisations to occur within the windowing system.

Probably the bigger impact on performance is going to come from how your application behaves. Concentrate on getting your code clean (and do a little profiling when necessary).

Answered by: Andrew581 | Posted: 24-02-2022

Answer 5

"faster" is subjective. Both can run fast, but it's easier to do something dumb to shoot yourself in the foot with Swing and make it feel slow.

That said though, I find Swing easier to work with at a code level than SWT.

Answered by: Blake259 | Posted: 24-02-2022

Answer 6

Technological decision towards the widget toolkit are pretty thin ice in my eyes. The amount of work you'd have to deliver when it comes to the application framework is considerable and much more decisive IMHO. I believe that the only argument that's in favor of SWT is it's native L&F. On the other hand most UI's tend towards non-native L&F nowadays. You clearly see this in the trend for Eclipse RCP apps to use the forms framework which paints custom gradients and sections and is no native interface in any way (the same applies to e4, the eclipse v4 elaboration project). To sum up, If RCP's an option in your project, I'd use Eclipse RCP (which is SWT). The completeness, vivacity and tempo this platform has is unbeatable. If RCP's not an option, Spring RCP looks pretty convincing to me (which is Swing based).

Answered by: Stella380 | Posted: 24-02-2022

Answer 7

there are more applications written using swing than SWT over the years. But the user-friendliness of SWT on windows is superior compared to Swing. But, there are exceptions(http://www.amazon.com/Rich-Client-Programming-Plugging-NetBeans/dp/0132354802) .

There is a bigger community of RCP apps developed using SWT. Although the RCP applications using Netbeans is NOT as big, that is considerable.

With Java 6 UPDATE 10 coming up soon, the performance of Swing apps should be pretty good. That said, that performance improvement might apply to SWT apps as well.


Answered by: Arthur571 | Posted: 24-02-2022

Similar questions

How do I use a Python library in my Java application?

What are the basic nuts and bolts of calling (running? interpreting? what can you do?) Python code from a Java program? Are there many ways to do it?

jvm - Java application crash when uses icepdf library

In my application I use the library icepdf. when you create a class of applications is broken and creates a log file. Help in solving problems Log file: # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d034bee, pid=3304, tid=3364 # # JRE version: 6.0_21-b07 # Java VM: Java HotSpot(TM) Client VM (17.0-b17 mixed mode, sharing wi...

java - Is there a way for a Library to know the package name of the application using it?

Is there a way for any class in a library (could be activity, view or any other class that may have access to a "magic" method) to know or inquire the package name of the application using it? If so, how? It would be great to have this ability at run-time, but having this ability in build/compile time would be good as well.

java - how to import ZXING library in android application?

I need to implement ZXING QR code scanner in my application. I have complete source code for ZXING Android. Now, I want to use this in my application. my question is that should I copy all ZXING library code in my application including manifest,xml and java files or I can have a jar file which I need to just add in my application? Can anybody tell me how to create jar file from android code, or is any ZXING jar already av...

java - How to use a JNI native library from Grails application

I'm developing a Grails web application and I need to use a JNI native library to access some specific hardware. For a simple Java application (see below) it works fine. To do this I just have to add the JAR to the Java build path and specify the "Native library location" (I use SpringSource Tool Suite on Windows7). Working example: import conceptacid.nativedriver.Driver; public class Main { public ...

java - Library issue when running application

I´m writing an application to test a library. It compiles perfectly but when I run it on the virtual device (2.3.3), I get this error: *java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{nicolas.luque/nicolas.luque.MyARActivity}: java.lang.ClassNotFoundException: nicolas.luque.MyARActivity in loader dalvik.system.PathClassLoader[/data/app/nicolas.luque-2.apk] Caused by: java.lang.Clas...

Can I use Ruby or Python library in Android Java application?

Let's say I want to write a poker app for Android. It is fine to use APIs in Java. But when it comes to heavy usage of arrays, sets, combinations etc Java becomes a huge pain for me. It's much easier to code poker AI in Ruby/Python IMHO. So the question: is there a way to use either Ruby or Python functions in Java Android Application? It should be packed in .apk of course. UPDATE:...

jsp - Geting error while use jstl tag library in java web application

This question already has answers here:

swing - How to update library of Java application during runtime?

Is it possible to update a jar file/library used by a Swing application at runtime ?

java - Spring OAuth Library for web application

I am trying to build an web application with oauth authentication. Which is the best suitable library between brick red social auth and spring social? Please suggest me pros and cons of the two.

windows - IE6 generated strange worksheet name when doing export from java application

I am encountering error like test(10)[1].csv file cannot be found at C:\Documents and Settings\Ron\Local Settings\Temporary Internet Files\Content.IE5\PQ0STUVW When trying to do export of CSV file using the following codes. Anyone have any idea what could be wrong? This issue does not occur in IE7 / Firefox and is only specific to IE6. response.setContentType("applicati...

c# - Embedding Flash Player in a C++ or Java application?

I would like to embed Flash Player directly inside a C++ or Java application. I found an article that describes how to do this for C#: http://www.adobe.com/devnet/flash/articles/stock_history03.html Unfortunately, I have no experience with C#, COM or ActiveX. I need someone to translate this code to C++, allowing ...

java - How best to implement user selectable variables in web application

I have a Java based web-application and a new requirement to allow Users to place variables into text fields that are replaced when a document or other output is produced. How have others gone about this? I was thinking of having a pre-defined set of variables such as : @BOOKING_NUMBER@ @INVOICE_NUMBER@ Then when a user enters some text they can specify a variable inline ...

java - BIRT in a desktop application

Did someone ever used a BIRT report in a desktop application. I'm comming from the .NET environment and there you can use Crystal Reports to show reports in desktop apps. Is this possible with BIRT too, without having to set up a server environment? Can you give me some advice how to reach this goal? Thanks in advance.

java - Which is the best Open source application server?

java - Access spring bean that is exposed using http invoker from GWT application

Can I access spring bean that exposed using http invoker (server) from GWT application (client)? If so is there any example / tutorial for that?

How to close a Java Swing application from the code

What is the proper way to terminate a Swing application from the code, and what are the pitfalls? I'd tried to close my application automatically after a timer fires. But just calling dispose() on the JFrame didn't do the trick - the window vanished but the application did not terminate. However when closing the window with the close button, the application does terminate. What should I do...

java - How best can I isolate my application from an unreliable database?

I have a Java SOAP data service which sits on top of a Sybase database which, for reasons out of my control, has unreliable performance. The database is part of a vendor package which has been modified by an internal team and most of the issues are caused by slow response times at certain times of the day. The SOAP service provides data to a calculation grid and when I request data, I need the response time to be ...

java - Netbeans GUI Designer & Fixed-Size Application Panels

I'm having a problem, creating a fixed-size overall panel for a touchscreen GUI application that has to take up the entire screen. In a nutshell, the touchscreen is 800 x 600 pixels, and therefore I want the main GUI panel to be that size. When I start a new GUI project in NetBeans, I set the properties of the main panel for min/max/preferred size to 800 x 600, and the panel within the 'Design' view changes size. ...

How do I create a "Hello World" application in java for an iphone?

I'd like to create a basic "Hello World" style application for the IPhone using Java - can anyone tell me how?

Still can't find your answer? Check out these amazing Java communities for help...

Java Reddit Community | Java Help Reddit Community | Dev.to Java Community | Java Discord | Java Programmers (Facebook) | Java developers (Facebook)