1 36 37 40 41 import java.awt.AWTPermission ; 42 import java.awt.Frame ; 43 import java.awt.event.WindowAdapter ; 44 import java.awt.event.WindowEvent ; 45 46 import javax.swing.*; 47 48 55 56 58 public final class Font2DTestApplet extends JApplet { 59 public void init() { 60 SecurityManager security = System.getSecurityManager(); 62 if ( security != null ) { 63 try { 64 security.checkPermission( new AWTPermission ( "showWindowWithoutWarningBanner" )); 65 } 66 catch ( SecurityException e ) { 67 System.out.println( "NOTE: showWindowWithoutWarningBanner AWTPermission not given.\n" + 68 "Zoom window will contain warning banner at bottom when shown\n" ); 69 } 70 try { 71 security.checkPrintJobAccess(); 72 } 73 catch ( SecurityException e ) { 74 System.out.println( "NOTE: queuePrintJob RuntimePermission not given.\n" + 75 "Printing feature will not be available\n" ); 76 } 77 } 78 79 final JFrame f = new JFrame( "Font2DTest" ); 80 final Font2DTest f2dt = new Font2DTest( f, true ); 81 f.addWindowListener( new WindowAdapter () { 82 public void windowClosing( WindowEvent e ) { f.dispose(); } 83 }); 84 85 f.getContentPane().add( f2dt ); 86 f.pack(); 87 f.show(); 88 } 89 } 90 | Popular Tags |