buttonhelp.java

来自「源码为科学出版社出版的英文<java设计模式>(影印版)所用的所有例」· Java 代码 · 共 26 行

JAVA
26
字号
import java.awt.*;
import javax.swing.*;

public class ButtonHelp extends HelpWindow {
   String message, title;
   int icon;
   JFrame frame;

   public ButtonHelp(JFrame f) {
      mesg = "Click on any button to activate it";
      title ="Button help";
      icon = JOptionPane.DEFAULT_OPTION ;
      frame = f;
   }
   public void sendToChain(Component c) {
      
      if (c instanceof JButton) 
            JOptionPane.showMessageDialog(frame, mesg, title, icon);
         else  
         {
            
            sendChain(c);
         }
   }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?