Results 1 to 5 of 5

Thread: Thread

  1. #1
    sims is offline Member
    Join Date
    Jul 2008
    Posts
    9
    Rep Power
    0

    Default Thread

    i need code for drawing lines using concept of thread.

    i have a button ,when user clicks on this ...line is drawn for random values.
    the line is drawn dynamically.(using thread and sleep)i.e,,after a line is drawn between two points ,there is a slight delay seen when the line is drawn for next 2 points ,,,,
    again when user clicks on the button. second line is plotted..and the first line which is bieng drawn also is visible.

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  3. #3
    sims is offline Member
    Join Date
    Jul 2008
    Posts
    9
    Rep Power
    0

    Default hi

    have got no idea to accomplish this......
    please give me the code...
    i"ll get some information and idea

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Sorry pal, I don't have any code related to this. What you have done up to now. It's better that you should ask your question related to work you have done.

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

    Default

    Build your code a step at a time.
    Do you have the code to draw a line? - use paintComponent()
    Can you have the line drawn when a button is clicked? - listener
    Now have a timer wait and then tell the line drawer to draw the next line. - have global flags to tell paint method what to draw.

Similar Threads

  1. data from the main/GUI thread to another runnin thread...
    By cornercuttin in forum Threads and Synchronization
    Replies: 2
    Last Post: 04-23-2008, 11:30 PM
  2. How to get thread name
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-09-2008, 07:40 PM
  3. Replies: 0
    Last Post: 01-28-2008, 08:02 AM
  4. using Thread
    By one198 in forum New To Java
    Replies: 1
    Last Post: 11-21-2007, 09:01 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
  •