Beispiel #1
0
  /**
   * Stops service tracking and disposes of the application window.
   *
   * @param context The context of the bundle.
   */
  public void stop(BundleContext context) {
    Runnable runner =
        new Runnable() {
          // This disposes of the application window.
          public void run() {
            m_shapetracker.close();
            m_frame.setVisible(false);
            m_frame.dispose();
          }
        };

    if (SwingUtilities.isEventDispatchThread()) {
      runner.run();
    } else {
      try {
        javax.swing.SwingUtilities.invokeAndWait(runner);
      } catch (Exception ex) {
        ex.printStackTrace();
      }
    }
  }