import java.awt.Container;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class FrameApp extends JFrame
{
JLabel label;
JButton button1,button2;
public FrameApp()
{
super("JFrame窗口");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ImageIcon icon=new ImageIcon("图片//sun.gif");
label=new JLabel("JFrame应用,标签显示图标",icon,JLabel.LEFT);
button1=new JButton("按钮1");
button2=new JButton("按钮2");
Container cp=getContentPane();
cp.add(label,"Center");
cp.add(button1,"North");
cp.add(button2,"South");
setSize(200,200);
}
public static void main(String[] args)
{
FrameApp frame=new FrameApp();
frame.show();
}
}