if(frame != null) { frame.setVisible(false); frame = null;
if(bAutoClose) { if(frame != null) { frame.setVisible(false); frame = null; }
  JFloatable(JComponent main, String title) {    super(new BorderLayout());    this.main   = main;    this.title  = title;    buttonFloat = new JLabel(Activator.desktop.floatIcon);    buttonFloat.setToolTipText("Float window");    //    buttonFloat.setBorder(null);    buttonFloat.addMouseListener(new MouseAdapter() {	public void mouseClicked(MouseEvent ev) {	  if(frame == null) {	    doFloat();	  } else {	    doUnfloat();	  }	}      });    buttonInfo = new JButton("Show window");    buttonInfo.setToolTipText("Moves floating window to front");    buttonInfo.addActionListener(new ActionListener() {	public void actionPerformed(ActionEvent ev) {	  if(frame != null) {	    frame.toFront();	  }	}      });    addAncestorListener(new AncestorListener() {	public void ancestorAdded(AncestorEvent event) {	}	public void ancestorMoved(AncestorEvent event) {	}	public void ancestorRemoved(AncestorEvent event) {	  if(frame != null) {	    frame.setVisible(false);	    frame = null;	  }	}      });    add(main, BorderLayout.CENTER);    JPanel top = new JPanel(new BorderLayout());    top.add(buttonFloat, BorderLayout.EAST);    add(top, BorderLayout.NORTH);  }