I originally posted this on the java.sun forums, http://forums.sun.com/thread.jspa?threadID=5361214&tstart=45, but was looking for a bit more help. Basically I'm drawing a custom jtextfield with a gradient background. The problem comes when text is actually being put into the textfield the cpu jumps and the performance is awful. Im assuming its from the textfield being redrawn with the gradient each time a letter is entered. I dont know the proper way to get around this, and in my previous post on the java.sun forums they had mentioned using a bufferedImage to draw onto, however I fairly new to swing and do not know how to implement that with a jtextfield...here is the code:
If anyone could show me a better way of doing this, or simply how to solve this problem using a bufferedImage i would appreciate it.
("Anger is not an emotion, its a symptom of fear.")
Ernest: The amount of time saved from those things is marginal compared to what is happening. I've tried What Michael Dunn proposed and that seems to work good for now, though it feels very hackish. Either way its much much better than the other way.