Calling t.start() in paintComponent isn't a very good idea. f.setVisible(true) implicitly calls paintComponent, which then calls t.start(), leading to repaint(). repaint() schedules a call to paintComponent, which later calls t.start() again. You are basically starting the timer over and over again, it's much better for it to be started only once.
The ball isn't showing up for me and i have the exact same code. I use eclipse if that matters.
nice job man ,2019 !
The tutorial i was looking for yes
the f.add(s) doesn't work. it says "The method add(Component) in the type Container is not applicable for the arguments (s)" is it possible for you to give solution how it worked in your program?
I get an error at "Timer t = new Timer(5, this);
What are your imports?
THANK YOU!
Im beginner I cant even draw fking rectangles side to side using FOR
The ball did not appear !!!
Thanks, great job. Just want I needed to see.
Thank you!!!!! You are the first person on YouTube who explained this properly! I've been through dozens of videos and I'm glad I found yours.
why does it seem like the circle goes slightly beyond the upper y boundary into the bottom of the frame?
I think your videos are a great help, but if you are teaching people how to code in Java, then you should teach them cleaner code. Class names should start with a capital letter. Instead of using the literal value 40 you should use a final static. Something like public final static int BALL_W = 40; Is a better approach. In a big program if you wanted to change the size of the ball you might need to update 100's of lines of code and it would save you a lot of time if you used a final static instead. Please don't think I am trying to pick holes in your video, it's just that these things are pretty important.
THIS IS BRILLIANT
Thanks a lot.. You really helps me for my project.. =)
How do you connect Macheads with second???
thx
My program editors keep saying, "Remove parameters to match Timer()."
I Finished the code but when i came to run it an error came up and it said "second cannot be resolved to a type"
How do i fix this?
When my circle moves it makes a "trail" like TRON bicycle, why ?
brilliant!
what class package did u use
u just gained a subscriber m8
Would u be able to do thins with an image
When I write that, the ball is flickering all the time …
Hey one more thing – my balls leaves a solid black trail behind it looking line a snake growing longer and longer. I followed the code, any idea why this is happening?
That was brilliant, thanks so much excellent tutorial!
Calling t.start() in paintComponent isn't a very good idea.
f.setVisible(true) implicitly calls paintComponent, which then calls t.start(), leading to repaint().
repaint() schedules a call to paintComponent, which later calls t.start() again.
You are basically starting the timer over and over again, it's much better for it to be started only once.
The ball isn't showing up for me and i have the exact same code. I use eclipse if that matters.
nice job man ,2019 !
The tutorial i was looking for yes
the f.add(s) doesn't work. it says "The method add(Component) in the type Container is not applicable for the arguments (s)"
is it possible for you to give solution how it worked in your program?
I get an error at "Timer t = new Timer(5, this);
What are your imports?
THANK YOU!
Im beginner I cant even draw fking rectangles side to side using FOR
The ball did not appear !!!
Thanks, great job. Just want I needed to see.
Thank you!!!!! You are the first person on YouTube who explained this properly! I've been through dozens of videos and I'm glad I found yours.
why does it seem like the circle goes slightly beyond the upper y boundary into the bottom of the frame?
I think your videos are a great help, but if you are teaching people how to code in Java, then you should teach them cleaner code. Class names should start with a capital letter. Instead of using the literal value 40 you should use a final static. Something like public final static int BALL_W = 40; Is a better approach. In a big program if you wanted to change the size of the ball you might need to update 100's of lines of code and it would save you a lot of time if you used a final static instead. Please don't think I am trying to pick holes in your video, it's just that these things are pretty important.
THIS IS BRILLIANT
Thanks a lot.. You really helps me for my project.. =)
How do you connect Macheads with second???
thx
My program editors keep saying, "Remove parameters to match Timer()."
I Finished the code but when i came to run it an error came up and it said "second cannot be resolved to a type"
How do i fix this?
When my circle moves it makes a "trail" like TRON bicycle, why ?
brilliant!
what class package did u use
u just gained a subscriber m8
Would u be able to do thins with an image
When I write that, the ball is flickering all the time …
Hey one more thing – my balls leaves a solid black trail behind it looking line a snake growing longer and longer. I followed the code, any idea why this is happening?
That was brilliant, thanks so much excellent tutorial!