another well-known tip for the fast painting is:
If only part of your component needs to be updated, make paint requests using a
A few weeks ago Chris
tagged 4 people at once !
In one of my previous blog I presented a component which enables arrow keys to transfer focus and selection for Swing buttons.
And it worked very well, but there were two things which worried me
- JXButtonGroupPanel offered a different way to bind buttons to a ButtonGroup
Inspired by some latest blogs I decided to find the most hacky and crazy method to paint on a component
I chose JButton as the most well-known component to play with
The goal is to implement some custom painting to a button without subclassing it and with no custom UI delegate
As you probably know all Swing components are Containers,
I have seen a lot of custom GlassPane tricks, which use GlassPane to "disable" the frame, to provide a visual effects during the lengthy tasks or to give more rich feedback during drag and drop etc...
The distinctive feature of that tricks is that GlassPane is shown only temporarily,
I have fixed quite a lot of bugs and RFE's in Swing for Java 1.6 and don't really remember all of them,
but I do remember one remarkable bug because it took me unusually long time to find a good solution
and after I had fixed it I had to fix several regressions and finally
I completely rolled the fix back
A long time ago I wanted to have a component which could paint rotated text for my application
I definitely could create my own component, override paintComponent(), implement correct resizing etc...