mybuttons.java~13~

来自「提供了常用的JAVA技术的示例」· JAVA~13~ 代码 · 共 39 行

JAVA~13~
39
字号
package flowlayout;import javax.swing.UIManager;import java.awt.*;import java.applet.Applet;public class myButtons extends Applet {    Button button1,button2,button3,button4;    TextField tf;    Label l;    public void init(){        button1=new Button("ok");        button2=new Button("open");        button3=new Button("close");        button4=new Button("save");        button1.setFont(new Font("simsun",Font.PLAIN,15));        button2.setFont(new Font("simsun",Font.PLAIN,15));        button3.setFont(new Font("simsun",Font.PLAIN,15));        button4.setFont(new Font("simsun",Font.PLAIN,15));        button1.setBackground(Color.red);        button2.setBackground(Color.green);        button3.setBackground(Color.yellow);        button4.setBackground(Color.orange);        tf=new TextField("text");        l=new Label("Test FolwLayout");        setLayout(new FlowLayout(FlowLayout.LEFT,25,100));        add(button1);        add(button2);        add(button3);        add(button4);        add(tf);        add(l);    }}

⌨️ 快捷键说明

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