我有一个 Starter 类,它运行我的应用程序:
public class Starter {
public static Panel createContent() {
Panel contentPane = new Panel();
final JWebBrowser webBrowser = new JWebBrowser();
webBrowser.navigate("http://orientalcraft.org/");
webBrowser.setBarsVisible(false);
webBrowser.setStatusBarVisible(false);
contentPane.add(webBrowser);
return contentPane;
}
public static void main(String[] args) throws IOException, Exception
{
Frame.go();
NativeInterface.open();
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
Frame frame = Frame.mainFrame; //mainFrame - instance of Frame
frame.getContentPane().add(createContent(), BorderLayout.CENTER);
}
});
NativeInterface.runEventPump();
}
}
当我尝试添加jBrowser
到 .时Frame
,我什么jBrowser
也看不到 .. 但我可以在控制台中看到:
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:196) at java.net.SocketInputStream.read(SocketInputStream.java:196)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2293)
at java.io.ObjectInputStream$BlockDataInputStream.peek(ObjectInputStream.java:2586)
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2596)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1318)
at java.io.ObjectInputStream.readUnshared(ObjectInputStream.java:460)
at chrriis.dj.nativeswing.swtimpl.core.OutProcessSocketsMessagingInterface.readMessageFromChannel(OutProcessSocketsMessagingInterface.java:116)
at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface$2.run(MessagingInterface.java:392)
请帮我添加一个jBrowser
到现有的jFrame
..