2020-05-20

/*

  • To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. /package javaapplication1;import java.awt.;/** * * @author Angle~子敬 /public class JavaApplication1 { static Frame f; static Button b; static TextField tf; static List li; /* * @param args the command line arguments */ public static void main(String[] args) { f=new Frame(“prime”); b=new Button(“start”); tf=new TextField(“100”); li=new List(); f.add(tf,“North”); f.add(b,“East”); f.setSize(400,300); f.setVisible(true); // TODO code application logic here } }

/*

  • To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. /package javaapplication2;import java.awt.;/** * * @author Angle~子敬 /public class JavaApplication2 { static Frame f; static TextField tf; static Button b[]; /* * @param args the command line arguments / public static void main(String[] args) { f=new Frame(“Calculator”); tf=new TextField(“0”); String s[]={“CE”,“7”,“8”,“9”,"/",“4”,“5”,“6”,"",“1”,“2”,“3”,"-",".",“0”,"=","+"}; b=new Button[17]; for(int i=0;i<b.length;i++) b[i]=new Button(s[i]); Panel p1=new Panel(); Panel p2=new Panel(); p1.setLayout(new BorderLayout()); p2.setLayout(new GridLayout(4,4)); f.add(p1,“North”); f.add(p2,“Center”); p1.add(tf,“Center”); p1.add(b[0],“East”); for(int i=1;i<b.length;i++) p2.add(b[i]); f.setSize(300,200); f.setVisible(true); // TODO code application logic here } }
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值