java中非法的表达式开始
importjava.awt.*;publicclassCaluextendsFrame{publicCalu(){setLayout(newBorderLayout()...
import java.awt.*;
public class Calu extends Frame{
public Calu(){
setLayout(new BorderLayout());
Panel p1=new Panel();
p1.add(new TextField(" ",20));
add("North",p1);
Panel p2=new Panel();
p2.setLayout(new GridLayout(5,3);
p2.add(new Button("1"));
p2.add(new Button("2"));
p2.add(new Button("3"));
p2.add(new Button("4"));
p2.add(new Button("5"));
p2.add(new Button("6"));
p2.add(new Button("7"));
p2.add(new Button("8"));
p2.add(new Button("9"));
p2.add(new Button("0"));
p2.add(new Button("+"));
p2.add(new Button("-"));
p2.add(new Button("*"));
p2.add(new Button("/"));
p2.add(new Button("="));
add("Center",p2);
public static void main(String[]args){
Calu window=new Calu();
window.setTitle("MyCaluator");
window.pack();
window.show();
}
}
} 展开
public class Calu extends Frame{
public Calu(){
setLayout(new BorderLayout());
Panel p1=new Panel();
p1.add(new TextField(" ",20));
add("North",p1);
Panel p2=new Panel();
p2.setLayout(new GridLayout(5,3);
p2.add(new Button("1"));
p2.add(new Button("2"));
p2.add(new Button("3"));
p2.add(new Button("4"));
p2.add(new Button("5"));
p2.add(new Button("6"));
p2.add(new Button("7"));
p2.add(new Button("8"));
p2.add(new Button("9"));
p2.add(new Button("0"));
p2.add(new Button("+"));
p2.add(new Button("-"));
p2.add(new Button("*"));
p2.add(new Button("/"));
p2.add(new Button("="));
add("Center",p2);
public static void main(String[]args){
Calu window=new Calu();
window.setTitle("MyCaluator");
window.pack();
window.show();
}
}
} 展开
展开全部
import java.awt.*;
public class Calu extends Frame{
public Calu(){
setLayout(new BorderLayout());
Panel p1=new Panel();
p1.add(new TextField(" ",20));
add("North",p1);
Panel p2=new Panel();
p2.setLayout(new GridLayout(5,3));//这里少个)
p2.add(new Button("1"));
p2.add(new Button("2"));
p2.add(new Button("3"));
p2.add(new Button("4"));
p2.add(new Button("5"));
p2.add(new Button("6"));
p2.add(new Button("7"));
p2.add(new Button("8"));
p2.add(new Button("9"));
p2.add(new Button("0"));
p2.add(new Button("+"));
p2.add(new Button("-"));
p2.add(new Button("*"));
p2.add(new Button("/"));
p2.add(new Button("="));
add("Center",p2);
}//这里少个}
public static void main(String[]args){
Calu window=new Calu();
window.setTitle("MyCaluator");
window.pack();
window.show();
}
}
//最后多个}
public class Calu extends Frame{
public Calu(){
setLayout(new BorderLayout());
Panel p1=new Panel();
p1.add(new TextField(" ",20));
add("North",p1);
Panel p2=new Panel();
p2.setLayout(new GridLayout(5,3));//这里少个)
p2.add(new Button("1"));
p2.add(new Button("2"));
p2.add(new Button("3"));
p2.add(new Button("4"));
p2.add(new Button("5"));
p2.add(new Button("6"));
p2.add(new Button("7"));
p2.add(new Button("8"));
p2.add(new Button("9"));
p2.add(new Button("0"));
p2.add(new Button("+"));
p2.add(new Button("-"));
p2.add(new Button("*"));
p2.add(new Button("/"));
p2.add(new Button("="));
add("Center",p2);
}//这里少个}
public static void main(String[]args){
Calu window=new Calu();
window.setTitle("MyCaluator");
window.pack();
window.show();
}
}
//最后多个}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询