BUG Community

Welcome! Log In

Forums Java Java AWT Apps

Subscribe to Java AWT Apps  4 posts, 3 voices , Tagged: java

Log in to reply to this topic
 
May 17, 2010 2:50pm
User_img_not_found_05_med rawksolid 12 posts

I wanted to mess around with the SimpleGUI app from the BUGnet by adding a WindowListener so that I could close the program with the top right X. What is the best way to do this within the OSGi framework? I was planning on a System.exit(0) call (since I do that in all of my Java Swing applications), but figured the OSGi might have a nicer way to close the program. Thoughts?

-pm

May 17, 2010 3:45pm
Medium Bug Labs team jconnolly 285 posts

frame.close() and do your cleanup there (i.e. if you’re listening for BUGbase button events, unlisten, etc).  You never want to “System.exit(0)” from within an osgi context, you’ll kill the entire VM instance.  “Closing” a program has a different meaning when you’re an OSGi bundle.

Oct 24, 2012 1:53am