📄 key.java~40~
字号:
package untitled2;import java.awt.*;import java.awt.event.*;import java.applet.*;import com.borland.jbcl.layout.*;public class key extends Applet { int x = 0; int xl = 0; int y = 0; boolean isStandalone = false; BorderLayout borderLayout1 = new BorderLayout(); Panel panel1 = new Panel(); /**Get a parameter value*/ public String getParameter(String key, String def) { return isStandalone ? System.getProperty(key, def) : (getParameter(key) != null ? getParameter(key) : def); } /**Construct the applet*/ public key() { } /**Initialize the applet*/ public void init() { panel1.requestFocus(); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } /**Component initialization*/ private void jbInit() throws Exception { this.setLayout(borderLayout1); panel1.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(KeyEvent e) { panel1_keyPressed(e); } }); this.add(panel1, BorderLayout.CENTER); } /**Get Applet information*/ public String getAppletInfo() { return "Applet Information"; } /**Get parameter info*/ public String[][] getParameterInfo() { return null; } void panel1_keyPressed(KeyEvent e) { // panel1.setFont("TimesRoman",Font.BOLD,20); x = (e.getKeyText(e.getKeyCode())).length() + x; xl = (e.getKeyText(e.getKeyCode())).length() + xl; y = (int)(x/19); if (xl>18) xl = 0; panel1.getGraphics().drawString(e.getKeyText(e.getKeyCode()),xl*12+10,10+10*y); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -