• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

YoYo goes up and down on a string but the yoyo doll doesn't display it appears broken in Internet Ex

 
Radhika Srinivasan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Write an applet that implements Runnable that simulates a yoyo going up and down on a string. Reduce flicker by only repainting the string and yoyo in the background color.



<html>
<head>
<title>YoYo Applet</title>
</head>
<body>
<applet code="YoYo" height="400" width="400">
</applet>
</body></html>


Modify program so that you have two yoyos of different colors and speeds. Create an HTML file that will put both of these yoyos side by side with appropriate headings.






Many thanks,
Radhika
 
Radhika Srinivasan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Radhika Srinivasan wrote:Write an applet that implements . . .
[deleted]
Many thanks,
Radhika
[edit]The deleted text appears identical to the first post.[/edit]
 
Henry Wong
author
Marshal
Pie
Posts: 21446
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting homework problems. What issues are you running into? Meaning do you have a specific problem that you run into. And what have you tried?

We can't give you a hint in the right direction, if we don't know what you did. If you just show us the problem -- then the hint is... to try to attempt the assignment.

Henry
 
Radhika Srinivasan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the reply, I mean in YoYo.java program doll appears when I run it in Internet Explorer......

Below lines which I've marked it from YoYoB.java appears broken when I run in Internet Explorer........[meaning when I run both programs YoYoA.java and YoYoB.java the YoYo doll appears broken]

public void paint(Graphics g)
{
setBackground(Color.white);
/*
g.setColor(Color.red);
g.drawLine(x,100,x,y);
g.setColor(Color.green);
g.fillOval(x-10,y,20,20);
*/
[b] [/b]
try
{
Thread.sleep(sleep);
}
catch(InterruptedException e)
{}
repaint();


}
}
 
Kalabaw moo
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean broken? flickery?

I have the same problem in my code posted in applet this section but too bad nobody's replying just yet. I was able to get rid of the flickery by just double buffering, you could google that out - if that's the problem you're having.
 
Radhika Srinivasan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's appears broken only partially oval appears the complete body of YoYo doll doesn't appear
 
Campbell Ritchie
Sheriff
Pie
Posts: 49865
71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please don't quote long stretches of posts identical to previous posts; they are difficult to read. I have had to delete several hundred lines.
 
Radhika Srinivasan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm done with this program ............ Thank you all ...........
 
Campbell Ritchie
Sheriff
Pie
Posts: 49865
71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the benefit of future readers, how did you sort it out?
 
Radhika Srinivasan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first applet should draw yoyo one and part of the stick figure arm. The second applet should draw the stick figure connecting the arms to the first and third applet. The third applet should draw yoyo two and part of the stick figure arm.
All I had to do is : I had to remove a thread in yoyo.java, just graphics.
.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49865
71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic