e836. 设置JTabbedPane中卡片的提示语
There are two ways to set a tool tip on a tab. The first is to specify it when the tab is created; the second way is to set it using JTabbedPane.setToolTipTextAt()
.
// Create a tabbed pane JTabbedPane pane = new JTabbedPane(); // Add a tab with a tool tip String label = "Tab Label"; String tooltip = "Tool Tip Text"; pane.addTab(label, null, component, tooltip); // Get index of new tab int index = pane.getTabCount()-1; // Get current tool tip tooltip = pane.getToolTipTextAt(index); // Change tool tip tooltip = "New Tool Tip Text"; pane.setToolTipTextAt(index, tooltip);
Related Examples |
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步