I know that there is a bunch of restrictions of Java Applet what they can and can not do, but I Thought that the jars were different. For the record, I'm new to jar files and the like.
I have written a GUI for a data entry tool, and I would like to be able to write formatted data in a text file. This works when the program is run from Eclipse. However, once was packaged in the JAR file, I can not get a piece of file to write to work now, it does not give any error.
There is no line code to share here, but this program basically allows the user to:
- View data < Li> Convert data to a text field in GUI
- Click to save and output text file containing this data in my selected directory
The last step is that Where my runner Jar is failing me, I click on save and mine The dialog box appears and everything else, but when I check the output folder, no file is created. Note: This is not to be done with the wrong path - I have checked it. As I said above, it works in Eclipse.
Do I have some restrictions? Ideally, I'm able to share this executable file with some others to split data entry work. Is this program another format for packaging that will allow it to work? (I've spent a long time on this and want to work it in Java)
My fight is to save my button below. This is where magic should be happening:
class WriteToFileListener applies ActionListener {public zero functioning (ActionEvent event) {string command = event.getActionCommand (); If (command.equals (strWriteToFile)) {System.out.println (strWriteToFile); Int Warning = JusttionPain Shov department (frame, "text", "text", joption pin. Okkanal_option, joppanpan .warning_MESSAGE, empty, empty, empty); If (warning == 0) {path path = path.get (tfOutputDir.getText () + "\\" + tfFileName.getText () + ".txt"); ArrayList & LT; String & gt; Output = new arreelist & lt; String & gt; (); For (string s: tmp.items) {output.add (s); } {Files.write (route, output); } Hold (IOException e) {e.printStackTrace (); }}}}}}
okay i think my own question really The answer is, but I do not really understand why:
When the JR file was packaged in Eclipse, I had selected "necessary libraries of the package in JR". He gave me the problem.
By trying again, I need to "remove the necessary libraries in JR." Resolved this problem.
There is a good explanation of the difference between the two options, but I do not understand why it affected my ability to save me maybe @ m0skit0 had a point about the path? Is it trying to write in jars?
No comments:
Post a Comment