首页 技术教程 实用代码 注册破解 正则表达式 网址导航 电子书籍

Java Swing中ToolTip控件的显示与隐藏代码

先给出两个控制方法 1、显示tooltip public static void postToolTip(JComponent comp) { Action action = comp.getActionMap().get("postTip"); if (action == null) // no tooltip return; ActionEvent ae = new ActionEvent(comp, ActionEvent.ACTION_PERFORMED, "postTip", EventQueue.getMostRecentEventTime(), 0); action.actionPerformed(ae); } 2、隐藏tooltip public static void hideToolTip(JComponent comp) { Action action = comp.getActionMap().get("hideTip"); if (action == null) // no tooltip return; ActionEvent ae = new ActionEvent(...
类别:程序开发 - JAVA    查看:94    更新:2014-05-14