my JToolbar
is not displaying the background color even after I set the it from the Netbeans GUI Designer. The code to set the background color is even included in the autogenerated code. What could be wrong?
Asked
Active
Viewed 1,469 times
1

ken
- 299
- 3
- 15
- 32
-
can you please add a snippet of your code ? – Dec 01 '12 at 17:03
-
Can you please check with `jtoolbar.isBackgroundSet` if a background is set ? – Dec 01 '12 at 17:11
-
1Thanks @ALJIMohamed for the reply. Actually you've helped me notice that the set background code is not autogenerated. What could be the problem really seems in the gui editor background color is set but the code is not generated? – ken Dec 01 '12 at 17:13
-
maybe you are using the **default color** and there is no need to generate _more_ codes to do that. – Dec 01 '12 at 17:17
-
Actually `jtoolbar.isBackgroundSet` shows false. What do you mean by "default colode"? – ken Dec 01 '12 at 17:19
-
I mean *default color*. Suppose that you mention the background color to be **black**, and that black is set by default. the Gui editor decide not to add a `setBackgroundColor`. try to guess it using `getBackgroundColor`. – Dec 01 '12 at 17:24
-
I changed the color myself and it even displays in the editor. Is there something with netbeans 7 maybe? – ken Dec 01 '12 at 17:27
-
let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/20449/discussion-between-alji-mohamed-and-ken) – Dec 01 '12 at 17:28
1 Answers
2
You may want to set the background color by yourself if the GUI Editor did'nt generate it correctly. Try using setBackground
. The Javadoc of this method is here.
-
Ok. I accept this answer because it helps do what I want but I would like to know why the gui editor didn't generate the code. I really want to use the editor because it organizes my code well – ken Dec 01 '12 at 17:23
-
keep using the _GUI Editor_ , my answer is this comment : http://stackoverflow.com/questions/13661544/jtoolbar-not-displaying-background-color?answertab=votes#comment18749027_13661544 – Dec 01 '12 at 17:25