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

📄 cursor.java~13~

📁 Jbuilder100个例子 都是经典例子 对大家学习Jbuilder非常有帮助
💻 JAVA~13~
字号:
package approach;import java.awt.*;import java.awt.event.*;import java.applet.*;public class cursor extends Applet {  int x,y;  int x1=0,y1=0;  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 cursor() {  }  /**Initialize the applet*/  public void init() {    try {      jbInit();    }    catch(Exception e) {      e.printStackTrace();    }  }  /**Component initialization*/  private void jbInit() throws Exception {    this.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {      public void mouseMoved(MouseEvent e) {        this_mouseMoved(e);      }    });  }  /**Get Applet information*/  public String getAppletInfo() {    return "Applet Information";  }  /**Get parameter info*/  public String[][] getParameterInfo() {    return null;  }  void this_mouseMoved(MouseEvent e) {        x = e.getX() ;        y = e.getY() ;        repaint();  }  public void run(){     while(true){         repaint();         try{Thread.sleep(100);         }         catch(InterruptedException e){}      }    }   public void paint(Graphics g){      if(x1<x)        x1++;      else        x1--;      if(y1<y)        y1++;      else        y1--;      g.setColor(Color.yellow);      g.fillRoundRect(x1,y1,30,30,5,5);      g.drawString("JAVA",x1,y1);    }}

⌨️ 快捷键说明

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