label.java~20~

来自「Jbuilder100个例子 都是经典例子 对大家学习Jbuilder非常有帮助」· JAVA~20~ 代码 · 共 52 行

JAVA~20~
52
字号
package jlabel;import java.awt.*;import java.awt.event.*;import java.applet.*;import javax.swing.*;import com.borland.jbcl.layout.*;public class label extends Applet {  int x,y;  boolean isStandalone = false;  JLabel jLabel1 = new JLabel();  XYLayout xYLayout1 = new XYLayout();  /**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 label() {  }  /**Initialize the applet*/  public void init() {    try {      jbInit();    }    catch(Exception e) {      e.printStackTrace();    }  }  /**Component initialization*/  private void jbInit() throws Exception {    jLabel1.setBackground(Color.red);    jLabel1.setBorder(BorderFactory.createEtchedBorder());    jLabel1.setText("青城山");    this.setLayout(xYLayout1);    this.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {    });    Icon icon1=new ImageIcon("qingchengshan1.jpg");    jLabel1.setIcon(icon1);    this.add(jLabel1, new XYConstraints(4, 4, -1, -1));  }  /**Get Applet information*/  public String getAppletInfo() {    return "Applet Information";  }  /**Get parameter info*/  public String[][] getParameterInfo() {    return null;  }}

⌨️ 快捷键说明

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