This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Writing an Applet that takes a string and places it in the center of specified area. Utilizing drawString to position the string for the output. I want to use FontMetric to determine the size of the string in Pixels.
I have the following lines coded to display the value returned from FontMetrics processing when perfroming the drawString.
//change string to upper case letters //output string sName for second time g.drawString(sName.toUpperCase( ),lowXSpot,lowYSpot); }
When I go to compile the code, I get the following message: WriteNameApplet.java:58:cannot resolve symbol Symbol : class FontMetrics Location : class WriteNameApplet FontMetrics fm = g.getFontMetrics(); ^ 1 error
When I looked at the entries on the forum, it appears that I have this coded properly but....
I would appreciate any suggestions as to what the problem may be?
Welcome to JavaRanch! We don't have too many rules 'round here, but we do have our Naming Standards. Please Change your display name to match these standards. (Mike Louys will suffice/Even 'though the name is nice/There's no need to say it twice.)
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.