I have a java Desktop application. For new module I designed a class which extends the JTextFields. I added four JTextFields in that class. I want to change the background color of these JTextFields, I used setBackground method. But the background color is not changed, JVM inherits the background color from my main application. How I will customize my new JTextFields? Please suggest a good solution.
Asked
Active
Viewed 146 times
0
-
1There is a similar question. Have a look at [this][1]. [1]: http://stackoverflow.com/questions/23106936/java-changing-a-jlabel-with-texts-stored-in-an-array/23107479#23107479 – Andy_Lima Jan 16 '15 at 12:35
-
1@VishwaDany, kindly share your relevant code for better help – Jan 16 '15 at 12:40
-
Remember to add `component.setOpaque(true)` – Ian2thedv Jan 16 '15 at 14:33
-
Why are you extending JTextField just to change the background color. There is no need to do this. Just invoke the setBackground(...) method on the text field. Please suggest a good solution. Post your [SSCCE](http://sscce.org/) that demonstrates the problem. There is now way we can help based on the information in your question – camickr Jan 16 '15 at 19:17