一个图形界面,用EditPlus写的,在dos窗口运行的。但是没像在实验室那样直接出来画面,是因为我少安装了什么吗? 代码如下: import java.awt.*; public class MyBorder { Frame fr; Panel p; Button east,
一个图形界面,用EditPlus写的,在dos窗口运行的。但是没像在实验室那样直接出来画面,是因为我少安装了什么吗? 代码如下: import java.awt.*; public class MyBorder { Frame fr; Panel p; Button east,west,north,south,center; MyBorder() { fr=new F... 一个图形界面,用EditPlus写的,在dos窗口运行的。但是没像在实验室那样直接出来画面,是因为我少安装了什么吗?
代码如下:
import java.awt.*;
public class MyBorder
{
Frame fr;
Panel p;
Button east,west,north,south,center;
MyBorder()
{
fr=new Frame("边界布局管理器");
p=new Panel();
east=new Button("east");
west=new Button("west");
north=new Button("north");
south=new Button("south");
center=new Button("center");
p.setLayout(new BorderLayout());
p.add("East",east);
p.add("West",west);
p.add("North",north);
p.add("South",south);
p.add("Center",center);
fr.add(p);
fr.add(east);
fr.add(west);
fr.add(north);
fr.add(south);
fr.add(center);
fr.setSize(400,400);
}
public static void main(String[] args)
{new MyBorder();}
}
展开
展开
全部