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

📄 che.java

📁 很好得jbuilder100例源代码
💻 JAVA
字号:
package radio;import java.awt.*;import java.awt.event.*;import java.applet.*;import javax.swing.*;public class che extends Applet {  boolean isStandalone = false;  ButtonGroup radiobuttongroup1 = new ButtonGroup();  JRadioButton radiobutton1 = new JRadioButton();  JRadioButton radiobutton2 = new JRadioButton();  JRadioButton radiobutton3 = new JRadioButton();  /**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 che() {  }  /**Initialize the applet*/  public void init() {    try {      jbInit();    }    catch(Exception e) {      e.printStackTrace();    }  }  /**Component initialization*/  private void jbInit() throws Exception {    radiobutton1.setText("圆形");    radiobutton1.addActionListener(new java.awt.event.ActionListener() {      public void actionPerformed(ActionEvent e) {        radiobutton1_actionPerformed(e);      }    });    radiobutton2.setText("正方形");    radiobutton2.addActionListener(new java.awt.event.ActionListener() {      public void actionPerformed(ActionEvent e) {        radiobutton2_actionPerformed(e);      }    });    radiobutton3.setText("扇形");    radiobutton3.addActionListener(new java.awt.event.ActionListener() {      public void actionPerformed(ActionEvent e) {        radiobutton3_actionPerformed(e);      }    });    this.add(radiobutton1, null);    this.add(radiobutton2, null);    this.add(radiobutton3, null);    radiobuttongroup1.add(radiobutton1);    radiobuttongroup1.add(radiobutton2);    radiobuttongroup1.add(radiobutton3);  }  /**Get Applet information*/  public String getAppletInfo() {    return "Applet Information";  }  /**Get parameter info*/  public String[][] getParameterInfo() {    return null;  }  void radiobutton1_actionPerformed(ActionEvent e) {     repaint();  }  void radiobutton2_actionPerformed(ActionEvent e) {     repaint();  }  void radiobutton3_actionPerformed(ActionEvent e) {     repaint();  }  public void paint(Graphics g){    g.clearRect(0,20,300,280);    if(radiobutton1.isSelected())          g.drawOval(60,60,30,30);    if(radiobutton2.isSelected())          g.drawRect(120,60,30,30);    if(radiobutton3.isSelected())          g.drawArc(180,60,30,30,0,130);  }  public void update(Graphics g){     paint(g);  }}

⌨️ 快捷键说明

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