You haven't said what was wrong with the code the OP is using.
In general I think using variables is a better way to code than hardcoding literals in the code.
One fault I find is using too short...
Type: Posts; User: Norm
You haven't said what was wrong with the code the OP is using.
In general I think using variables is a better way to code than hardcoding literals in the code.
One fault I find is using too short...
@Rend Please explain what is wrong with code you posted. Can you make a small test program to show the problem?
Please add a println statement to the code that prints out the results. The JOptionPane doesn't print on the console so its display can not be copied to the forum.
Try debugging the code by...
Can you copy and paste here some examples of the program's execution that shows what you are talking about.
BTW With if/else if statements, the execution of any following statements is skipped...