我有报告reports\templates\Contractor_Bill.jrxml
和结果 reports\results\
.它在Netbeans 6.5中工作正常,但是当我将dist
包含exec jar文件的文件夹复制到一个新位置并运行jar时,它会抛出此异常.
我还在新的地方创建了报告文件夹,它仍然生成相同的异常.
Aug 5, 2009 10:11:58 PM cbs.ui.ReportUI GenerateReport
SEVERE: null
net.sf.jasperreports.engine.JRException: Error compiling report java source files : C:\Documents and Settings\Mohanish Timble\Desktop\sw\Contractor_Bill_old_1249490518017_973633.java
at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:93)
at net.sf.jasperreports.engine.design.JRAbstractClassCompiler.compileUnits(JRAbstractClassCompiler.java:67)
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:190)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:220)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:153)
at cbs.ui.ReportUI.GenerateReport(ReportUI.java:202)
at cbs.ui.ReportUI.btnGenerateBillActionPerformed(ReportUI.java:151)
at cbs.ui.ReportUI.access$100(ReportUI.java:38)
at cbs.ui.ReportUI$2.actionPerformed(ReportUI.java:85)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at …
Run Code Online (Sandbox Code Playgroud) 我想创建一个带有箭头,圆角的Google Chrome收藏夹式popover,如果我有时间阴影效果的话.在Java Swing中.什么是最好的方法?SplashScreen?或者只是一个简单的AWT窗口?其他想法?谢谢!
有人可以帮忙编写一些在 JavaFx 中创建图像缩略图的代码吗?
我对此很陌生,因此将不胜感激逐步的解释。
我想TreeMaker
在我的 netbeans 代码生成器插件中使用类型参数生成构造函数调用。此外,我想导入类型而不是使用完全限定的名称(请参阅 参考资料QualIdent
)。
我正在为此目的使用该NewClass
方法。
给定输入java.util.ArrayList
和java.lang.Integer
生成的代码应该类似于:
import java.util.ArrayList;
...
new ArrayList<Integer>();
Run Code Online (Sandbox Code Playgroud)
如果输入是java.util.ArrayList
,java.util.List<java.lang.Integer>
并且生成的代码应该类似于:
import java.util.ArrayList;
import java.util.List;
...
new ArrayList<List<Integer>>();
Run Code Online (Sandbox Code Playgroud)
(类型参数列表存储为List<? extends TypeMirror>
)
如何生成所需的输出?
(maker
是TreeMaker
实例)
将类型名称转换为字符串:
String className = "java.util.ArrayList<java.util.List<java.lang.Integer>>"; // actually computed in real code
maker.NewClass(null,
Collections.<ExpressionTree>emptyList(),
maker.QualIdent(className),
Collections.<ExpressionTree>emptyList(),
null);
Run Code Online (Sandbox Code Playgroud)
这会产生语法/语义正确的 java 代码,但使用完全限定的类名,即 new java.util.ArrayList<java.util.List<java.lang.Integer>>()
通过typeArguments
至NewClass
:
List<ExpressionTree> typeArguments = Collections.singletonList(maker.QualIdent("java.lang.Integer")); // actually computed …
Run Code Online (Sandbox Code Playgroud)我的程序有一个主要的 FXML 文档,其中包含TabPane
. 对于每个选项卡,我希望它有自己的控制器和 fxml 文件。当我尝试将外部 fmxl 文件包含到主 fxml 文档中时,我的程序拒绝运行。这是我的主要 FXML 文档:这是我的 java 文件的副本
@Override
public void start(Stage stage) throws Exception {
FXMLLoader fxml = new FXMLLoader();
Parent root = fxml.load(getClass().getResource("FXMLDocument.fxml").openStream());
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
FXMLDocumentController fdc = fxml.getController();
}
Run Code Online (Sandbox Code Playgroud)
错误:
Caused by: javafx.fxml.LoadException: Base location is undefined. unknown path:97
Run Code Online (Sandbox Code Playgroud) ComboBox
我正在尝试重置如下的选择:
// private ListView<MyEntityType> f_lItems
f_lItems.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Object>() {
@Override
public void changed(ObservableValue<?> ov, Object t, Object t1) {
if (t1 != null && t1 instanceof MyEntityType) {
MyEntityType pv = (MyEntityType) t1;
// do some condition testing
if (condition) {
// accept
} else
// roll back to previous item
f_lItems.getSelectionModel().select((MyEntityType) t);
}
}
}
});
Run Code Online (Sandbox Code Playgroud)
因此,在尝试将列表重置为旧值后,我收到此异常:
Exception in thread "JavaFX Application Thread" java.lang.IndexOutOfBoundsException
at com.sun.javafx.scene.control.ReadOnlyUnbackedObservableList.subList(Unknown Source)
at javafx.collections.ListChangeListener$Change.getAddedSubList(Unknown Source)
at com.sun.javafx.scene.control.behavior.ListViewBehavior.lambda$new$177(Unknown Source)
at javafx.collections.WeakListChangeListener.onChanged(Unknown Source)
at com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(Unknown Source) …
Run Code Online (Sandbox Code Playgroud) 我需要一个正则表达式来验证像"foo.com"
. 包含点的单词。我已经尝试了几个,但无法正常工作。
我尝试过的模式:
(\\w+\\.)
(\\w+.)
(\\w.)
(\\W+\\.)
有人可以帮我一个这个。
谢谢,
以前我正在研究 Java Swing,现在我正在尝试使用 JavaFX。我上次的 Java Swing 代码:
//These line of code is to call method that declared in ContentPage.java
contentPage.adminFeatureEnabled(adminEnabled);
contentPage.managerFeatureEnabled(managerEnabled);
Run Code Online (Sandbox Code Playgroud)
并在我的 ContentPage.java
//By default, all feature (or tab) are enabled.
//This method is to remove register account if the user login into the system is manager and staff
public void adminFeatureEnabled(boolean a) {
if (!a) {
tabPane.removeTabAt(tabPane.indexOfComponent(registerAccount));
}
}
//This method is to remove register account and purchase order if the user who log into the system is staff …
Run Code Online (Sandbox Code Playgroud) 已经三天了,我在网上查找如何在 gradle 上解决这个问题
Caused by: java.lang.IllegalAccessError: class com.jfoenix.skins.JFXTabPaneSkin (in module com.jfoenix) cannot access class com.sun.javafx.scene.control.behavior.TabPaneBehavior (in module javafx.controls) because module javafx.controls does not export com.sun.javafx.scene.control.behavior to module com.jfoenix
Run Code Online (Sandbox Code Playgroud)
在简单的想法项目中我添加了
--add-exports javafx.controls/com.sun.javafx.scene.control.behavior=com.jfoenix --add-exports javafx.controls/com.sun.javafx.scene.control=com.jfoenix --add-exports javafx.base/com.sun.javafx.binding=com.jfoenix --add-exports javafx.graphics/com.sun.javafx.stage=com.jfoenix --add-exports javafx.base/com.sun.javafx.event=com.jfoenix
Run Code Online (Sandbox Code Playgroud)
我知道,我必须添加 jvm 选项,但我该怎么做?
我在 intellij idea 上使用 gradle javafx 11.0.2,java 11,
这是build.gradle
plugins {
id 'java'
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.8'
}
compileJava.options.encoding = 'UTF-8'
repositories {
mavenCentral()
}
dependencies {
// https://mvnrepository.com/artifact/com.jfoenix/jfoenix
compile group: 'com.jfoenix', name: 'jfoenix', version: '9.0.9' …
Run Code Online (Sandbox Code Playgroud) 以下代码可以使用 gcc 和 clang 进行编译,但不能使用 msvc。对于 msvc,使用字符串文字初始化 char 数组成员变量似乎会导致根据编译器隐式生成的默认构造函数不是 constexpr:
struct S
{
#if 1
char str[2] = "1";
#else
char str[2] { 'a', '\0'};
#endif
};
int main()
{
constexpr S s; // line 12: compiler error in msvc
constexpr S s2{};
}
Run Code Online (Sandbox Code Playgroud)
MSVC输出
example.cpp
<source>(12): error C2131: expression did not evaluate to a constant
<source>(12): note: failure was caused by call of undefined function or one not declared 'constexpr'
<source>(12): note: see usage of 'S::S'
Compiler returned: 2 …
Run Code Online (Sandbox Code Playgroud)