I’m working for a client and trying to deliver a .jar file to him that he can run anywhere. However, it seems that some of the code is not functioning even though all the libraries are included (and the code that I can tell is not working is included in the standard Java library)
For example:
if(desiredLikesTextField.getText().equals("0")) {
successfulLabel.setText("Checking Likes"); //JLabel
int choice = JOptionPane.showConfirmDialog(this, "You have entered 0 likes.\nWould you prefer to like as much as possible?");
successfulLabel.setText("Entered 0 Likes");
if(choice == JOptionPane.YES_OPTION) {
desiredLikesTextField.setText(String.valueOf(accountPassList.size()));
} else {
return;
}
}
The dialog comes at the right time and returns the right values, but the setText function of the JLabel does not work. This is also happening with the JButtons in the program.
I’m quite new to the creation of .jars as I usually program individual components for clients so is there anything blatantly obvious that I’m missing? The file runs perfect on the computer I’m developing with but when I transfer the .jar file to another computer it does not work as I want it to.
For anyone wondering it was a very, very stupid mistake. I changed the file names so the jar could not find the Netbeans dependencies. So, if you’re having this problem check that your file names are the same as they were in the IDE!