File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Help needed with the Code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Help needed with the Code" Watch "Help needed with the Code" New topic

Help needed with the Code

kartik rathore

Joined: Oct 18, 2008
Posts: 14
hi, iv been trying to design a bouncing ball program whose code is under but i dont seem to find the problem as its not drawing the ball.

i would really appreciate if any one could make the correctiion to the code for me so that it shows the ball bouncing



[MG Edited for code tags]

[ November 02, 2008: Message edited by: Maneesh Godbole ]

[ November 02, 2008: Message edited by: kartik rathore ]
[ November 02, 2008: Message edited by: Bear Bibeault ]
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10771


A few things:
1) Ease Up
2) Use Code Tags. I have edited your original post. As you can see it is much easier for everyone to read as it is properly indented.

I noticed you have a very similar post here.
Incidently in this post too, Pete Stein had requested you to Ease Up and use the Code Tags.
Craig Wood had been most helpful there by posting a workable code.
Did you try it out? Did it work?

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
kartik rathore

Joined: Oct 18, 2008
Posts: 14
i did try the code that was posted by craig wood but it didnt seem to work so i tried to make sum changes into it and still i just dnt seem to have the graphics working in the program at all ....
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24195

Well, one hint is that you don't call "paintComponent()" yourself. You call "repaint" and let Java call paintComponent() for you -- as any working examples you've looked at would undoubtedly show.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: Help needed with the Code
It's not a secret anymore!