- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
<分区>
好的,为了启动 javafx 应用程序,我们需要启动 javafx 应用程序。然后,如果我们想添加一个新窗口,我们可以简单地执行 stageobj.show();对吧?
下面是我的代码的一部分,我尝试创建新窗口。我已经启动了我的应用程序并想从我的应用程序中调用这个新代码。
//imports all needed class
public String plugstart(){
try{Application.launch();
net.time4j.ui.javafx.CalendarPicker obj=net.time4j.ui.javafx.CalendarPicker.gregorianWithSystemDefaults();
javafx.scene.Scene scn=new javafx.scene.Scene(obj, 300, 250);
Stage stage = new Stage();
stage.setTitle("Date pick test");//scn.getChildren().add(obj);
stage.setScene(scn);
stage.show();
return "ok";}catch(Exception e){java.io.StringWriter sw = new java.io.StringWriter();
java.io.PrintWriter pw =new java.io.PrintWriter(sw);
e.printStackTrace(pw);return sw.toString();}
}
// not sure if this function is useful or not
@Override
public void start(Stage stage) {
try{Application.launch();
net.time4j.ui.javafx.CalendarPicker obj=net.time4j.ui.javafx.CalendarPicker.gregorianWithSystemDefaults();
javafx.scene.Scene scn=new javafx.scene.Scene(obj, 300, 250);
stage.setTitle("Date pick test");//scn.getChildren().add(obj);
stage.setScene(scn);
stage.show();
}catch(Exception e){}
}
证明它编译完美。
:\Coding\JavaSourceCode\plugin\userareaplugin\otherpartylibderived\time4jtest>javac -cp ;D:\Coding\JavaSourceCode\plugin\userareaplugin\otherpartylibderived\time4jtest\*;D:\Coding\JavaSourceCode\plugin\userareaplugin\otherpartylibderived\time4jtest *.java
D:\Coding\JavaSourceCode\plugin\userareaplugin\otherpartylibderived\time4jtest>
好的,有什么问题吗?它应该可以正常工作吗?遗憾的是没有。下面的图片是堆栈跟踪。 show class not found
谁有类似的经验或解决方案?
edit1,好的,所以有人问了 java 版本,我无法评论。
D:\Coding\JavaSourceCode\plugin\userareaplugin\otherpartylibderived\time4jtest>java-version openjdk version "15" 2020-09-15 OpenJDK Runtime Environment (build 15+36-1562) OpenJDK 64-Bit Server VM (build 15+36-1562, mixedmode, sharing)
jvm 提示 Testdategui.class是的,这是我应该有这个新阶段的类(class)。注意它实际上已经执行了第 7 行,但仍然提示找不到类。@@
非常感谢
编辑2,基于亲爱的 jetspiking 建议。1,我试图确保没有两次启动应用程序。删除了启动废话。2,确保它实际上是使用javafx线程和javafx.application.Platform.runLater
Walah,猜猜发生了什么?它实际上返回了“ok”。但是,ui 不在那里。(呜咽)
新功能状态>
public String plugstart(){
try{
javafx.application.Platform.runLater(new Runnable(){public void run(){
net.time4j.ui.javafx.CalendarPicker obj=net.time4j.ui.javafx.CalendarPicker.gregorianWithSystemDefaults();
javafx.scene.Scene scn=new javafx.scene.Scene(obj, 300, 250);
Stage stage = new Stage();
stage.setTitle("Date pick test");//scn.getChildren().add(obj);
stage.setScene(scn);
stage.show();
}});
return "ok";}catch(Exception e){java.io.StringWriter sw = new java.io.StringWriter();
java.io.PrintWriter pw =new java.io.PrintWriter(sw);
e.printStackTrace(pw);return sw.toString();}
}
好的,我尝试了解决方案并对其进行了调整。我认为它应该可以工作,但是我有 classnotfound 异常。
我认为这是我自己的类路径设置问题,不是答案问题,所以我会接受答案。
对于那些好奇的人,现在我有这个新错误。如果我使用“全新类”。
:\Coding\JavaSourceCode\plugin\userareaplugin\otherpartylibderived\time4jtest\test3basedonSO_menoguide>java -cp %newcp%--module-path %newcp% --add-modules=all-modules Testdategui
Error: Could not find or load main class ;D:\Coding\JavaSourceCode\plugin\userareaplugin\otherpartylibderived\time4jtest\test3basedonSO_menoguide\*;D:\Coding\JavaSourceCode\plugin\userareaplugin\otherpartylibderived\time4jtest\test3basedonSO_menoguide
Caused by: java.lang.ClassNotFoundException: ;D:\Coding\JavaSourceCode\plugin\userareaplugin\otherpartylibderived\time4jtest\test3basedonSO_menoguide\*;D:\Coding\JavaSourceCode\plugin\userareaplugin\otherpartylibderived\time4jtest\test3basedonSO_menoguide
D:\Coding\JavaSourceCode\plugin\userareaplugin\otherpartylibderived\time4jtest\test3basedonSO_menoguide>
reference src,应该可以吗?但是我这边有问题
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.application.Application;
public class Testdategui extends Application
{
@Override
public void start(Stage primaryStage) throws Exception {
// Launch all your JavaFX code and methods from inside this Entry Point function.
Stage stage = new Stage();
Scene scene = new Scene(net.time4j.ui.javafx.CalendarPicker.gregorianWithSystemDefaults());
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
编辑 4,抱歉,模块路径中没有空格,但出现新错误。我会尝试自己搜索答案
java -cp %newcp% --module-path %newcp% --add-modules=all-modules TestdateguiError occurred during initialization of boot layerjava.nio.file.InvalidPathException: Illegal char <*> at index 104: D:\Coding\JavaSourceCode\plugin\userareaplugin\otherpartylibderived\time4jtest\test3basedonSO_menoguide*
最后的编辑,worked.java -cp %newcp% --module-path %cd% --add-modules ALL-MODULE-PATH Demo
谢谢。
我将从 ColdFusion 8 迁移到 ColdFusion 10。 目前,在我的Unix根目录下,我只有1个Application.cfm,在这个根目录下我有大约10个子目录(以前的程序员就是这样
这个问题在这里已经有了答案: Is it possible to write a program in Java without main() using JDK 1.7 or higher? [d
我是编写 Windows 服务应用程序的新手,并且遇到了问题。 我用 Delphi 编写了一个普通的 Windows 应用程序来检查和调试代码的主要部分,现在必须将其转换为 NT 服务。 我的代码必须
我在 Visual Studio 2013 中运行它。 对于 Application.Current.Shutdown 我得到: “Application”是“System.Windows.Appli
给定以下 C++ 代码“mini.cpp”: #include "iostream" using namespace std; int main() { cout << "Hello Worl
什么是“服务器应用程序”?我被要求写一篇关于“服务器应用程序”中的错误的文章,但我不熟悉确切的术语。它们只是网络应用程序,还是其他东西? 最佳答案 “服务器应用程序”是一种应用程序,它等待来自其他应用
JavaFX 应用程序类必须扩展 javafx.application.Application package automationFramework import java.util.concurr
I have implemented deeplinking in my application that open my app (if available) but my app opens
我被困在一个非常基本的问题上。我使用 JavaFX 创建了一个简单的 hello world 程序,它在 JDK 1.8 上运行良好。但是当我切换到 JDK-11 时,它会抛出以下异常: Error:
我可以让Application Insights显示正在运行的每小时使用情况日志,但是有没有一种方法可以每小时显示一次平均使用情况,以查看必须在一天中的哪个时段使用网站? 最佳答案 在您的资源的概览
有谁知道为什么在.NET应用程序中实现Application Insights时不会收集用户代理信息,却能够在浏览器中收集统计信息? 我很希望能够针对特定的用户代理字符串过滤出请求,但是看起来我无法看
我有多个应用程序使用 Application Insights for Production Data。我正在尝试使用 City 遥测字段来映射我们当前的用户。这些数据的跟踪似乎非常不一致,并且在大多
有没有办法在 ASP.NET Web 应用程序中禁用 Application Insights?假设我想关闭生产中运行的应用程序中的所有数据收集。 最佳答案 如果 ikey 在 Application
如何在 Azure Application Insights 中将时差转换为毫秒 let startTime = todatetime('2017-05-15T17:02:23.7148691Z');
我正在修改一个用 Coldfusion 编码的现有 Web 应用程序。在现有代码中,大部分文件夹包含一个 Application.cfm 文件,该文件设置应用程序变量 但是,我对这些应用程序的部分修改
我在 Application Insights Analytics 中有一些数据,它有一个动态对象作为自定义维度的属性。例如: | timestamp | name
首先,我需要的是-n WebBrowser-s,每个都在自己的窗口中执行自己的工作。用户应该能够看到所有这些内容,或者仅看到其中一个(或不显示任何内容),并且能够对每一个执行命令。有一个主要形式,没有
我已收到以下代码以添加到封闭代码(受密码保护)中,以便可以发现错误。 On Error Resume Next: Err.Clear Application.SetOption "Error Trap
我正在使用 Delphi 7。我试图在非 VCL 单元中添加一个调用“application.processmessages”的过程。我收到错误“未声明的标识符:应用程序”。 如何从非 vcl 单元引
考虑一个非外汇现有应用程序,我们将其称为Business。 Business 公开一个 Model 对象,该对象又公开一些属性。 Model 还接受这些属性的监听器。 我的问题是关于向此类应用程序添加
我是一名优秀的程序员,十分优秀!