inner.java

来自「200多个自己编的java程序,大家可以学一下.」· Java 代码 · 共 52 行

JAVA
52
字号
/* * Inner.java * * Created on 2004年9月26日, 上午12:31 *//** * * @author  litertiger */import java.awt.*;import javax.swing.*;public class Inner extends javax.swing.JApplet {       /** Initializes the applet Inner */    public void init() {        Container pane=getContentPane();        pane.setLayout(new FlowLayout());        pane.add(b2);        initComponents();    }            /** This method is called from within the init() method to     * initialize the form.     * WARNING: Do NOT modify this code. The content of this method is     * always regenerated by the Form Editor.     */    private void initComponents() {//GEN-BEGIN:initComponents        jButton1 = new javax.swing.JButton();        getContentPane().setLayout(new java.awt.FlowLayout());        jButton1.setText("one");        getContentPane().add(jButton1);    }//GEN-END:initComponents            // 变量声明 - 不进行修改//GEN-BEGIN:variables    private javax.swing.JButton jButton1;    // 变量声明结束//GEN-END:variables     BlueButton b2=new Inner.BlueButton("two");        class BlueButton extends JButton{        BlueButton(String label){            super(label);            this.setBackground(Color.blue);        }    }}

⌨️ 快捷键说明

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