How can I add here Invalid Size Number if it's less than 1 and more than 12?
I tried while loop but i still get the Size right after i get the "Invalid Size Number" message.
By the way, before you say it.Yes i have to use the JOptionPane for this question.
Display the message Size is XS if size is 1 or 2 or 3.
Display the message Size is XS if size is 4 or 5 or 6.
Display the message Size is XS if size is 7 or 8 or 9.
Display the message Size is XS if size is 10 or 11 or 12.
In addition to CR suggestions, probably think of creating a suitable separate method to define a dress size and print it to console or MessageDialog of JOptionPane. Don't cram everything into one main method. Always try to decompose your whole code into small few lines long methods and name them appropriately, so they'd reveal their actual intention.
Code indenation also could be improved as it is not consistent. Check Java Code Conventions (<- link). It is more than 15 years old, but still being applied regularly.
So it takes a day for light to pass through this glass? So this was yesterday's tiny ad?