import java.awt.Color;
import javax.swing.JFrame;
public class Test{
public static void main(String args[]){
JFrame f = new JFrame("第一个Swing窗体");
f.setSize(100,200);
f.getContentPane().setBackground(Color.blue);
f.setLocation(300,200);
f.setVisible(true);
}
}
import javax.swing.JFrame;
public class Test{
public static void main(String args[]){
JFrame f = new JFrame("第一个Swing窗体");
f.setSize(100,200);
f.getContentPane().setBackground(Color.blue);
f.setLocation(300,200);
f.setVisible(true);
}
}
本文介绍了一个简单的Java Swing应用程序示例,通过该程序可以创建一个具有蓝色背景的小型窗口。该窗口设置为特定大小,并在屏幕指定位置显示。
894

被折叠的 条评论
为什么被折叠?



