import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
//import javax.event.*;public class MyApp extends JFrame
{
public MyApp()
{
JButton b1 = new JButton("AAAAAAAA");
JButton b2 = new JButton("AAAAAAAA");
JButton b3 = new JButton("AAAAAAAA");
JButton b4 = new JButton("AAAAAAAA");
JPanel p = new JPanel();
GridLayout g = new GridLayout(4,1);
p.setLayout(g);
g.setVgap(20);
p.add(b1);
p.add(b2);
p.add(b3);
p.add(b4);
getContentPane().add(p,BorderLayout.WEST);
this.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
dispose();
System.exit(0);
}
});
}
public static void main(String args[])
{
MyApp m = new MyApp();
m.setSize(400,400);
m.show();
}
}
import java.awt.event.*;
import javax.swing.*;
//import javax.event.*;public class MyApp extends JFrame
{
public MyApp()
{
JButton b1 = new JButton("AAAAAAAA");
JButton b2 = new JButton("AAAAAAAA");
JButton b3 = new JButton("AAAAAAAA");
JButton b4 = new JButton("AAAAAAAA");
JPanel p = new JPanel();
GridLayout g = new GridLayout(4,1);
p.setLayout(g);
g.setVgap(20);
p.add(b1);
p.add(b2);
p.add(b3);
p.add(b4);
getContentPane().add(p,BorderLayout.WEST);
this.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
dispose();
System.exit(0);
}
});
}
public static void main(String args[])
{
MyApp m = new MyApp();
m.setSize(400,400);
m.show();
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货