Keeping the menu bar on the screen when all windows are closed

  1. Set up a special menu bar to be used when no windows are open.

  2. Add this to your first shell.

  3. Set its size to zero.

  4. Set its location to negative coordinates.

  5. Display the shell.

public Shell openHiddenWindow(Display display) {
  createShell(display);
  createMenuBar();
  shell.setSize(0, 0);
  shell.setLocation(-100, -100);
  shell.open();
  return shell;
}

Be careful if you have any bring to Front/Send to Back/Move Forward/Move backward functionality


Previous | Next | Top | Cafe con Leche

Copyright 2005 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified August 31, 2005