我有这个问题:标签(JLabel)的工具提示被 BrowserView 隐藏。工具提示正确显示在任何其他 java 组件的顶部,但被 BrowserView 隐藏。我想要的是使工具提示在 BrowserView 顶部可见。任何人都知道它的原因以及使工具提示可见的方法。
生成的 UI 以及如何隐藏工具提示附在此处。
代码示例:
public class TestFrame
{
public static void main (String args[])
{
JSplitPane splitPane = new JSplitPane();
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
JPanel topPanel = new JPanel();
topPanel.setBorder(new LineBorder(Color.black));
topPanel.setSize(75, 75);
JLabel label = new JLabel("TestLabel");
label.setToolTipText("Test Tooltip 1");
topPanel.add(label);
splitPane.setLeftComponent(topPanel);
Browser browser = new Browser();
BrowserView browserView = new BrowserView(browser);
splitPane.setRightComponent(browserView);
browser.loadURL("http://www.google.com");
frame.add(splitPane);
frame.setSize(700, 500);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
}
结果 UI:右面板是一个 BrowserView,它隐藏了左面板标签的工具提示