|
-
Dec 14th, 2001, 08:14 PM
#1
Beginner Java Student Needs Some Help
I have this snippit
VB Code:
for (int i=1; i<=4; i++) {
for (int j=1; j<=5; j++) {
g.drawString( dSales[i][j], ((100 * j) + 20), ((15 * i) + 17) );
}
}
its not working i get:
D:\jdk1.3.1\bin>javac DailySales.java
DailySales.java:70: cannot resolve symbol
symbol : method drawString (double,int,int)
location: class java.awt.Graphics
g.drawString( dSales[i][j], ((100 * j) + 20), ((
15 * i) + 17) );
^
1 error
Can I just not draw a double in with drawString? If not how can I convert to string from double?
P.S. The pointer (^) in the compiler is pointing to the dot between g and drawString!
THANKS
NOMAD!
-
Dec 14th, 2001, 08:19 PM
#2
SORRY FOR THE POST, I GOT IT TO WORK!
but an explanation would be nice, I added "" to dSales[i][j] in the drawstring line. Y?!?! does it convert to string cause the ""??? THATS MAJOR RETARDED!
-
Dec 14th, 2001, 08:45 PM
#3
Fanatic Member
you would have to use something like parseInt to convert the string to an Int, and then cast the int to a double, but i am not sure on the code for that exactly, but that is the principle behind it
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|