Thanks for the tip. I have added methods to check property changes to the size 
and text. 
I also read somewhere that I should not override the paintComponent method but 
that I should use the paint method instead. The clip is normally set in the 
paint method of JComponent.
If I do that it also works and gives the following method. 
/**
 */
        public void paint(final Graphics g) {
                if (isEnabled()) {
                        super.paint(g);
                        return;

                }
                if (redraw) {
                        final BufferedImage buf = new BufferedImage(getWidth(), 
getHeight(),
                                        BufferedImage.TYPE_INT_RGB);
                        final Graphics2D g2 = (Graphics2D) buf.getGraphics();
                        super.paint(g2);
                        final float f = 0.18f;
                        final int heightWidth = 3;
                        final float[] myKernel = { 0, f, 0, f, f, f, 0, f, 0 };

                        final ConvolveOp op = new ConvolveOp(new 
Kernel(heightWidth, heightWidth, myKernel));
                        img = op.filter(buf, null);
                        g2.dispose();
                        redraw = false;
                }
                g.drawImage(img, 0, 0, null);
        }

PS. How can I post nicely formatted code?
[Message sent by forum member 'uncletall' (uncletall)]

http://forums.java.net/jive/thread.jspa?messageID=286943

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to