简体   繁体   English

Netbeans / JavaFX应用程序子类丢失

[英]Netbeans/JavaFX Application Subclass Missing

When I create a new JavaFX application in Netbeans 7.3 (and choose "Create Application Class") no such class is created. 当我在Netbeans 7.3中创建新的JavaFX应用程序(并选择“创建应用程序类”)时,不会创建此类。 Not even the package for it -- just an empty default package. 甚至没有用于它的软件包-只是一个空的默认软件包。

I assume that I could just create it manually by extending the 'Application' class but maybe this behaviour is symptomatic of some setup anomaly. 我假设我可以通过扩展'Application'类手动创建它,但是这种现象可能是某些安装异常的征兆。

Any idea why this happens? 知道为什么会这样吗? Btw, I had the same issue with Netbeans 7.1. 顺便说一句,我在Netbeans 7.1中遇到了同样的问题。

Cheers! 干杯!

I cannot replicate your issue. 我无法复制您的问题。

This works for me. 这对我有用。 In NetBeans 7.3: 在NetBeans 7.3中:

  1. Create a new JavaFX Project: 创建一个新的JavaFX Project:

    File | New Project | JavaFX | JavaFX Application File | New Project | JavaFX | JavaFX Application (click Next ) File | New Project | JavaFX | JavaFX Application (单击Next

  2. Enter the project name, for example TestProject (click `Finish): 输入项目名称,例如TestProject (单击“完成”):

    The screen has a checked checkbox Create application class . 屏幕上具有选中的Create application class复选框。 The default application class name will be testproject.TestProject You can edit the default application class name to change it and the package it is located in if you like. 默认的应用程序类名称为testproject.TestProject如果testproject.TestProject您可以编辑默认的应用程序类名称以更改它及其所在的包。

  3. A skeleton Application class is created: 创建框架Application类:

    The TestProject class extends Application and resides in the testproject package. TestProject类扩展了Application并驻留在testproject包中。


To create more applications in the same project: 要在同一项目中创建更多应用程序:

  1. Right click on the Project, choose: 右键单击项目,选择:

    New | 新增| Other | 其他| JavaFX | JavaFX | JavaFX Main Class (click Next ). JavaFX Main Class(单击Next )。

  2. Enter a class name, for example NewFXMain 输入一个类名,例如NewFXMain

  3. From the package drop down choose a project package, for example testproject (click Finish ). 从包下拉列表中选择一个项目包,例如testproject (单击Finish )。

  4. Another skeleton Application class is created: 创建另一个框架Application类:

    The NewFXMain class extends Application and resides in the testproject package. NewFXMain类扩展了Application并驻留在testproject包中。

newjavafx类

The issue is resolved. 问题已解决。 Apparently, something must have messed up the environment when I installed the 7.3 and imported my previous 7.1 projects because many useful libraries were also missing. 显然,当我安装7.3并导入以前的7.1项目时,一定是搞砸了环境,因为还缺少许多有用的库。 I reinstalled the 7.3 without bothering with importing anything from the previous version, and now everything works like a charm. 我重新安装了7.3,而不必从以前的版本中导入任何内容,现在一切都变得很吸引人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM