T
Thomas Richter
Hi folks,
according to the Java API docs, a component should call paint() whenever
it needs refresh, and a swing component should call paintComponent() for
this purpose. I now need to render a tiny graphic (manually) into a
JFrame and to this end overrode paint() in JFrame. Interestingly, this
does not work correctly, the JFrame doesn't seem to call this custom
hook correctly. Sometimes my graphics is redrawn, sometimes it isn't.
The same effect happens when overriding paintComponent(): Doesn't work
reliable.
It *does* work reliable if I install a JPanel or a Canvas into the
content pane of the JFrame and override paint() there. (Thus, problem
solved on my side so far)
However, concerning the JFrame paint() method, am I missing something or
is this a "feature" (not to call it "bug")?
So long,
Thomas
according to the Java API docs, a component should call paint() whenever
it needs refresh, and a swing component should call paintComponent() for
this purpose. I now need to render a tiny graphic (manually) into a
JFrame and to this end overrode paint() in JFrame. Interestingly, this
does not work correctly, the JFrame doesn't seem to call this custom
hook correctly. Sometimes my graphics is redrawn, sometimes it isn't.
The same effect happens when overriding paintComponent(): Doesn't work
reliable.
It *does* work reliable if I install a JPanel or a Canvas into the
content pane of the JFrame and override paint() there. (Thus, problem
solved on my side so far)
However, concerning the JFrame paint() method, am I missing something or
is this a "feature" (not to call it "bug")?
So long,
Thomas