Hi, I'm new with Java, and I need help with a program that I wrote. It needs to prompt the user for the x value, the y value, and the radius value, and then display the info in a JTextArea. Is giving me the following error:
I don't know what I'm doing wrong. I would really appreciate your help with this. This is the code i have:
You've got a close bracket labelled "end main", but you've actually not got the beginning of a main() method, or any methods. You've written all the code inside the scope of the class itself, and this isn't legal. Classes can contain member variable declarations, but they can't contain statements -- statements (like "x = Integer.parseInt(...)") have to be inside a method.
Since you end the statement where you add text to the string with a ; it doesn't understand what you are doing. Replace the ; which I have marked with a +. After that change you will probaly get an error that says you cant use the += operator on a string, so replace it with .= which means append.
thanks a lot carl! i made that work, but now the jtextarea is not working. is giving me this error:
/tmp/26198/CircleTest.java:48: cannot resolve symbol symbol : method showMessageDialog (,javax.swing.JTextArea,int) location: class javax.swing.JOptionPane JOptionPane.showMessageDialog( null, output, JOptionPane.INFORMATION_MESSAGE ); ^ 1 error and this is the code i have:
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop