Results 1 to 11 of 11
  1. #1
    Cid17 is offline Member
    Join Date
    Jun 2009
    Posts
    3
    Rep Power
    0

    Default Urgent Help Needed

    Hi all I have an assignment due soon and need help with it the spec is below...im doing the assignment using the program BlueJ

    To design and implement a program written in the Java Language to produce a system that will run successfully on the Java platform with four command buttons: up, down, left, right and a text window to enter ''n" pixels. These controls will operate a drawing tool composed of a moving GIF image of a pen in the applet window. When, say, the 'up' button is pushed, a line will be slowly drawn n pixels long. Four colour selector buttons additionally allow the drawing line colour to be changed. You will design your program using UML techniques and present full documentation including the Javadoc summary of your coded methods.

    Basically Ive done everything in regards to the buttons etc. the only problem is im having trouble making the drawing tool move...

    can anyone help?

  2. #2
    tim's Avatar
    tim
    tim is offline Senior Member
    Join Date
    Dec 2007
    Posts
    435
    Rep Power
    7

    Default Threading

    Hey Cid17 :)

    To draw animations on a graphics object using Java API, you need to use threads. It is also recommended to use double buffering to avoid flickering. Here is a applet I made that demonstrates how to do this.
    Java Code:
    removed
    Hope this will be of use and good luck with your assignment. ;)
    Last edited by tim; 07-03-2009 at 09:12 AM. Reason: Code removed
    Eyes dwelling into the past are blind to what lies in the future. Step carefully.

  3. #3
    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

    tim, this is not a good practice. You just write the code for our thread starter and send it here. I don't think you are helping him here in much better way. This way I don't think OP learn something new. Just think about that. I really appreciate your contribution here. :)

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    I second Eranga. Spoon feeding only teaches the student to ask for more spoon feeds and does not help them learn.

  5. #5
    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

    Fubarable, I really hate that title. At least why those members can't use a proper title in there thread. What's your suggestion about that? Or else we can discuss in moderators forum.

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    I think that all that we can do is suggest that members use more informative titles when posting new threads (as you are doing) and hope that they will listen to the suggestion. I don't think that there is anything else we can do.

  7. #7
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Actually Tim's code doesn't follow Cid's assignment specifications at all, which again is good. Cid, please show us your work and ask a specific question, and we'll be glad to help answer as best we can.

  8. #8
    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

    I agreed with you. We cannot take a specific action, like close the thread and so on. Anyway, I'll move in the same way.

    And also, I'm not criticize the code. As you said it's not the exact code OPs' looking. But the way he present it is not good at all. ;)

  9. #9
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Posts
    742
    Rep Power
    6

    Default

    Doesn't Mods have the power to change/edit the title?
    USE CODE TAGS--> [CODE]...[/CODE]
    Get NotePad++ (free)

  10. #10
    tim's Avatar
    tim
    tim is offline Senior Member
    Join Date
    Dec 2007
    Posts
    435
    Rep Power
    7

    Default Learning by example

    Sorry guys.

    I would have appreciated an example on animation, preferably different to the problem I would have faced. - That's how I learn best. ;)

    Anyways, sorry.
    Eyes dwelling into the past are blind to what lies in the future. Step carefully.

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

Similar Threads

  1. Urgent Help needed!
    By mlwong in forum New To Java
    Replies: 0
    Last Post: 03-19-2009, 08:51 AM
  2. Help needed for strings....urgent
    By pankbiet in forum New To Java
    Replies: 6
    Last Post: 02-17-2009, 09:24 AM
  3. hi help needed, this is urgent
    By msciriha in forum NetBeans
    Replies: 1
    Last Post: 02-07-2009, 06:16 PM
  4. Urgent help needed here pls!!
    By Manfizy in forum NetBeans
    Replies: 5
    Last Post: 01-28-2009, 07:38 AM
  5. urgent help needed - paper submission.
    By dirtycash in forum New To Java
    Replies: 2
    Last Post: 11-23-2007, 11:24 AM

Tags for this Thread

Posting Permissions

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