简体   繁体   中英

Jxbrowser doesn't show up

I'm using java swing editor created a frame dropped a tappedpane on it then dropped 4 panels, so I have 4 taps the panel that I need to view the browser on is jpanel3 so I dropped a button and wrote this code inside of it when I run the program and press that button I get no errors just no view imported everything correctly and the license is valid

enter code here

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
Browser browser = new Browser();

   BrowserView view = new BrowserView(browser);

   jPanel3.add(view);

   browser.loadURL("https://google.com");

}                                        

I suppose the issue is in default FlowLayout in jPanel3 . Please try the following solution:

jPanel3.setLayout(new BorderLayout());
jPanel3.add(view, BorderLayout.CENTER);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM