1 19 20 26 package org.enhydra.dods.wizard; 27 28 import java.awt.Dimension ; 29 import java.awt.Toolkit ; 30 import javax.swing.UIManager ; 31 import org.enhydra.dods.generator.DODSGenerator; 32 import org.enhydra.dods.generator.DODSWizard; 33 34 42 43 46 public class DefaultDODSWizard extends DODSWizard { 47 public static WizardFrame1 frame = null; 48 boolean packFrame = false; 49 public DefaultDODSWizard(DODSGenerator generator) { 50 super(generator); 51 try { 52 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 53 } catch (Exception e) { 54 e.printStackTrace(); 55 } 56 } 57 58 public void startup() { 59 frame = new WizardFrame1(); 60 if (packFrame) { 61 frame.pack(); 62 } else { 63 frame.validate(); 64 } 65 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); 67 Dimension frameSize = frame.getSize(); 68 69 if (frameSize.height > screenSize.height) { 70 frameSize.height = screenSize.height; 71 } 72 if (frameSize.width > screenSize.width) { 73 frameSize.width = screenSize.width; 74 } 75 frame.setLocation((screenSize.width - frameSize.width) / 2, 76 (screenSize.height - frameSize.height) / 2); 77 frame.setVisible(true); 78 frame.setDefaultFocus(); 79 } 80 81 } 82 | Popular Tags |