📄 ch8_e8_17.java
字号:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ch8_e8_17 extends JApplet implements ActionListener
{
JButton myButton = new JButton(new ImageIcon("normal.gif"));
public void init()
{
myButton.setPressedIcon(new ImageIcon("pressed.gif"));
myButton.setRolloverIcon(new ImageIcon("rollover.gif"));
myButton.setRolloverEnabled(true);
myButton.setToolTipText("change");
getContentPane().add("North",myButton);
myButton.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource() == myButton)
{
showStatus("单击按钮!");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -