📄 securityapp.java
字号:
//SecurityApp.javapackage com.wrox.security;import java.awt.*;import java.awt.event.*;/** * This class demonstrates the Java security features by attempting to * perform a few privileged operations which only applications may normally * do. This class can be run both as an applet and as an application. */public class SecurityApp extends java.applet.Applet { private SecurityTestWindow window; /** * Called after the applet is loaded into the browser */ public void init() { window = new SecurityTestWindow("Applet Security Test"); window.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { window.hide(); } }); window.showTestResults(); } /** * Called when the page is being closed */ public void destroy() { window.dispose(); } /** * Main method. This allows the test to be run as a normal application. */ public static void main(String[] args) { SecurityTestWindow window = new SecurityTestWindow("Application Security Test"); window.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); window.showTestResults(); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -