- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 javafx FileChooser 打开一个 fileChooser 我正在通过 Controller 为 FXML 按钮分配一个监听器,应用程序加载正常,但是当我单击该按钮时,文件选择器打开后立即崩溃。
这让我抓狂,我认为这与从 java 实现 xcode 接口(interface)有关,但我完全迷失在这一点上。
在使用 JavaFx 之前是否遇到过这个问题??
我的堆栈跟踪是:
012-12-06 23:24:02.732 java[16800:707] Invalid parameter not satisfying: cgsEvent.type > 0 && cgsEvent.type <= kCGSLastEventType
2012-12-06 23:24:02.733 java[16800:707] (
0 CoreFoundation 0x00007fff8b8c20a6 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff858393f0 objc_exception_throw + 43
2 CoreFoundation 0x00007fff8b8c1ee8 +[NSException raise:format:arguments:] + 104
3 Foundation 0x00007fff89f926a2 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 189
4 AppKit 0x00007fff85d5356c -[NSEvent _initWithCGSEvent:eventRef:] + 2782
5 AppKit 0x00007fff85fd43ea +[NSEvent eventWithCGEvent:] + 243
6 libglass.dylib 0x00000001630e300f listenTouchEvents + 31
7 CoreGraphics 0x00007fff8be07115 processEventTapData + 150
8 CoreGraphics 0x00007fff8be06f68 _CGYPostEventTapData + 189
9 CoreGraphics 0x00007fff8be0c26a _XPostEventTapData + 107
10 CoreGraphics 0x00007fff8be0c362 CGYEventTap_server + 106
11 CoreGraphics 0x00007fff8be07056 eventTapMessageHandler + 30
12 CoreFoundation 0x00007fff8b831410 __CFMachPortPerform + 288
13 CoreFoundation 0x00007fff8b8312d9 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
14 CoreFoundation 0x00007fff8b831019 __CFRunLoopDoSource1 + 153
15 CoreFoundation 0x00007fff8b86419f __CFRunLoopRun + 1775
16 CoreFoundation 0x00007fff8b8636b2 CFRunLoopRunSpecific + 290
17 HIToolbox 0x00007fff882d40a4 RunCurrentEventLoopInMode + 209
18 HIToolbox 0x00007fff882d3d84 ReceiveNextEventCommon + 166
19 HIToolbox 0x00007fff882d3cd3 BlockUntilNextEventMatchingListInMode + 62
20 AppKit 0x00007fff85c74613 _DPSNextEvent + 685
21 AppKit 0x00007fff85c73ed2 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
22 libglass.dylib 0x00000001630ce8c3 +[GlassApplication enterNestedEventLoopWithEnv:] + 163
23 libglass.dylib 0x00000001630d24d3 -[DialogDispatcher runModal] + 163
24 Foundation 0x00007fff8a012220 -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] + 212
25 Foundation 0x00007fff8a0120c8 -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] + 131
26 libglass.dylib 0x00000001630d29c5 Java_com_sun_glass_ui_mac_MacCommonDialogs__1showFileOpenChooser + 981
27 ??? 0x0000000101dc3f90 0x0 + 4326178704
)
2012-12-06 23:24:02.734 java[16800:707] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: cgsEvent.type > 0 && cgsEvent.type <= kCGSLastEventType'
首先抛出调用栈:
(
0 CoreFoundation 0x00007fff8b8c20a6 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff858393f0 objc_exception_throw + 43
2 CoreFoundation 0x00007fff8b8c1ee8 +[NSException raise:format:arguments:] + 104
3 Foundation 0x00007fff89f926a2 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 189
4 AppKit 0x00007fff85d5356c -[NSEvent _initWithCGSEvent:eventRef:] + 2782
5 AppKit 0x00007fff85fd43ea +[NSEvent eventWithCGEvent:] + 243
6 libglass.dylib 0x00000001630e300f listenTouchEvents + 31
7 CoreGraphics 0x00007fff8be07115 processEventTapData + 150
8 CoreGraphics 0x00007fff8be06f68 _CGYPostEventTapData + 189
9 CoreGraphics 0x00007fff8be0c26a _XPostEventTapData + 107
10 CoreGraphics 0x00007fff8be0c362 CGYEventTap_server + 106
11 CoreGraphics 0x00007fff8be07056 eventTapMessageHandler + 30
12 CoreFoundation 0x00007fff8b831410 __CFMachPortPerform + 288
13 CoreFoundation 0x00007fff8b8312d9 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
14 CoreFoundation 0x00007fff8b831019 __CFRunLoopDoSource1 + 153
15 CoreFoundation 0x00007fff8b86419f __CFRunLoopRun + 1775
16 CoreFoundation 0x00007fff8b8636b2 CFRunLoopRunSpecific + 290
17 HIToolbox 0x00007fff882d40a4 RunCurrentEventLoopInMode + 209
18 HIToolbox 0x00007fff882d3d84 ReceiveNextEventCommon + 166
19 HIToolbox 0x00007fff882d3cd3 BlockUntilNextEventMatchingListInMode + 62
20 AppKit 0x00007fff85c74613 _DPSNextEvent + 685
21 AppKit 0x00007fff85c73ed2 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
22 libglass.dylib 0x00000001630ce8c3 +[GlassApplication enterNestedEventLoopWithEnv:] + 163
23 libglass.dylib 0x00000001630d24d3 -[DialogDispatcher runModal] + 163
24 Foundation 0x00007fff8a012220 -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] + 212
25 Foundation 0x00007fff8a0120c8 -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] + 131
26 libglass.dylib 0x00000001630d29c5 Java_com_sun_glass_ui_mac_MacCommonDialogs__1showFileOpenChooser + 981
27 ??? 0x0000000101dc3f90 0x0 + 4326178704
)
libc++abi.dylib: terminate called throwing an exception
Controller 代码为:
public class AppController implements Initializable {
@FXML
private TableView<Transactions> tableTranactions;
@FXML
private TableColumn<Transactions, Integer> accountID;
@FXML
private TableColumn<Transactions, String> colTranDate;
@FXML
private TableColumn<Transactions, String> colDescription;
@FXML
private TableColumn<Transactions, Double> colAmount;
@FXML
private TableColumn<Transactions, Integer> colCompany;
@FXML
private TableColumn<Transactions, String> colTransType;
@FXML
private Button btnClear;
@FXML
private Button btnFileChoose;
@FXML
private LineChart<String, Double> chartLineSpendingByMonth;
@FXML
private Pane paneGraph;
@FXML
private Pane paneGraphWeek;
@FXML
private Pane paneAddRecord;
@FXML
private PieChart pieSpendingCatalogue;
@FXML
private Label lblTransactions;
@FXML
private TextField txtFilePath;
@Override
public void initialize(URL arg0, ResourceBundle arg1) {
// TODO Auto-generated method stub
System.out.println("starting application");
showTransactions();
btnFileChoose.setOnAction(new EventHandler<ActionEvent>() {
/**
WHAT IS CAUSING THIS CODE SEGMENT TO FAIL??? **/
@Override
public void handle(ActionEvent event) {
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("Select File");
//Set extension filter
FileChooser.ExtensionFilter extFilter =
new FileChooser.ExtensionFilter("CSV", ".csv");
fileChooser.getExtensionFilters().add(extFilter);
//Show open file dialog
File file = fileChooser.showOpenDialog(null);
if(file!=null)
txtFilePath.setText(file.getPath());
}
});
}
@FXML
private void showTransactions()
{
hideAll();
tableTranactions.setVisible(true);
btnClear.setVisible(true);
accountID.setCellValueFactory(new PropertyValueFactory<Transactions, Integer>("accountid"));
colTranDate.setCellValueFactory(new PropertyValueFactory<Transactions, String>("tranDate"));
colDescription.setCellValueFactory(new PropertyValueFactory<Transactions, String>("descrip"));
colAmount.setCellValueFactory(new PropertyValueFactory<Transactions, Double>("amount"));
colCompany.setCellValueFactory(new PropertyValueFactory<Transactions, Integer>("comid"));
colTransType.setCellValueFactory(new PropertyValueFactory<Transactions, String>("transType"));
updateTransactionData();
}
public void hideAll()
{
tableTranactions.setVisible(false);
btnClear.setVisible(false);
paneGraph.setVisible(false);
paneGraphWeek.setVisible(false);
paneAddRecord.setVisible(false);
}
public void clearTable()
{
ObservableList<Transactions> data = tableTranactions.getItems();
data.removeAll(data);
}
public void updateTransactionData()
{
TransactionDAO trans = new TransactionDAO();
ObservableList<Transactions> data = tableTranactions.getItems();
data.addAll(trans.getAll());
}
public void showAddRecord()
{
hideAll();
paneAddRecord.setVisible(true);
}
public void showHistoric()
{
hideAll();
CatalogueSpendingDAO catalogue = new CatalogueSpendingDAO();
ObservableList<PieChart.Data> data = pieSpendingCatalogue.getData();
ObservableList<CatalogueSpending_total> values = catalogue.getTotal();
data.removeAll(data);
for(CatalogueSpending_total i : values)
{
data.add(new PieChart.Data(i.getDescription(), i.getTotal()));
}
// start adding line chart
ObservableList<XYChart.Series<String, Double>> spendingByMonthData = chartLineSpendingByMonth.getData();
Boolean add = false;
if(spendingByMonthData.size() > 0)
spendingByMonthData.removeAll(spendingByMonthData);
XYChart.Series<String, Double> series = (spendingByMonthData.size() > 0 ? spendingByMonthData.get(0): null);
if(series == null)
{
series = new XYChart.Series<String, Double>();
add = true;
}
SpendingByMonthDAO spendingByMonthDAO = new SpendingByMonthDAO();
ObservableList<SpendingByMonth> spendingByMonthDatabase = spendingByMonthDAO.getTotal();
for(SpendingByMonth i : spendingByMonthDatabase)
{
series.getData().add(new XYChart.Data<String, Double>(i.getDate(), i.getTotal()));
}
spendingByMonthData.size();
spendingByMonthData.add(0,series);
pieSpendingCatalogue.animatedProperty();
paneGraph.setVisible(true);
}
public void showWeeklyCharts()
{
hideAll();
//TODO populate the graphs here
paneGraphWeek.setVisible(true);
}
}
系统信息
最佳答案
已解决:
运行时编译器是 hava Java 1.7.0 的旧版本
还找到了这个链接:
https://forums.oracle.com/forums/thread.jspa?threadID=2444130
似乎有一次我通过http://jdk7.java.net/download.html更新了jdk到 Java 版本 7u10 Build b18 问题就消失了:-)
关于macos - javafx FileChooser Mac 操作系统 NSInternalInconsistencyException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13754862/
如主题所述,是否有可能没有 future 的问题?。基本上我发布此线程以供将来引用,以便人们可以观看该场景。mongodb 被限制为 2Gb 的原因是什么?能否请您指出引用资料,以便像我这样的菜鸟可以
我正在使用 Bootstrap 4 轮播。它适用于所有 Windows 和 Android 操作系统,但不适用于 Mac 和 iPhone 操作系统。有什么解决办法吗?这是我的代码github.com
目录 内存管理硬件结构 早期内存的使用方法 分段 分页 逻辑地址,线性地址(intel架构) 虚拟地址 物理地址
页表的一些术语 现在Linux内核中支持四级页表的映射,我们先看下内核中关于页表的一些术语: 全局目录项,PGD(Page Global Directory) 上级目录项,PUD(
1. 文件路径 绝对路径 绝对路径 (absolute path) : 以一个盘符开头的路径,就是绝对路径 例如这里的 D:\java\IntelliJ IDEA Community Edition
1. 进程介绍 1.1 进程的概念 程序是由指令和数据组成的,但这些指令要运行,数据要读写,就必须将指令加载至 CPU,将数据加载至内存。在指令运行过程中还需要用到磁盘和网络等设备。进程就是用来加载指
1. 文件路径 绝对路径 绝对路径 (absolute path) : 以一个盘符开头的路径,就是绝对路径 例如这里的 D:\java\IntelliJ IDEA Community Edition
我有 REST APIManager 类 - 用于使用服务器 api 的单例。有返回用户Token实体的登录方法; 所有其他 API 方法都使用 token 来发出请求。登录后我应该在哪里存储该 to
当我在学习操作系统类(class)时,我不明白为什么下面代码的输出是这样的 代码: #include #include #include #include int main (int argc
我正在尝试在 C++ 中使用 fork() 和 wait() 系统调用。 我的代码非常简单。但是我收到以下错误: error C3861: 'fork': identifier not found 我
我需要播放不同格式的网络广播。我尝试使用 MPMoviePlayerController 播放广播,但它在 3-4 秒后停止。 var urlAddress = "http://streaming.r
多线程(进阶) 1. 常见的锁策略 1.1 乐观锁 悲观锁 乐观锁 : 总是假设最好的情况,每次去拿数据的时候都认为别人不会修改数据,但是在对数据提交更新的时候,再去判断这个数据在这个期间是否有别人对
如何让内存用起来? 内存使用:将程序放到内存中,PC指向开始地址 那就让首先程序进入内存 让程序从磁盘加载到内存中来,首先需要考虑要将程序代码安放在内存的什么位置 如果把入口地址直接放在0地址处,然后
操作系统 内存 HBase一定需要RAM! 64位 使用64位平台(和64位JVM)。 交换 注意交换,将swappiness设为0。 CPU 确保已将Hadoop设置为使用本机的硬件
我想编写一个脚本,将当前打开的 Windows 移动到某个位置。 理想情况下,我的程序应该是这样的: var window = FindWindow("Winamp"); window.setPos(
以下问题是我对操作系统的测试评论,但我不知道如何回答。我会第一次尝试解决他们的问题,但我也不知道如何开始。 Given the following information for an assembl
在操作系统方面我见过几次这个词。匿名内存 ,但我真的不知道,那是什么。 如果有人问我一些关于它的事情,我真的无法非常确定地说出那是什么。 我也搜索了它的解释,但不幸的是我还没有找到任何令人满意的东西。
在 Abraham Silberschatz 等人的“操作系统概念”第 9 版中,作者说: "Some operating systems support only static linking, i
我知道可用端口有限制(2^16),但我不明白操作系统如何管理这些端口。内部是否有一个微 Controller 可以复用所有打开的端口?端口实际上是如何与操作系统建立连接的?端口是否连接到操作系统中的特
如何激活另一个已最小化的应用程序的窗口? 如果前面有其他窗口,它可以很好地使用 NSRunningApplication 类的 activateWithOptions 方法,但这不适用于最小化的窗口。
我是一名优秀的程序员,十分优秀!