Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-16-2008, 06:12 AM
Member
 
Join Date: Nov 2008
Posts: 1
Rep Power: 0
munchflo is on a distinguished road
Default using applet with user-craeted methods
hello
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)
Draw.drawpiece("ftl","rwg");

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.

thank you

Florian



^

Last edited by munchflo; 11-16-2008 at 06:16 AM.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble with static methods and boolean equals() methods with classes dreamingofgreen New To Java 5 07-22-2008 06:34 AM
How to get the User Name Java Tip java.lang 0 04-04-2008 02:43 PM
Java Security Applet will not load under a specific user. MartyF Java Applets 0 03-31-2008 04:35 PM
New User TKI5 New To Java 0 12-13-2007 01:13 AM
Applet, To center text and To open I engage in a dialog in an Applet Marcus Java Applets 4 06-08-2007 06:15 AM


All times are GMT +2. The time now is 01:50 AM.



VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org