1 17 package org.apache.bcel.verifier; 18 19 import java.awt.Dimension ; 20 import java.awt.Toolkit ; 21 import javax.swing.UIManager ; 22 import org.apache.bcel.generic.Type; 23 24 30 public class GraphicalVerifier { 31 32 boolean packFrame = false; 33 34 35 36 public GraphicalVerifier() { 37 VerifierAppFrame frame = new VerifierAppFrame(); 38 if (packFrame) { 41 frame.pack(); 42 } else { 43 frame.validate(); 44 } 45 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); 47 Dimension frameSize = frame.getSize(); 48 if (frameSize.height > screenSize.height) { 49 frameSize.height = screenSize.height; 50 } 51 if (frameSize.width > screenSize.width) { 52 frameSize.width = screenSize.width; 53 } 54 frame.setLocation((screenSize.width - frameSize.width) / 2, 55 (screenSize.height - frameSize.height) / 2); 56 frame.setVisible(true); 57 frame.classNamesJList.setModel(new VerifierFactoryListModel()); 58 VerifierFactory.getVerifier(Type.OBJECT.getClassName()); frame.classNamesJList.setSelectedIndex(0); } 61 62 63 64 public static void main( String [] args ) { 65 try { 66 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 67 } catch (Exception e) { 68 e.printStackTrace(); 69 } 70 new GraphicalVerifier(); 71 } 72 } 73 | Popular Tags |