import java
import java
import javax
class TestGUI
{
public static void main(String[] args)
{
frame f = new frame();
//還可以在這裡加上一句
①f
f
f
f
{
public void windowClosing(WindowEvent e)
{
int i;
i=JOptionPane
if(i==JOptionPane
{
System
this
}
else
{
}
}
});
}
}
class panel extends JPanel
{
public panel()
{
makeButton(
makeButton(
}
private void makeButton(String name
{
Button button=new Button(name);
button
{
public void actionPerformed(ActionEvent event)
{
setBackground(c);
}
}
);
add(button);
}
}
class frame extends JFrame
{
public frame()
{
setTitle(
setSize(
panel p= new panel();
add(p);
}
}
①:這句話在JCreator中可以實現
止
隱藏的效果
From:http://tw.wingwit.com/Article/program/Java/hx/201311/26545.html