Transparency issue again

Ive seen the numerous transparency threads come and go without really giveing any good information. Before I go on here is what I have so far:

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.*;

public class TransparentBackground extends JComponent
        implements ComponentListener, WindowFocusListener,
        Runnable {
    private String OS;
    public boolean easy;
    private JFrame frame;
    private Image background;
    private long lastupdate = 0;
    public boolean refreshRequested = true;
    public TransparentBackground(JFrame frame) { 
        this.frame = frame;
        OS = System.getProperty("os.name");
        
        if (OS.equals("Mac OS X")) {
            easy = true;
        }
        else {
            easy = false;
        }
        if (!easy) {
            updateBackground();
        }
        frame.addComponentListener(this); 
        frame.addWindowFocusListener(this);
        if (!easy) {
            new Thread(this).start();
        }
    }
    public void componentShown(ComponentEvent evt) { repaint(); }
    public void componentResized(ComponentEvent evt) { repaint(); }
    public void componentMoved(ComponentEvent evt) { repaint(); }
    public void componentHidden(ComponentEvent evt) { }

    public void windowGainedFocus(WindowEvent evt) { refresh(); }    
    public void windowLostFocus(WindowEvent evt) { refresh(); }
    
    
    public void updateBackground() {
        try {
            Robot rbt = new Robot();
            Toolkit tk = Toolkit.getDefaultToolkit();
            Dimension dim = tk.getScreenSize();
            background = rbt.createScreenCapture(
            new Rectangle(0,0,(int)dim.getWidth(),
                          (int)dim.getHeight()));
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    public void paintComponent(Graphics g) {
        Point pos = this.getLocationOnScreen();
        Point offset = new Point(-pos.x,-pos.y);
        if (!easy) {
            g.drawImage(background,offset.x,offset.y,null);
        }
        
        g.setColor(Color.BLUE);
        g.drawRect(10, 10, 10, 10);
    }
    
    
    public void refresh() {
        if(frame.isVisible()) {
            repaint();
            refreshRequested = true;
            lastupdate = new Date().getTime();
        }
    }  
    public void run() {
        try {
            while(true) {
                Thread.sleep(250);
                long now = new Date().getTime();
                if(refreshRequested &&
                    ((now - lastupdate) > 1000)) {
                    if(frame.isVisible()) {
                        Point location = frame.getLocation();
                        frame.hide();
                        updateBackground();
                        frame.show();
                        frame.setLocation(location);
                        refresh();
                    }
                lastupdate = now;
                refreshRequested = false;
                }
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    
    
    
    public static void main(String[] args) {
        JFrame frame = new JFrame("Transparent Window");
        frame.setUndecorated(true);
    
        TransparentBackground bg = new TransparentBackground(frame);
        bg.updateBackground();
        bg.setLayout(new BorderLayout());


        frame.getContentPane().add("Center", bg);
        frame.pack();
        if (bg.easy) {
            frame.setBackground(new Color(0, 0, 0, 0));
        }
        frame.setSize(200, 200);
        frame.setLocation(500, 500);
        frame.show();
    }
}


The problem is the detecting when it needs to take a new screenshot, and the horrible delay between hide/show of the window. I was thinking for detecting the time to take a new screenshot. I could get the absolute position of the mouse and check it every once in a while (10-20ish ms maybe), and if its moved a significant ammoung (some number of pixels) it updates the window. THe current way I do it is from an old book hacking swing or something like that, its pretty slow and terrible and deprecated.

And any way to grease it up so its not so terribly slow? Ive seen some apps using this technique that did a better job than I have here, I even tinkered with one but I deleted the source for some unknow reason. It had a bit of a flicker every 10 or so frames but that was much better than what I have.
It was a ghosty halloween thingy if I remember properly.