array.java

来自「使用jbuilder开发工具开发的java十个例子代码」· Java 代码 · 共 59 行

JAVA
59
字号
package untitled2;import java.awt.*;import java.awt.event.*;import java.applet.*;public class array extends Applet {  int i=1;  int j=1;  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 array() {  }  /**Initialize the applet*/  public void init() {    try {      jbInit();    }    catch(Exception e) {      e.printStackTrace();    }  }  /**Component initialization*/  private void jbInit() throws Exception {  }  /**Get Applet information*/  public String getAppletInfo() {    return "Applet Information";  }  /**Get parameter info*/  public String[][] getParameterInfo() {    return null;  } public void paint(Graphics g){  int mul[][] = {       {1,0,0,0,0,0,0,0,0},       {2,4,0,0,0,0,0,0,0},       {3,6,9,0,0,0,0,0,0},       {4,8,12,16,0,0,0,0,0},       {5,10,15,20,25,0,0,0,0},       {6,12,18,24,30,36,0,0,0},       {7,14,21,28,35,42,49,0,0},       {8,16,24,32,40,48,56,64,0},       {9,18,27,36,45,54,63,72,81},  };  for (i=0;i<9;i++){    for (j=0;j<9;j++){       if (mul[j][i]!=0)        g.drawString(""+mul[j][i],i*30+10,j*15+10);     }   }  }}

⌨️ 快捷键说明

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