Forums Register Login

Small applet text problem

+Pie Number of slices to send: Send
Hi.
Does anyone know why this code does not work? Thanks for any help.
AppletText.java:14: cannot resolve symbol
symbol : method SetColor (java.awt.Color)
location: class java.awt.Graphics
g.SetColor(Color.blue);
^
AppletText.java:15: cannot resolve symbol
symbol : method SetFont (java.awt.Font)
location: class java.awt.Graphics
g.SetFont(new Font("Verdana", Font.BOLD, 12));
^

Thanks again,
Jon
+Pie Number of slices to send: Send
Silly me! I needed to change "SetColor" to "setColor" -- what a noob! :roll:
+Pie Number of slices to send: Send
Welcome to JavaRanch, Jon!
I'm glad we could help by being your Cardboard Analyst.
As a good beginner tip that helped me out a lot, if you weren't already familiar with it, let me introduce you to the J2SE API documentation. It does a great job of documenting and describing almost all of the classes (and their methods) available in the J2SE API.
It's a very nice resource for doing things like looking up what methods are available to a Graphics type object, including the names of methods, what parameters they take, what might get returned, what various methods do, etc.
Good luck and I hope to see you 'round the Ranch!
this llama doesn't want your drama, he just wants this tiny ad for his mama
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 787 times.
Similar Threads
Creating Java applet
problem with parameters
Hmmm... ??
How do i apply font styles and sizes to a string ?
drawCenteredString
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 04:14:55.