ToolTip表示の切り替え

編集者:Terai Atsuhiro
作成日:2004-05-10
更新日:2021-10-16 (土) 00:37:47

概要

ツールチップ*1表示の有無をToolTipManagerで切り替えます。

http://terai.xrea.jp/swing/tooltipmanager/screenshot.png

サンプルコード

ActionListener al = new ActionListener() {
  public void actionPerformed(ActionEvent e) {
    JRadioButton radio = (JRadioButton) e.getSource();
    ToolTipManager.sharedInstance().setEnabled((radio==onRadio)?true:false);
  }
};
onRadio.addActionListener(al);
offRadio.addActionListener(al);

解説

ToolTipManagerは、ツールチップの表示時間、表示までの遅延時間などをアプリケーション全体で設定することができます。

コメント