?? myframe1.java
字號:
import java.awt.*;
import java.awt.event.*;
public class MyFrame1 extends Frame
{
Button bt=new Button("exit");
Button bt1=new Button("really??");
public MyFrame1(String title)
{
super(title);
initComponent();
}
public void initComponent()
{
this.setSize(800,600);
this.setLocation(200,100);
this.setBackground(Color.orange);
this.setLayout(new FlowLayout());
this.add(bt);
this.add(bt1);
this.addWindowListener(new WindowListener()
{
public void windowActivated(WindowEvent e)
{
} //Invoked when the Window is set to be the active Window.
public void windowClosed(WindowEvent e)
{
} //Invoked when a window has been closed as the result of calling dispose on the window.
public void windowClosing(WindowEvent e)
{
System.exit(0);
} //Invoked when the user attempts to close the window from the window's system menu.
public void windowDeactivated(WindowEvent e)
{
} //Invoked when a Window is no longer the active Window.
public void windowDeiconified(WindowEvent e)
{
} //Invoked when a window is changed from a minimized to a normal state.
public void windowIconified(WindowEvent e)
{
} //Invoked when a window is changed from a normal to a minimized state.
public void windowOpened(WindowEvent e)
{
}
});
bt.addActionListener(new MyActionListener());
bt1.addActionListener(new MyActionListener());
}
public static void main(String args[])
{
MyFrame1 mf=new MyFrame1("hello");
mf.setVisible(true);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -