1

JxBrowser 6.2在 Windows 上使用。我尝试在浏览器视图上方添加一个摆动组件(下拉菜单)。

即使在 modal_layer 中添加这个组件,该组件也会出现在浏览器下。

我使用这段代码:

            JButton btn = new JButton("Hello");
            btn.setBackground(Color.RED);
            btn.setBounds(0, 0, 500, 300);
            frame.getLayeredPane().add(btn, JLayeredPane.MODAL_LAYER, 0);
4

1 回答 1

0

请尝试使用以下方法:

JPopupMenu.setDefaultLightWeightPopupEnabled(false);

Browser browser = new Browser();
BrowserView view = new BrowserView(browser);

您可以在https://jxbrowser.support.teamdev.com/support/solutions/articles/9000013078-jmenubar找到有关此方法的更多详细信息

于 2016-03-11T12:54:45.107 回答