Results 1 to 3 of 3
  1. #1
    jaho is offline Member
    Join Date
    Feb 2012
    Posts
    6
    Rep Power
    0

    Default Applet runnable and sleep

    This is a beginner question,
    If i have an applet that is runnable, then how it is right to sleep it.

    if i have

    Thread t = new Thread ( this );
    t.start();

    on my applet code,
    then is it ok to call like

    t.sleep(1000);

    or should or can i call also

    Thread.sleep(1000);

    are both just right.

    ---

    Extra question, if i have an class on my applet, then is it ok to call

    Thread.sleep(1000);

    on this class to sleep applet thread.

    Are these working on every computer, all seem to work on mine.
    Last edited by jaho; 04-25-2012 at 04:51 PM.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,581
    Rep Power
    25

    Default Re: Applet runnable and sleep

    Since sleep() is a static method, calling it with the class name would read better/be less confusing.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

Similar Threads

  1. Trying to make runnable jars
    By mwr1976 in forum New To Java
    Replies: 18
    Last Post: 04-16-2012, 02:24 PM
  2. debug runnable jar
    By Levian in forum New To Java
    Replies: 0
    Last Post: 08-11-2011, 05:38 AM
  3. Running runnable jar AS
    By sashaxiv in forum Eclipse
    Replies: 0
    Last Post: 03-16-2011, 12:14 PM
  4. Can not make a runnable jar of my project
    By liran in forum Advanced Java
    Replies: 5
    Last Post: 05-18-2010, 11:25 AM
  5. Thread RUNNABLE or WAITING
    By Pushkar in forum Threads and Synchronization
    Replies: 10
    Last Post: 01-14-2010, 01:36 AM

Posting Permissions

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