- Code: Select all
browser = jcef.getClient().createBrowser(startPageUrl, false, false);
browserUI = browser.getUIComponent();
JPanel browserPanel= new JPanel();
browserPanel.setLayout(new BorderLayout());
browserPanel.setPreferredSize(new Dimension(width, height));
browserPanel.add(browserUI);
this.add(browserPanel, JLayeredPane.DEFAULT_LAYER);//browser's layer set to DEFAULT here
JLabel button= new JLabel();
button.setBounds(20, 20, 100, 100);
button.setOpaque(true);
button.setBackground(Color.red);
this.add(button, JLayeredPane.MODAL_LAYER);//button's layer set to MODAL
but 'button' component put on behind 'browserPanel' component.
how to put 'button' on front of 'browserPanel' ?
maybe jalayeredpane not work correctly on jcef browser ?
if anyone know something , please give me advice.
thank you for reading.