Someone else definitely more knowledgeable on JOptionPane's than me will advice you better. Give them some time.
1. But to my eyes stuck one little tiny thing. You don't need to have numberB as a parameter in your showFactor method. You can initialize it to 1 within the for loop. I'd keep only numberA as an argument.
2. Why you returning Integer from that method and not using it nowhere? Consider if you ever need to return it.
3. Also, please format your code consistently, these things could help you loose some marks. Beside that, your code is difficult to read. Make by 1 space around all binary operators. Break your String text within print statements, as the lines at the moment are the way too long, I can't even see till the end.
Liutauras Vilda wrote:. . . Someone else definitely more knowledgeable on JOptionPane's than me will advice you better. Give them some time. . . .
First things first. Get the factors method working first. Print out the result to the command line, and when you can do that you can add option panes very easily. But, as Knute said, you need to turn your computer off and work out the algorithm first.
Make it simple enough that Campbell Ritchie could do it.
And welcome again
Drove my Chevy to the levee but the levee was dry. A wrung this tiny ad and it was still dry.