⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 note.java~10~

📁 java编程100例
💻 JAVA~10~
字号:
package untitled2;import java.awt.*;import java.awt.event.*;import java.applet.*;public class note extends Applet {  int i=10,j=10;  Color mycolor;  Font myfont;  String str;  boolean isStandalone = false;  /**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 note() {  }  /**Initialize the applet*/  public void init() {    try {      jbInit();    }    catch(Exception e) {      e.printStackTrace();    }  }  /**Component initialization*/  private void jbInit() throws Exception {    this.addKeyListener(new java.awt.event.KeyAdapter() {      public void keyPressed(KeyEvent e) {        this_keyPressed(e);      }    });  }  /**Get Applet information*/  public String getAppletInfo() {    return "Applet Information";  }  /**Get parameter info*/  public String[][] getParameterInfo() {    return null;  }  void this_keyPressed(KeyEvent e) {        i+=15;        if(i>200){          i=10;          j=j+20;        }        str = String.valueOf(e.getKeyChar());        repaint();  }  public void paint(Graphics g){     mycolor = new Color(30,155,155);     g.setColor(mycolor);     myfont = new Font("TimesRoman",Font.BOLD,20);     g.setFont(myfont);     g.drawString(str,i,j);  }  public void update(Graphics g){     paint(g);  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -