
Signature
Andrey Kuznetsov
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities
>> I'm drawing a custom jbutton by overriding update and paint in the
>> ButtonUI
[quoted text clipped - 11 lines]
> Since not every one here has magic ball, the best option is to post
> your code.
The question is about the behavior of swing not my code, so one does not
need a "crystal ball" unless one doesn't know how swing behaves in this
situation, in which case one doesn't need to answer.
Swing behavior:
Graphic operations performed within an overload of the Update() function
of a ButtonUI instance occur instantaneously.
Effect of swing behavior:
This causes flicker as the background of the button is drawn then the
contents of the button are drawn.
Question about general methadology required to counter or work with this
behavior:
What is the general method of drawing a custom JButton so that all the
graphics are presented at once (so as not to cause flicker)?
Andrey Kuznetsov - 12 Oct 2005 02:40 GMT
> The question is about the behavior of swing not my code, so one does not
> need a "crystal ball" unless one doesn't know how swing behaves in this
> situation, in which case one doesn't need to answer.
because you overridden update, you have changed Swing behavior.
> Swing behavior:
> Graphic operations performed within an overload of the Update() function
> of a ButtonUI instance occur instantaneously.
this is surely due error in your code
in general you should not override update.
you may override paint.
HTH

Signature
Andrey Kuznetsov
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities
Thomas Weidenfeller - 12 Oct 2005 08:24 GMT
> The question is about the behavior of swing not my code, so one does not
> need a "crystal ball" unless one doesn't know how swing behaves in this
> situation, in which case one doesn't need to answer.
I take it that you don't really want help. So, can you please post your
lectures to another group? Thanks for playing, and don't let the door
hit you on your way out.
http://www.catb.org/~esr/faqs/smart-questions.html
http://www.physci.org/codes/sscce.jsp
http://groups.google.com/group/comp.lang.java.help/msg/54df002655344dcc
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
Roedy Green - 12 Oct 2005 12:19 GMT
>The question is about the behavior of swing not my code, so one does not
>need a "crystal ball" unless one doesn't know how swing behaves in this
>situation, in which case one doesn't need to answer.
If you are so all fired sure you know the cause of your trouble, you
should be able to fix it yourself.
Others wanted to take a step back. paintImmediately causes immediate
painting, but update repaints wait on the queue like anything else.
The people who were trying to help you did not accept your diagnosis.
I think I know your trouble and I gave you the answer in another
post. For flicker problems generally, see
http://mindprod.com/jgloss/flicker.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.