?? myapplet.java
字號:
// written by : Christine Amarra
// December 15, 2004
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MyApplet extends JApplet
{
private DrawingCanvas canvas = null;
JButton button = null;
//initialize components here
public void init()
{
Container c = this.getContentPane();
button = new JButton("Click Me");
c.add(button, "North");
//The old way of doing action listeners on buttons...
//button.addActionListener(this);
//Don't forget to define actionPerformed();
//The new way of doing action listeners on buttons...
button.addActionListener( new ActionListener()
{
//anonymous inner class for WindowAdapter
public void actionPerformed( ActionEvent ae )
{
System.out.println("Clicked!");
}
});
//we'll be discussing more on this next year... :)
canvas = new DrawingCanvas();
c.add(canvas);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -