1 19 package org.netbeans.modules.java.navigation; 20 21 import org.openide.windows.WindowManager; 22 import java.awt.BorderLayout ; 23 import java.awt.Dimension ; 24 import java.awt.Toolkit ; 25 import javax.swing.JDialog ; 26 27 33 final class ResizablePopup { 34 private static JDialog dialog; 35 36 static JDialog getDialog() { 37 if (dialog == null) { 38 dialog = new JDialog (WindowManager.getDefault() 39 .getMainWindow(), 40 "", false) { 41 public void setVisible(boolean visible) { 42 super.setVisible(visible); 43 44 if (!visible) { 45 getContentPane().removeAll(); 46 } 47 } 48 }; 49 dialog.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); 51 dialog.getContentPane().setLayout(new BorderLayout ()); 52 53 Dimension dimensions = Toolkit.getDefaultToolkit().getScreenSize(); 54 dialog.setBounds(((dimensions.width / 2) - 410), 55 ((dimensions.height / 2) - 300), 820, 600); 56 } 57 58 return dialog; 59 } 60 } 61 | Popular Tags |