- Joined
- Jul 11, 2008
- Messages
- 118
- Reaction score
- 16
Ok, my goal is to store a properties file within a jar, but its proving to be quite difficult.
Currently I'm using this snippet of code to save the properties file, it is already pre-existing within the package and I want to overwrite it with a new one which originally was the goal of the above code. However, what my current code does is save outside the jar, I executed it on my desktop and upon invoking this method a new properties file was created on my desktop. Is it possible to save a properties file IN a jar, and if so, how?
PHP:
private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {
launchprefs.setProperty("browser", jTextField2.getText());
launchprefs.setProperty("client", jTextField3.getText());
jDialog2.setVisible(false);
try {
launchprefs.store(new FileOutputStream("launchprefs.properties"), "Properties for this program.");
} catch (IOException ex) {
JOptionPane.showMessageDialog(jDialog2, "Error Saving Properties.");
}
}
Currently I'm using this snippet of code to save the properties file, it is already pre-existing within the package and I want to overwrite it with a new one which originally was the goal of the above code. However, what my current code does is save outside the jar, I executed it on my desktop and upon invoking this method a new properties file was created on my desktop. Is it possible to save a properties file IN a jar, and if so, how?

