Results 1 to 6 of 6
Like Tree1Likes
  • 1 Post By monkeyjr97

Thread: Thraed,run,draw(g)???????!!!!!!!!!!!

  1. #1
    faraa is offline Member
    Join Date
    Mar 2013
    Posts
    70
    Rep Power
    0

    Default Thraed,run,draw(g)???????!!!!!!!!!!!

    Hi
    How we use a method like draw that gets a graphics argument in run method(of thread)??
    Thanks ...

  2. #2
    monkeyjr97 is offline Senior Member
    Join Date
    Nov 2012
    Posts
    256
    Rep Power
    3

    Default Re: Thraed,run,draw(g)???????!!!!!!!!!!!

    You should have a paint method that takes graphic as an argument

    in your run method, just call repaint(); You should never call paint directly
    faraa likes this.

  3. #3
    faraa is offline Member
    Join Date
    Mar 2013
    Posts
    70
    Rep Power
    0

    Default Re: Thraed,run,draw(g)???????!!!!!!!!!!!

    Thank you so much .
    I have any classes and object . but I have one class that extends JApplet .
    How can I say to paint that run this thread
    (I have one bird that it is flighting in sky.I should use 5 birds (for flight cycle) and these birds should draw many times
    Can you guide me more?
    (Excuse me for my bad English.If You didn't understand tell me.I will explain more)
    Thank you again...

  4. #4
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    4,033
    Rep Power
    6

    Default Re: Thraed,run,draw(g)???????!!!!!!!!!!!

    Check out the link in my signature for the Java Tutorials. Click on the big index and look for the applet section. There are lots of examples.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  5. #5
    faraa is offline Member
    Join Date
    Mar 2013
    Posts
    70
    Rep Power
    0

    Default Re: Thraed,run,draw(g)???????!!!!!!!!!!!

    Jim:
    I know applets and thread(not so much...)
    But I don't know how to connect them to each other...
    Thank you so much...

  6. #6
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    4,033
    Rep Power
    6

    Default Re: Thraed,run,draw(g)???????!!!!!!!!!!!

    Well, the tutorials show how to use threads. An example of invoking an applet in a thread is in the tutorials at this link. Getting Started With Applets (The Java™ Tutorials > Deployment > Java Applets). You can apply other examples in your applet by reviewing the tutorials on threads.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. How I can draw..
    By gyijhbk in forum Java 2D
    Replies: 6
    Last Post: 11-10-2012, 05:54 PM
  2. why cant i draw this box???
    By stefandanielsen in forum New To Java
    Replies: 2
    Last Post: 05-12-2011, 03:53 PM
  3. how to draw an arc
    By Baker in forum New To Java
    Replies: 1
    Last Post: 04-16-2009, 10:05 PM
  4. SWT Draw 2D Demonstration
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 06-28-2008, 10:22 PM
  5. help me draw... please...
    By kureikougaiji in forum New To Java
    Replies: 1
    Last Post: 01-28-2008, 01:22 PM

Posting Permissions

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