工具提示在摆动 [英] Tooltip in swing

查看:78
本文介绍了工具提示在摆动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  _graph.setToolTipText(< html><< ; div style = \width:300px; height:100px;
+overflow:auto; border:0;< p style = \padding:2 5 2 5; \> < / div>请稍候...);

这里 _graph 是组件的对象。问题是,如果数据超过了,我需要滚动但不会发生。请向任何人建议我制作滚动条。

解决方案

默认的工具提示是非常基本的:只是一个类似标签的组件,甚至仅限于纯文本(html除外)。正如我已经提到的,更多花哨的工具提示的方式是扩展JTooltip让图组件返回createTooltip中的自定义工具提示。最近有一个示例和一些陷阱在OTN上讨论

I made to tool tip for comportment in swing using some html tags

_graph.setToolTipText("<html><div style=\"width: 300px; height: 100px;" 
   +  " overflow: auto; border: 0;<p style=\"padding:2 5 2 5;\"></div>Please Wait...");

Here _graph is object of component. Problem is, if data is exceeds I need to scroll but it is not happening.please anyone suggest me to make scrollbar.

解决方案

Default tooltips are very basic: simply a lable-like component, even limited to text-only (except html). As I already mentioned, the way to more fancy tooltips is to extend JTooltip and let your graph component return that custom tooltip in createTooltip. An example and some pitfalls were recently discussed over at OTN

这篇关于工具提示在摆动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆