This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Swing components are light-weight?
There are different answers for this, but the thing is, that every place has explained it just saying AWT using a native window for every component and Swing has not been used in those examples, how does it work in Swing?
I'm not sure I completely understand your question but here goes:
Most Swing components are entirely lightweight - they are implemented with pure Java code. As far as the OS is concerned, the Swing lightweight components don't exist.
However you should know that Swing always uses at least one native component (usually the top-level window). The rest of Swing (all the lightweight components) are implemented so that they perform painting within this native component.
Related
This question already has answers here:
Swing vs JavaFx for desktop applications [closed]
(6 answers)
Closed 7 years ago.
I am using Java Swing to develop my application and i should finish it as soon as possible, but the design is very bad.
I found some advice which tells me that I should use JAVA FX.
What is the difference between Java FX and Java Swing ?
Will there be any change on the line of code?
Main difference could be the release date... JavaFX is more recent and can be considered as the successor of Swing.
There is many very useful features added in JavaFX.
See here some key features : https://docs.oracle.com/javase/8/javafx/get-started-tutorial/jfx-overview.htm#A1131418
I can list the main features for me:
Styles can be set by CSS (something similar to)
Bindings: easy way to bind a ui-value, like width of text of input, to a field in class. Changing the value of the field updates the ui without boilerplate
Animations/Transitions: easy way to make an animation, like a ui components which blinks or moves
3D: easy way to manipulate model to make animated 3D view
For making a new application from scratch, i think you should consider using JavaFX, Swing is outdated (imho)
This question already has answers here:
Java GUI frameworks. What to choose? Swing, SWT, AWT, SwingX, JGoodies, JavaFX, Apache Pivot? [closed]
(9 answers)
Closed 8 years ago.
Is there any alternative of swing?
I need a high performance GUI toolkit to create desktop application on linux (Ubuntu). I've been creating swing application for 2 years, therefore I want use java.
Yes, there's a number of other UI toolkits available - AWT, SWT, JavaFX, QT to name a few.
I'd primarily recommend JavaFX as the new UI toolkit (it's now part of Java8 and is still under heavy development) or perhaps SWT if you want the "native" feel (since it uses native OS components.) QT does this as well of course, but it requires bindings and is generally more of a faff - so its use is relatively rare in Java land.
On the other sided of things, I'd recommend staying away from AWT (it's the old, original Java GUI framework that lacks many common components in other UI toolkits, and is not really supported any more.)
Try Java FX. It will give you better performance than java Swing. Java FX
Take a look at JavaFX it's now part of the JRE/JDK for Java 8.
http://docs.oracle.com/javase/8/javase-clienttechnologies.htm
You can probably use SWT as an alternative.
https://www.eclipse.org/swt/
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.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to use HTML and CSS as a Java application GUI?
I'm trying to found another way to create GUIs for Java programs without Swing. I want something more dynamic and easy to use than Swing.
There is anything that I can use for this?
In truth, I want something similar to HTML. Exists?
JavaFX 2.0 might be what you are looking for (ignore JavaFX 1.0 which is very outdated):
It has an HTML-style layout language called FXML.
It also allows skinning of user interfaces with CSS-style themes.
It also has a WebView component that allows you to embed any web / HTML content in your app.
Having said that, I don't think Swing is hard to use when you get used to it, particularly if you use an improved layout manager like MigLayout.
This question already has answers here:
Java AWT/SWT/Swing: How to plan a GUI?
(10 answers)
Closed 8 years ago.
Does anybody know Swing related GUI guidelines - specifically on how to design Swing apps and which components I should use? I'm not looking for an official standard, but pragmatic tips I can use to set a good standard for my projects.
I haven't used too much of Swing by myself. Surely clicking a GUI with a GUI designer isn't a big deal. However I'd like to get some insights from people who have experience with Swing and know what to avoid. Swing lately (in Java 6- 10) got decent changes. So there isn't too much specific standardization out there currently.
There are many resources out there discussing good uses of Swing or showcasing good uses of Swing. Here are a few:
Kirill Grouchnikov's Blog
Pushing Pixels
Swing FX (hasn't been updated in a while, but has lots of good stuff in the archives)
These resources aren't simple best practices lists, but I find that I'm constantly inspired by general design blogs and Swing design blogs in particular. On top of that, projects like swinglabs can show you what people can and are doing with Swing.
When attempting to select the right layout manager for placing components in a panel I tend to take a quick look through Sun's visual guide to layout managers.