• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Correct Way???

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I am a java newbie but not to programming and trying to learn and put a desktop application together. I would like to know is there a right/wrong ways to open/start a Java desktop application.
My thoughts are as follows:
Have an "application manager object" that basically handles the entire
application. This object would be created in the main function of the
class.
This object would then handle everything from there open new frames build
new objects from an init() function called from the main function.
When the init control is returned to the init functions the application
would naturally end.

Is this the correct way to handle a desktop application and will when the init() function opens a window will the function keep control until that window is closed???

TIA
-Jim
 
Ranch Hand
Posts: 529
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It depends on what you mean my "handles the entire application". Assuming you only have one main window, you will probably just want to extend JFrame. There you will create all your controls, hook up listeners, etc. You can just instantiate your derived JFrame in the main method and put the main method in that class. What more are you thinking the application manager class should do?
 
author
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's worth noting that a framework to manage a Swing application is one of the big drivers behind the Swing Application Framework project ( https://appframework.dev.java.net/ ). It has the concept of an "Application" and handles calling back into your code to set things up (on the right GUI thread) and shut things down, handles persistent app info, resource injection...

Chet.
 
Barry Andrews
Ranch Hand
Posts: 529
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kind of like Eclipse RCP
 
Chet Haase
author
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes and No: Eclipse RCP is more comparable to the much larger NetBeans Platform framework. That system has all kinds of large-app facilities, like modules, updates, etc. The Swing app framework is much smaller and more focused on basic, boilerplate needs of even small and medium sized applications.

Chet.
 
Barry Andrews
Ranch Hand
Posts: 529
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been spending way too much time with Eclipse RCP. I didn't know this Swing Application Framework even existed. Looks pretty cool. I'll have to check it out. Thanks.
 
author
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also check out NetBeans RCP. As Chet said, it comparable to Eclipse RCP but for Swing. The Swing Application Framework has a much narrower target in mind.
 
Jim Schneider
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Chet
I checked out the application framework and looks like what I am trying to do.
-Jim
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic