- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
public class JavaApplication3 {
/**
* @param args the command line arguments
*/
public void initAndShowGUI() {
// This method is invoked on the EDT thread
JFrame frame = new JFrame("Swing and JavaFX");
final JFXPanel fxPanel = new JFXPanel();
frame.add(fxPanel);
frame.setSize(300, 200);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Platform.runLater(new Runnable() {
@Override
public void run() {
initFX(fxPanel);
}
});
}
private void initFX(JFXPanel fxPanel) {
// This method is invoked on the JavaFX thread
Scene scene = createScene();
fxPanel.setScene(scene);
}
private Scene createScene() {
Group root = new Group();
Scene scene = new Scene(root, Color.ALICEBLUE);
WebView browser;
browser = new WebView();
//browser.setContextMenuEnabled(false);
browser.autosize();
WebEngine webEngine = browser.getEngine();
String Qlink = "https://www.google.ca";
webEngine.load(Qlink);
root.getChildren().add(browser);
return (scene);
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
System.setProperty("http.proxyHost","10.10.6.61");
System.setProperty("http.proxyPort","6666");
System.setProperty("https.proxyHost","10.10.6.61");
System.setProperty("https.proxyPort","6666");
JavaApplication3 j = new JavaApplication3();
j.initAndShowGUI();
}
});
}
}
这是与oracle示例代码90%相同的程序。要么我刷新页面两次,要么等待一段时间,JVM 就会自行崩溃。我究竟做错了什么,才会出现这样的结果?请指出。它很容易复制。我使用的是java7u22,jfxrt是jre默认包含的。非常感谢您的帮助!
编辑:我将发布 IDE 上显示的错误,该错误很长。如果您要求,我还将提供核心转储日志文件。抱歉,我的语法可能会让您难以理解我的意思。
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000005c2728e3, pid=812, tid=5280
#
# JRE version: Java(TM) SE Runtime Environment (7.0_51-b13) (build 1.7.0_51-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.51-b03 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [glass.dll+0x128e3]
#
# Core dump written. Default location: C:\Users\robin.ASIGRA\Documents\NetBeansProjects\JavaApplication3\hs_err_pid812.mdmp
#
# An error report file with more information is saved as:
# C:\Users\robin.ASIGRA\Documents\NetBeansProjects\JavaApplication3\hs_err_pid812.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
2014年6月13日更新
我的操作系统是window server R2 2008,java版本是7我尝试将java版本更新到8,但问题仍然存在。此应用程序必须在java7环境中构建。我发现它是Windows Server R2 2008上java7的bug,并且有一个解决方案。
This issue occurs on Windows Server 2008 R2 SP1 and Java 7u45 (JavaFX 2.2.45). I've solved it enabling Desktop Experience feature (on the remote server, go to Administrative Tools --> Server Manager). Pay attention to the fact that this feature enables also Windows Defender service and Microsoft doc doesn't report it.
完成此操作后,问题就解决了。
最佳答案
更新
正如原始发布者在其问题更新中所指出的,此问题特定于在 Windows R2 2008 服务器上使用旧版本的 Java,该问题已在 Java 8 中作为 RT-23456 Java crashes on Windows 2008 R2 trying to run Java FX demo 'Ensemble' 的一部分得到解决。
为我工作
我在 Win 7、Java 8u20b11 上运行了您的应用程序(已注释掉代理设置),它对我有用。
您可以下载 Java 8 development release 来获取修复该问题的 Java 版本。如果您必须坚持使用 Java 7(不真正推荐),那么您可以应用问题更新中所述的解决方法。
关于JavaFX-JFXpanel 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24212042/
我在 swing 组件 (JPanel) 中运行 JFXPanel。我遇到的问题是有时,并非每次,应用程序在创建 JXFPanel 时挂起(卡住)。请参阅下面的代码。 public VideoPlay
我有一个包含两个组件的 JPanel。一个是 JFXPanel 和 JLabel,当我从单独窗口中的 JTree 拖动项目时,我收到 NPE 异常 Exception in thread "AWT-E
public class JavaApplication3 { /** * @param args the command line arguments */ public void initAn
我更新到 1.7.0_67-b01,现在看来我无法在我的 swing 应用程序中嵌入 JavaFX 面板。这是我得到的异常(exception)。有人知道解决方法吗? java.security.Ac
与向上滚动和向下滚动相关的事件有哪些?我想创建两个按钮作为顶部和向下,而不是使用上下滚动来上下移动 JFXpanel。我应该将哪些事件与这些按钮关联起来? 最佳答案 您想要使用 ScrollPane
您好,我对 JavaFx 有点陌生,我在 Oracle 网站上获得了源代码,我想在 JFXPanel 中添加一个图标。如何在 JFXPanel 中插入图标。图标应该处于位置。这是代码: publi
JFXPanels 允许您将 JavaFX 组件放入 Swing 应用程序中。除了保留我自己的 map 之外,还有其他方法可以获取对 JFXPanel 的引用吗?即 javafx.scene.Scen
我想在使用 JFXPanel 的 awt 应用程序之上显示一个 FileChooser 对话框。 作为 showOpenDialog 的窗口,我使用设置到该面板的场景的 getWindow()。但是文
我需要将 JFXPanel 呈现为 JPanel 中的组件。 我的应用程序仅适用于 JAVA1.6,我编写了代码以在 JPanel 中呈现 JFXPanel,我没有收到任何错误,但看不到任何可见输出。
我非常不知道如何将我的 JFXPanel(这是一个 mp3 播放器)集成到现有的 Swing 应用程序中 - 这是一个添加了几个不同 JPanel 的 JFrame。我对 JavaFX 完全是个菜鸟,
我正在尝试将 JFXPanel 添加到我的 JFrame 中。我正在使用 Netbeans 和 Netbeans 的 Swing GUI Builder。当我运行它时,我没有收到任何错误,并且 JFr
当前遇到的问题是我无法弹出/显示 JFrame 和关联的 JFXPanel。我已经查看了该网站上的许多其他示例以及其他使用 JFXPanel 和 JFrames 的示例,但所有示例都与我的完全不同。我
以下代码生成一个包含 JFXPanel 和 JPanel 的 JFrame。每个面板都包含一个文本字段。 JFXPanel fxPanel = new JFXPanel(); JPanel swing
我有一个现有的 Swing 应用程序,我正在向其中添加 JavaFX 组件。我想要我的嵌入式 JFXPanel能够使用 Stage 显示弹出对话框,为此 Stage与现有的 JFrame 模态化作为它
此问题是 Custom object drag-and-drop from FX to Swing 的后续问题 . 我正在为一个将 JavaFX 用于某些图形用户界面的 Swing 应用程序开发一个插
我正在使用 JavaFX 开发一个 swing 应用程序。我的要求是使用 JavaFX 面板在 Web View 中显示 html 文件。 现在我想在单击打印按钮时提供一个打印按钮,我想在打印机上发送
当从 Swing 应用程序中添加和删除 JavaFX 面板时,它就不能再添加了。执行下面的测试并多次按“添加/删除 FXPanel”按钮 - 由于某种原因它只工作一次。 public class Em
一旦我在 mac 中运行,swing 应用程序中的 jfxpanel 就会崩溃。它在windows下运行正常,但在mac下出现以下错误,看起来与字体有关,但不确定为什么,请帮助 Exception i
我想在 JFrame 容器上添加和删除 JFXPanel,但无法做到这一点。我被困在这里,在单击按钮时没有得到正确的解决方案我想添加和删除 JFXPanel 控件。 这段代码有什么问题? publ
我正在尝试将视频嵌入 JDialog 框中。最终我需要嵌入三个单独的视频,因此我以定义我自己的 JFXPanel 实现以供重用的方式实现了该功能。我能够运行该应用程序,当我调试它时,createSce
我是一名优秀的程序员,十分优秀!