简体   繁体   English

Jxbrowser没有出现

[英]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 我正在使用Java swing Editor创建一个框架,在其上放了一个tappedpane,然后放了4个面板,所以我有4个水龙头,我需要在其上查看浏览器的面板是jpanel3,所以我放了一个按钮,并在其中写入了以下代码我运行程序,然后按该按钮,我没有错误,只是没有视图正确导入了所有内容,并且许可证有效

enter code here

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { 私人空白jButton2ActionPerformed(java.awt.event.ActionEvent evt){
Browser browser = new 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 . 我想问题出在jPanel3默认FlowLayout中。 Please try the following solution: 请尝试以下解决方案:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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