package com.FlowLayout管理器;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import java.awt.FlowLayout;
import javax.swing.JFrame;
public class Example9_3 
{
public static void main(String args[])
{
final JFrame f=new JFrame("FlowLayout 示例");
Container c=f.getContentPane();
final FlowLayout f1=new FlowLayout();
c.setLayout(f1);//使JFrame采用FlowLayout流程布局
JButton leftButton=new JButton("left");
//注册事件监听器
leftButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent event)
{
f1.setAlignment(FlowLayout.LEFT);
f1.layoutContainer(f);
}
});
JButton centerButton=new JButton("center");
centerButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent event)
{
f1.setAlignment(FlowLayout.CENTER);
f1.layoutContainer(f);//重新布局

}
});
c.add(leftButton);
c.add(centerButton);
f.setSize(200,100);
f.setVisible(true);
}}
这程序运行完之后,原来的按钮怎么实现把它给隐藏了啊。