Make a JFrame not visible in the the TaskBar Tag(s): Swing


import javax.swing.JFrame;

public class NotInTaskbar extends JFrame {
  NotInTaskbar() {
    setType(Type.UTILITY); //  ***
    setVisible(true);
    setSize(200, 200);
    setTitle("Not Visible in the Taskbar");
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }

  public static void main(String[] args){
    new NotInTaskbar();
  }
}
or use a JDialog instead.
 import javax.swing.JDialog;

 public class NotInTaskbar extends JDialog {
   NotInTaskbar() {
     setVisible(true);
     setSize(200, 200);
     setTitle("Not Visible in the Taskbar");
   }

   public static void main(String[] args){
     new NotInTaskbar();
   }
 }

blog comments powered by Disqus