4 posts, 3 voices , Tagged: java
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?
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.