Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-02-2009, 04:31 PM
Member
 
Join Date: Jun 2009
Posts: 3
Rep Power: 0
Cid17 is on a distinguished road
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?
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 07-02-2009, 05:07 PM
tim's Avatar
tim tim is offline
Senior Member
 
Join Date: Dec 2007
Location: South Africa
Posts: 406
Rep Power: 3
tim is on a distinguished road
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.
Code:
removed
Hope this will be of use and good luck with your assignment.
__________________
Eyes dwelling into the past are blind to what lies in the future.

Last edited by tim; 07-03-2009 at 10:12 AM. Reason: Code removed
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-03-2009, 05:11 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,256
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
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.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-03-2009, 05:25 AM
Fubarable's Avatar
Moderator
 
Join Date: Jun 2008
Posts: 5,963
Rep Power: 7
Fubarable is on a distinguished road
Default
I second Eranga. Spoon feeding only teaches the student to ask for more spoon feeds and does not help them learn.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 07-03-2009, 05:27 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,256
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
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.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 07-03-2009, 05:36 AM
Fubarable's Avatar
Moderator
 
Join Date: Jun 2008
Posts: 5,963
Rep Power: 7
Fubarable is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 07-03-2009, 06:06 AM
Fubarable's Avatar
Moderator
 
Join Date: Jun 2008
Posts: 5,963
Rep Power: 7
Fubarable is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 07-03-2009, 08:48 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,256
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
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.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 07-03-2009, 09:04 AM
angryboy's Avatar
Senior Member
 
Join Date: Jan 2009
Location: Javaland
Posts: 743
Rep Power: 2
angryboy is on a distinguished road
Default
Doesn't Mods have the power to change/edit the title?
__________________
USE CODE TAGS--> [CODE]...[/CODE]
Get NotePad++ (free)
Bookmark Post in Technorati
Reply With Quote
  #10 (permalink)  
Old 07-03-2009, 10:17 AM
tim's Avatar
tim tim is offline
Senior Member
 
Join Date: Dec 2007
Location: South Africa
Posts: 406
Rep Power: 3
tim is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #11 (permalink)  
Old 07-03-2009, 03:42 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,256
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Originally Posted by angryboy View Post
Doesn't Mods have the power to change/edit the title?
Actually there is no direct way to do that.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Tags
actions, gui

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT +2. The time now is 12:28 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org