Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
The community reviewed whether to reopen this question 9 months ago and left it closed:
Duplicate This question has been answered, is not unique, and doesn’t differentiate itself from another question.
Improve this question
Is Java Swing still in use? is the most recent post I found, and it is 4 years old (now 12 years old), so...
Is Swing used at all in a professional environment? I am a student, and wondering if it is worth learning, or if its day has passed.
(I am not asking about a Swing-AWT comparison...just whether or not Swing is obsolete in the workforce.)
Majority of existing GUI java codebases are Swing and likely will stay that way until the codebase rots and nobody maintains it anymore.
Majority of new GUI java codebases are using JavaFX, which is the Swing replacement in Java8 and is part of the standard java library now. It allows for CSS skinning, HTML5 elements, and also has a very nice FXML (a dialect of XML/HTML) which allows non-programmers to "get in there" and work on the GUI layout, etc. It also has SceneBuilder which is a free/standard GUI drag-n-drop builder which auto-generates FXML for your program.
I kid not when I say FXML can replace 3,000 lines of extended JFrame class code for a Swing GUI, with 50 lines of FXML. (recent project I helped migrate).
Swing is still used heavily, and will continue to be for a long while -- after all, it was the only choice for Java for a loooong time. JavaFX, however, is refreshingly nice, and very-much-so worth learning.
As an aside -- Swing builds ontop of AWT - AWT has a lot of problems, most of which are marked as "wont-fix" by the java project (OpenJDK/Oracle). Swing was built to replace/fix AWT, however sometimes you will marry AWT objects into your Swing application. Heck, you will sometimes marry Swing objects into your JavaFX application. I would not bother with learning AWT, if you learn Swing, you are learning AWT for the most part. The largest difference with Swing vs AWT is Swing components start with the letter J. EX: JFrame vs Frame, etc.
Well, Intellij IDEA uses Swing for its UI, so I would not say that it is obsolete. Granted, I really think it could use a huge overhaul (read: something not full of spaghetti code).
Absolutely yes. Legacy swing applications are still supported and enhanced. There is no alternative for that. And if you are making applications like IDE's, SWING is still preferred. New application will of course have web-interfaces , but that really depends on the nature of the application. No generic rules.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Im quite good with writing text based programs using Java and ill like to proceed to writing GUI programs and animations ive checked several youtube playlists and they dont seem do helpful so i would appreciate any tips on where to start.
For desktop applications, You should start with Java Swing.
Swing API is a set of extensible GUI Components to ease the
developer's life to create JAVA based Front End/GUI Applications.
There are some good tutorials, I would suggest the following:
JavaTPoint and TutorialsPoint
After completing swing, you can move on to JavaFX.
JavaFX is a set of graphics and media packages that enables developers
to design, create, test, debug, and deploy rich client applications
that operate consistently across diverse platforms.
For that, you may follow to begin with
code.makery
Sounds as a great question, but not self explanatory. Before making assumptions just ask your self -
Do I feel myself as Web developer or a Desktop(Core) developer?
From a prospective of Desktop developer - take a look at Swing - it allows to make GUI forms and etc. If you decide to learn web, then take a look at Vaadin (which is made on top of GWT, and easier to dive in)..
Both of them have simlar syntax, so it would be always easier re-qualify...
UPDATE: While you still decide where to go, see this humble example of Vaadin Application
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I am currently working on an application with a code base that dates back to at least 2001. One of the components of this system is a desktop client that is written using Java Swing. It uses most of the good old layouts including BorderLayout, FlowLayout, and Gridbag layout. There are a number of fairly complex screens we need to manage and update periodically and we sometimes need to create new features with new user interfaces.
Is there something better than Swing we could look into migrating to?
Would it be possible to do this migration in stages (i.e. we would have a mix of the old Swing components with the new components during a prolonged migration phase)?
If we were to re-write the desktop client in Java today should we still use Swing?
I find myself using primarily GridBagLayout, is this still the tool of choice for more complex layouts or are there better layouts I could be using?
I was reading in book that Oracle intend to replace Swing by JavaFX.
Take a look in the question and answer bellow:
6. Is JavaFX replacing Swing as the new client UI library for Java SE?
Yes. However, Swing will remain part of the Java SE specification for the foreseeable future, and therefore included in the JRE. While we recommend developers to leverage JavaFX APIs as much as possible when building new applications, it is possible to extend a Swing application with JavaFX, allowing for a smoother transition.
You can see there original comment here.
In this case, I believe that you can consider to user JavaFX.
More details here and good examples here.
If you are using Java 8 you can use javafx for new componant. It's possible to use Swing componant with javafx.
you can still use java swing, but if you need to migrate you can migrate in stages using JavaFX (again a Desktop Client). if you need to use Web Client, then you could use GWT (this helps since the developers already have knowlege of UI Components) and GWT code is in Java and Javascript gets generated in Compile Time.
Java FX is more powerful and beautiful
We can say that swing is replaced with java FX.
Now a days no body is using swing because there are lot of advantage in java FX over swing
It has good feature called scaneBuilder we can just drag and drop the components to appropriate position so lot of time is saving.
Different type of layout are there to place the components attractively.
Impertinently we can use CSS to disign the UI so is more beautiful and attractive
we can integrate with web components also.
If you're redoing a layout entirely, I'd look at Matisse which uses Spring Layout.
https://netbeans.org/features/java/swing.html
It's far easier to get the relationships between components using a layout tool than trying to line everything up manually in GridBag or something similar.
If you're not redoing a major part of the code, I wouldn't touch it. Don't fix what ain't broken.
Regarding JavaFX, I personally have not been impressed by it. You can take a look at it, but JavaFX struck me as needing more "bake" time. I would not abandon Swing just yet.
If you need to have a Java desktop client looks like native application for some platform (Windows, MacOS, Linux) you can look on Standard Widget Toolkit (SWT) library.
One famous application example of usage of this library is Eclipse IDE. Another - Angry IP Scan, sources are at GitHub.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Lately I have learned a lot of Java;
Currently I am using Swing for GUI;
And I want to use Synthetica's L&F's ;
I need help on where to start, some comprehensive tutorials may help,
I also wonder that if I wasted time by learning swing.
Cause I know Synthetica does not require writing code, or am I wrong ?
Thanks.
Synthetica is a Look and Feel (LaF) for the Java Swing GUI Library/Toolkit. Think of it as a skin to change the default look of a Java GUI app.
Here's some reading on how to integrate a different LaF into your app:
http://docs.oracle.com/javase/tutorial/uiswing/examples/lookandfeel/
http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
http://www.javasoft.de/synthetica/faq/#general-1
Using a pre-built LaF will save you the time and code of making the LaF yourself, but you will still have to code the actual GUI (the frame, buttons, text boxes, etc). Synthetica will just make them look different than normal. I would say to effectively use Java Swing LaF's, you will still need to know a little about Swing.
If you do not like Swing, it's worth looking into JavaFX. It's the Swing replacement and is included in Java 8 by default. You can hand-code the GUI using Java code just like with Swing, or you can use something called FXML to basically write the GUI in a special XML document which is much faster. JavaFX also uses CSS to style the LaF to look however you want.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I want create a portable DeskTop Application with Graphical Possibility
I am Identifier with Swing,awt and Java FX
I think that i cant use awt because this don't work in all OS
but I don't khow what best option for my Application?
can I use both Swing and javaFx?
Is there other technology for create portable GUI Desktop Application ?
thank you
Swing is probably your best bet. AWT has no benefits anymore - Swing has superceded it. JavaFX is also a good option. The only problem with JavaFX is its low adoptability compared to Swing. There are very few expericned people in JavaFX out there. But JavaFX can embed Swing components.
Swing is very mature, and has a huge amount of information on the web.
SWT is another option, but with SWT you need to learn the RCP framework from Eclipse and that can take a while. Also, SWT is fairly restricting in what you can do. With Swing you have complete freedom.
That's about it for Java that i can think of.
I guess you are looking for a good GUI Framework for you JAVA Application.
AWT is totally outdated and was succeded by Swing.
You can use JavaFx and Swing together, for example, to integrate JavaFX in an old swing application.
An alternative would be to use SWT (like Eclipse).
Building nice looking GUIs in Java is quite a hard task. I would use JavaFX or SWT.
You can use the Google window builder available with eclipse. https://developers.google.com/java-dev-tools/download-wbpro Here are the details on how to install.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Is swt faster than swing?
Where can i get good tutorials
about swt?
it easy to migrate from swing
to swt?
See this web sites:
SWT, AWT and Swing
Swing vs SWT
Swing vs SWT(2nd)
Very nice webpages with example source code:
SWT
SWT 2d-Graphics
I think it's important to remember SWT came in to being when Swing was very immature and I guess the Eclipse folks thought it necessary to reinvent-the-wheel (suspect in retrospect that's something they regret, however thin a layer SWT is).
Nowadays Swing has matured, many of the problems and performance issues it used to have have been fixed and with the 3rd party extensions like JGoodies and JIDE I can't think of a good reason you would use anything but Swing for thick-client development.
There's a comprehensive tutorial here which takes you from 'Hello World' up.
Swing and SWT are two completely different APIs, although the principles are the same. MIgrating your skill is easy. Migrating a program, however, would be a lot of work.
I think you will experience some headache if application is to be run on different OS-es, dont know for now, but before there was no support for Mac OS, so forget about it if your app is to be run on Mac OS.
We also had this question in company and decided to go with Swing, because for normal desktop application you just cannot sense the speed difference which is supposedly on SWT side, and this speed you are buying with ruining WORA principle, you have to bring with your application needed .dlls or .so files to natively support your application running in desired OS-es.
For long time Swing part of Java (with printing) was weak point of Java. I think they will make much more out of Java if they succeeded to make Swing simple, intuitive and responsive at that time. Nowadays they made some positive steps in it, although still can be said, swing is big, complicated..