Is Java Swing really used for constructing real-world software?
I'm taking an introductory course in Java, but nothing more than drawing some shapes, lines & basic tables.
|
Is Java Swing really used for constructing real-world software? I'm taking an introductory course in Java, but nothing more than drawing some shapes, lines & basic tables. |
||||
| show 1 more comment |
|
Swing is actually quite useful in real world software applications. In another post ( http://stackoverflow.com/questions/7494190/purpose-of-jpanel/7494542#7494542 ) , I liken Swing to HTML in terms of usage, as it really does make resizable application windows easy in a way that's quite striking when compared with its predecessor AWT. That's not to say that Swing is the end all framework, but as a basic framework built into the JVM (not requiring external libraries) it's definitely very useful, and using it instead of a library like SWT will allow you to keep your applet/application very small. One of my applications does animation into a Swing JPanel, and takes advantage of the resizing messages to change the size of the content automatically to match the size of the panel. Once you get the hang of it, it's really quite the pleasure to deal with, but until then, it can be a royal pain, especially the thread requirements to run things on the dispatcher thread for anything that updates the screen. |
|||
|
|
|
Yes, Swing is pretty widely used. Its real strength is for "write once run anywhere" cross-platform application development, where it's one of the few ways you can reliably get a consistent user interface on a broad range of platforms (the other good alternative is a web application with JavaScript/HTML). Because the components are "lightweight" i.e. rendered directly by the Swing libraries, you get the same look and feel regardless of what platform is being run on. This is sometimes considered a disadvantage (because it doesn't look "native" on many platforms) but can also be an advantage (you can standardise your look and feel across platforms, you can also customise your look and feel in any way you like). Although I don't have any starts to back this up, my impression is that Swing is used more often in corporate / enterprise environments (where portability and maintainability are important) rather than consumer applications (where a native look and feel is expected). Personally I think Swing is a pretty decent GUI framework, it's generally easy to use and gives you a lot of control if you need it. You can even do some quite cool / impressive things with the pluggable custom look and feels - for example the Napkin look and feel makes your app look like it was scribbled on a Napkin if that's the look you are going for...... |
|||
|
|
I can't see any reason why not use that, 1) reall dis-advantages my view
2) real advantages my view
3) there were lots of promisses about whatever, there were lots of official Sun's supported Frameworks SWT, Java Desktop Aplication, SwingX end with JavaFx, something hapends because new Java owner ..., really nothing hapends, my view is same about Java7. Sun's injections to the SWT, Java Desktop Aplication, SwingX ends and Java Desktop Aplication, SwingX died, JavaFx looks like as historical Atari ... 4) there are another Custom Free & non-Free Frameworks, but all is based on ATW and Swing methods 5) notice: most important everything (be sure about that) is based on
|
||||
|
|
|
I'll add a slight counter point to the previous answers and state that whilst Swing is certainly useful (and that Oracle isn't going to all of a sudden drop it) it does look like Oracle will be pushing forward with JavaFX 2.0+ as their rich client of choice. My guess is that Swing is not seen as a future technology. and you may not want to spend vast amounts of your time learning it. |
|||||
|
|
Many companies are using a combination of Swing and a forms designer which makes layouting a lot easier than coding the GUI by hand. The JFormsDesigner is a good example of one of those tools. |
|||
|
|
|
Before "Web 2.0" Swing was defacto standard for building browser based rich client. Today everybody switched to ajax webapps since. Swing is still quite popular for portable desktop applications, however Python is taking over that market a bit. I used to work as a developer for a big swing-based application. You need to consider pros and cons. There used to be a lot of pros for swing. Today is not as much but still you have powerful, portable and stable API. |
|||
|
|
"LET'S PLAY BATTLESHIP _,_"variety ;) – jonsca Oct 4 '11 at 2:36