水平的滚动条没有了,现在也想把垂直的滚动条也去掉。搞了很久了一直没找到好的解决方法。 这是基于JWebBrowser 的swing小程序。 Java codeimport java.awt.BorderLayout; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.ScrollPaneConstants; import javax.swing.SwingUtilities; import chrriis.common.UIUtils; import chrriis.dj.nativeswing.swtimpl.NativeInterface; import chrriis.dj.nativeswing.swtimpl.components.JWebBrowser; public class Mylegist extends JPanel { private static final long serialVersionUID = 1L; public Mylegist() { super(new BorderLayout()); JScrollPane webBrowserPanel = new JScrollPane(); webBrowserPanel.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); final JWebBrowser webBrowser = new JWebBrowser(); webBrowser.setBarsVisible(false); webBrowser.navigate("http://localhost:8080/lawgeneral/index.html"); add(webBrowser, BorderLayout.CENTER); } public static void main(String[] args) { UIUtils.setPreferredLookAndFeel(); NativeInterface.open(); SwingUtilities.invokeLater(new Runnable() { public void run() { JFrame frame = new JFrame("法务通"); frame.setUndecorated(true);// 禁用此窗体的装饰 frame.setLocationRelativeTo(null);//居中显示 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(new Mylegist(), BorderLayout.CENTER); frame.setSize(938, 614); frame.setLocationByPlatform(true); frame.setVisible(true); } }); NativeInterface.runEventPump(); } }