Michael Roslansky wrote:Hello again. I have a minor question. I have a integer variable "guessNumber". I'm using the provided JOptionPane... in order to have the user tell whether guessNumber is higher, lower, or exactly the number they were thinking of. Only problem is, I can't seem to display the variable when I run the program. It just shows the text within the quotations. Any help?
Well, I'm certainly no GUI expert; but what you've written doesn't jive with what I understand about JOptionPane. My suggestion would be to actually make the value part of the message; and the easiest way to do that is probably with
String.format(). After that, I suspect you're also going to need a way of providing the user choices of greater/less/equal, but I'm afraid I'm not the best to advise you on how to do that.
Winston