我正在netbeans中开发JavaFx应用程序,在netbeans中该项目正在构建并运行良好。
public class JavaFXApplication extends Application {
public static final String TOOLBAR_MAIN = "toolbarMain";
public static final String TOOLBAR_MAIN_FXML = "/fxml/ToolbarMain.fxml";
public static final String TOOLBAR_SUB = "toolbarSub";
public static final String TOOLBAR_SUB_FXML = "/fxml/ToolbarSub.fxml";
public static final String NEW_SESSION_PANEL = "newSession";
public static final String NEW_SESSION_PANEL_FXML = "/fxml/NewSessionPanel.fxml";
public static final String OPEN_SESSION_PANEL = "openSession";
public static final String OPEN_SESSION_PANEL_FXML = "/fxml/OpenSessionPanel.fxml";
public static final String CONNECTIONS_PANEL = "connections";
public static final String CONNECTIONS_PANEL_FXML = "/fxml/ConnectionsPanel.fxml";
public static final String LOGS_PANEL = "logs";
public static final String LOGS_PANEL_FXML = "/fxml/LogsPanel.fxml";
public static final String EXCEPTIONS_PANEL = "exceptions";
public static final String EXCEPTIONS_PANEL_FXML = "/fxml/ExceptionsPanel.fxml";
public static final String MESSAGES_PANEL = "messages";
public static final String MESSAGES_PANEL_FXML = "/fxml/MessagesPanel.fxml";
public static ScreensController menuContainer = new ScreensController();
public static ScreensController contentContainer = new ScreensController();
public static ServerService server = new ServerService();
public static Stage STAGE;
@Override
public void start(Stage primaryStage) throws Exception {
STAGE = primaryStage;
primaryStage.setOnCloseRequest((WindowEvent t) -> {
if (server.isRunning()) {
server.cancel();
}
});
menuContainer.loadScreen(JavaFXApplication.TOOLBAR_MAIN,
JavaFXApplication.TOOLBAR_MAIN_FXML);
menuContainer.loadScreen(JavaFXApplication.TOOLBAR_SUB,
JavaFXApplication.TOOLBAR_SUB_FXML);
contentContainer.loadScreen(JavaFXApplication.NEW_SESSION_PANEL,
JavaFXApplication.NEW_SESSION_PANEL_FXML);
contentContainer.loadScreen(JavaFXApplication.OPEN_SESSION_PANEL,
JavaFXApplication.OPEN_SESSION_PANEL_FXML);
contentContainer.loadScreen(JavaFXApplication.NEW_SESSION_PANEL,
JavaFXApplication.NEW_SESSION_PANEL_FXML);
contentContainer.loadScreen(JavaFXApplication.CONNECTIONS_PANEL,
JavaFXApplication.CONNECTIONS_PANEL_FXML);
contentContainer.loadScreen(JavaFXApplication.LOGS_PANEL,
JavaFXApplication.LOGS_PANEL_FXML);
contentContainer.loadScreen(JavaFXApplication.EXCEPTIONS_PANEL,
JavaFXApplication.EXCEPTIONS_PANEL_FXML);
contentContainer.loadScreen(JavaFXApplication.MESSAGES_PANEL,
JavaFXApplication.MESSAGES_PANEL_FXML);
menuContainer.setScreen(JavaFXApplication.TOOLBAR_MAIN);
contentContainer.setScreen(JavaFXApplication.NEW_SESSION_PANEL);
SplitPane root = new SplitPane();
root.getItems().addAll(menuContainer, contentContainer);
Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.show();
primaryStage.setResizable(false);
primaryStage.setTitle("Exam Supervisor");
}
加载屏幕的屏幕控制器:
public class ScreensController extends StackPane {
private HashMap<String, Node> screens = new HashMap<>();
public void addScreen(String name, Node screen) {
screens.put(name, screen);
}
public boolean loadScreen(String name, String resource) {
try {
FXMLLoader myLoader = new FXMLLoader(getClass().getResource(resource));
System.out.println("name:" + name + " ,resource" + resource + " ,loader:" + myLoader.getLocation());
Parent loadScreen = myLoader.load();
ControlledScreen myScreenControler
= myLoader.getController();
myScreenControler.setScreenParent(this);
addScreen(name, loadScreen);
return true;
} catch (Exception e) {
System.out.println("name: " + name + ", resource" + resource + " ,exception: " + e.getMessage());
return false;
}
}
public boolean setScreen(final String name) {
if (screens.get(name) != null) {
final DoubleProperty opacity = opacityProperty();
if (!getChildren().isEmpty()) {
getChildren().remove(0);
getChildren().add(0, screens.get(name));
} else {
getChildren().add(screens.get(name));
}
return true;
} else {
System.out.println(screens.get(name) + " ,screen hasn't been loaded!\n");
return false;
}
}
public boolean unloadScreen(String name) {
if (screens.remove(name) == null) {
System.out.println("Screen didn't exist");
return false;
} else {
return true;
}
}
}
我的github回购:https://github.com/eszikk/examsupervisorserver
在做了以下更改之后,我已经成功地从Netbeans外部运行了您的应用程序。
首先,我想知道为什么你有编译器插件。因此,我删除了它,并在构建过程中出现了“class file for sun.util.logging.PlatformLogger not found”错误。
您遇到了javafx8-sun.util.logging.PlatformLogger not found Exception in NetBeans 8中所解释的问题
你得把它修好。
其次,您所拥有的只是编译阶段,而不是一个可运行的JAR。
使用编译器插件(或者通过在类路径中使用其他依赖jar)可能有办法做到这一点,但我发现使用汇编插件创建一个包含所有依赖项的jar更容易。
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.eszik.supervisorserver.main.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
接下来,分别运行两个mvn命令。
mvn clean install
mvn assembly:single
然后是java-jar target/supervisorserver-1.0-snapshot-jar-with-dependencies.jar
无法在WebView中加载以下网页 https://6awlanow.com/about/faqs 到目前为止,我一直在努力- 我已经提供了互联网许可。除了在WebView上,URL在任何地方都可以正常加载。我得到以下错误- 在我的控制台上获取以下信息-
问题内容: 我的问题很简单,如何使用jquery ajax comand检索某些div 喜欢带负载 问题答案: 如果div是AJAX响应的一部分:
首先,我使用Windows 7 64位,WAMP 32位和火鸟32位。 我试图使用PHP与火鸟或interbase,所以我取消注释以下行从我的php.ini文件: 然后,当我启动WAMP时,会出现以下错误: 我已经尝试过的: 有人知道我该怎么解决这个问题吗?谢谢
问题内容: 我正在尝试使用JavaFX的WebView加载此站点,但我得到的只是一个空白屏幕。WebView在其他站点上运行良好。它在ACID3上获得100/100并加载其他HTTPS站点,没有任何问题。 我也找不到该网站的任何特别错误。它具有由适当的CA签名的适当的,未过期的证书,并且SSL Labs报告为B级。我尝试了所有主要的浏览器,但没有一个报告任何与证书或SSL相关的问题;该网站对所有这
我试图用Javaflow(http://commons.apache.org/sandbox/commons-javaflow/)和OW2 ASM库(http://ASM.OW2.org/)来测试java类。我设置了javaagent并使用instrumentation.addTransformer()在加载时将我的transformer注册到instrument类。在transformer内部,
图像加载: 链接1:https://freshtocook.in/uploads/banner/47a16ffc2fc5935dccd37574083c6201.jpg 链接2:https://freshtocook.in/uploads/banner/7eecf823e008a0bb93f347d994b6e534.jpg