wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Fundamentals: AWT vs Swing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Fundamentals: AWT vs Swing" Watch "Fundamentals: AWT vs Swing" New topic
Author

Fundamentals: AWT vs Swing

Chris Crawford
Ranch Hand

Joined: Jun 22, 2011
Posts: 85

I've got one of those big questions that you never think about except at the outset of a project. I realized that, for my current project, I really don't want any kind of resizing or moving around of components in the JFrame. For complicated reasons, I just need to have everything in a set place, without any changes in position because something new is a bit bigger or smaller. I've done a halfway decent job of getting Swing to do that, but it occurred to me that the whole design philosophy behind Swing may have been to provide easily resizable windows -- and if that is true, then an application that doesn't tolerate window resizing would be better off using AWT, right?

My application is close to complete, but now I'm fighting all those pesky little repositionings that Swing loves to do. Would I be better off just stripping the leading J from all those components?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10169
    
    8

Chris Crawford wrote:..., but it occurred to me that the whole design philosophy behind Swing may have been to provide easily resizable windows -- and if that is true, then an application that doesn't tolerate window resizing would be better off using AWT, right?

Not really.
AWT relies on the underlying OS for component "peers" where as Swing provides its own.
Imagine a button. Whenever the UI needs to render a button, AWT will ask the OS "give me a button to render". On the other hand, Swing will render the button itself.
This article will be an interesting read.
If you can share more information on what you are exactly trying to achieve, we can help you better.

In the meanwhile, I will move this thread over to the UI forums.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Chris Crawford
Ranch Hand

Joined: Jun 22, 2011
Posts: 85

Thanks for clearing that up for me. Sometimes the fundamentals are difficult to figure out because nobody mentions them.
 
Consider Paul's rocket mass heater.
 
subject: Fundamentals: AWT vs Swing
 
Similar Threads
Swing - Content Pane vs. Panel - have I got this right?
Full screen
puzzled over java
Borders
java