水平的滚动条没有了,现在也想把垂直的滚动条也去掉。搞了很久了一直没找到好的解决方法。
这是基于JWebBrowser 的swing小程序。import 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();
}
}
这是基于JWebBrowser 的swing小程序。import 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();
}
}
为什么我的图不显示呢? http://blog.csdn.net/JavaAlpha/archive/2010/05/31/5637035.aspx
为什么不尝试着添加
webBrowserPanel.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);来设置一下呢?
webBrowser.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
frame.getContentPane().add(new Mylegist(), BorderLayout.CENTER);