1

I am currently working on a Java plugin for Netbeans 6.9.1 using the Apache POI api for interfacing with Microsoft documents that has two functions, the first takes data from a properties text file and creates an excel spreadsheet(.xlsx) containing that data, and the second part takes text from a spreadsheet and adds it to a properties text file.

When I run the code in the debugger both of the functions work great. The files get created and edited as they are supposed to, but I ran into problems when I created the NBM from the project and installed the plugin. The import (from .xlsx to .txt) does not do change the contents of the text file. I have checked variables at various times in the code to make sure there's nothing wrong with them there and everything was as it should. The export (.txt to .xlsx) works fine in the plugin, so I'm not sure exactly what's going on. When I start the import it goes through the steps, but nothing ever gets changed or written to the final files.

I'm pretty new to Netbeans so I'm not sure if there is a major difference from debugger to the actual plugin that is affecting how the program acts. Any help

4

1 に答える 1

0

問題は、書き込む一時ファイルを作成することでした。デバッガーではプロジェクトフォルダーに書き込みましたが、プラグインとしてインストールすると、プログラムファイルに一時ファイルが作成されていました。Windowsは、そのディレクトリに作成されたファイルをプログラムに取得させなかったため、代わりにローカルアプリデータにファイルを作成するように変更しました。

$    System.getProperty("user.home") + "\\Local Settings\\Application Data"

それがようやく機能し、そのような単純な修正に多くの時間を浪費したことをうれしく思います。これが将来誰かを助けることができることを願っています。

于 2012-02-09T18:51:52.457 に答える