You Are Here:

Community: Developer Discussion Boards

#1 Old Timer problem.... - 2003-10-10, 06:58

Join Date: Oct 2003
Posts: 149
Location: Portland, OR
Send a message via MSN to mshita Send a message via Yahoo to mshita
mshita
Offline
Regular Contributor
Hi again,

I've tried to add to my program a timer task that would change the image shown on the screen. But I keep getting this error message:

HelloWorldMIDlet.java:65: cannot resolve symbol
symbol : method schedule (HelloScreen.ChangeLogo,int,int)
location: class java.util.Timer
logoTime.schedule( change, 100, 100 );
^
1 error
-------------------------
Can anyone explain that?

Mounir
Reply With Quote

#2 Old 2003-10-10, 19:26

Join Date: Oct 2003
Posts: 149
Location: Portland, OR
Send a message via MSN to mshita Send a message via Yahoo to mshita
mshita
Offline
Regular Contributor
Can anyone help me out??? :)
Reply With Quote

#3 Old 2003-10-10, 19:30

Join Date: Jul 2003
Posts: 1,094
Location: Finland, Tampere
doctordwarf
Offline
Super Contributor
This is simple :)

Exactly as it says:
class java.util.Timer doesn't have method schedule with the parameters (HelloScreen.ChangeLogo,int,int)
Reply With Quote

#4 Old 2003-10-10, 19:33

Join Date: Oct 2003
Posts: 149
Location: Portland, OR
Send a message via MSN to mshita Send a message via Yahoo to mshita
mshita
Offline
Regular Contributor
hmmm.....I'm still scratching my head. Here is how I did it


class HelloScreen extends Canvas implements CommandListener
{
private final HelloWorldMIDlet midlet;
private final Command exitCommand;
Timer logoTime = new Timer();
ChangeLogo change = new ChangeLogo();
private Image[] logo;
private int logon = 0;

HelloScreen(HelloWorldMIDlet midlet)
{
this.midlet = midlet;
exitCommand = new Command("Exit", Command.EXIT, 1);
addCommand(exitCommand);
setCommandListener(this);

try
{
logo = new Image[2];
logo[0] = Image.createImage("/logo.png");
logo[1] = Image.createImage("/vg.png");
}
catch (IOException e)
{
System.err.println("Failed loading image!");
}
logoTime.schedule( change, 100, 100 );
}
Reply With Quote

#5 Old 2003-10-10, 19:49

Join Date: Jul 2003
Posts: 1,094
Location: Finland, Tampere
doctordwarf
Offline
Super Contributor
Quote:
public void schedule(TimerTask task,
long delay,
long period)
ChangeLogo is not a TimerTask probably
Reply With Quote

#6 Old 2003-10-10, 19:54

Join Date: Oct 2003
Posts: 149
Location: Portland, OR
Send a message via MSN to mshita Send a message via Yahoo to mshita
mshita
Offline
Regular Contributor
Thanks...

It was Changelogo extends Timer and not extends TimerTask.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia