• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why Swing???

 
Noor-e-Mustafa
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am totally tired up by using swing. It is slow and create a lot of problems specially when we have a lot of objects like menu, toolbar, graphics on screen.
Can anybody tell me why Java is promoting swing? Isn't simple awt is much better than that???

 
Matt Senecal
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not Swing? Swing provides a much simpler and straightforward interface to GUI components than AWT does, and provides some advanced components that AWT does not. That's it's big point. It's also extremely flexible. Sure, there's more overhead, but speed isn't much of an issue now with cheap CPUs pushing 1GHz.
 
Frank Hale
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been running Swing apps on my PIII 500 with 256 megs of ram for a year now and the speed is not bad and actually quite nice. Sure it would be even better to be running Swing on a 1 GHz chip with 512 megs of ram, but Swing isn't that bad on my system. I also run it on a PII 450 w/ 128 meg ram and its just fine.
Stop your whinning! Geesh!
 
Glen Tanner
Ranch Hand
Posts: 147
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why Swing? Remember that Swing is an extension of the AWT. So Swing makes up for the AWT's shortcomings. Event handling is much easier in Swing than in AWT. Other reasons not to use AWT: too many bugs, not consistent across platforms, can't print very easy, no clipboard, and if you think performance is bad using Swing--try developing a large GUI in AWT.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe that the official answer is that the AWT uses heavyweight components, and Swing uses lightweight components.
Heavyweight components rely on peer functions provided by the underlying operating system, and as such require much more system resources.
Lightweight components are completely removed from the operating system and rely only on java.
 
Glen Tanner
Ranch Hand
Posts: 147
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exactly. Which is why JFC is more consistent across platforms than AWT.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!