File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Android Security Essentials Live Lessons
this week in the
Swing / AWT / SWT
Ramesh Pramuditha Rathnayake
Joined: Oct 31, 2012
Aug 07, 2013 09:10:57
When doing a painting in a
, why we override paintComponent(Graphics g) method other than paint(Graphics g) method..??
What will happen if paint method has overriden...?
Joined: Jun 14, 2013
Aug 07, 2013 11:27:53
paints border and inner components in it's paint method. If you override paint method in a
then some content may appear to be missing.
Also read the
Painting in AWT and Swing
article. It describes when and which methods are called (including paint and paintComponent).
Joined: Jun 13, 2009
Aug 08, 2013 08:27:42
Swing is different from AWT when it comes to painting.
You can also look at the Swing tutorial on
for an explanation and painting examples.
I agree. Here's the link:
subject: Java Graphics
How to invoke a paint method in Frame?
The way to accumulate drawn objects on the screen is to
Logos or Pics for JPanel
applet flicker upon netscape wndw resize
paint won't call graphics
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014