Results 1 to 1 of 1
- 11-16-2008, 07:12 AM #1Member
- Join Date
- Nov 2008
- Rep Power
using applet with user-craeted methods
I am trying to write an Pocketcube (like a Rubik's Cube) simulator and I am using an user-created method to draw the net of the cube in an Applet.
I am using this code to create my method:
class Draw extends Applet
public void drawpiece(String position, String color, Graphics g)
When I try to use that method [ Draw.drawpiece("ftl","rwg") ] I get a compile error:
F:\fun\minicube1.java:36: drawpiece(java.lang.String,java.lang.String,java.a wt.Graphics) in Draw cannot be applied to (java.lang.String,java.lang.String)
I do not use any extern graphic files so I cant write anything behind the two Strings in my method, but I also cant delete the "Graphics g" when I create my method or I get a comiple error when I use "g.fillRect()" later.
Can anybody help me? I am pretty much stuck at this point and dont see another way to do it.
Last edited by munchflo; 11-16-2008 at 07:16 AM.
- By dreamingofgreen in forum New To JavaReplies: 8Last Post: 04-16-2012, 11:00 PM
- By Java Tip in forum java.langReplies: 0Last Post: 04-04-2008, 02:43 PM
- By MartyF in forum Java AppletsReplies: 0Last Post: 03-31-2008, 04:35 PM
- By TKI5 in forum New To JavaReplies: 0Last Post: 12-13-2007, 02:13 AM
- By Marcus in forum Java AppletsReplies: 4Last Post: 06-08-2007, 06:15 AM