maxxy
maxxy

Reputation: 23

Resetting the background color of jtextfield that has been changed

I have a set of jtextfields. Now, there are two different background colors i've used, the null and white.

I also have a highlighter which changes the clicked textfield (given that it is enabled) to green when focused.

My problem is when the focus is lost, I cant seem to revert its original color.

Is there any method that gets the color of the jtextfield so I can store it and pass it when the focus is lost?

Upvotes: 0

Views: 279

Answers (1)

Carls
Carls

Reputation: 30

public Color getBackground()

Gets the background color of this component. Returns this component's background color. If this component does not have a background color, the background color of its parent is returned.

Upvotes: 1

Related Questions