Scala swing 2.8 how do I set the background color of a Slider?
Question
How can I set the background color of a Slider in Scala Swing 2.8 final. I copied the UIDemo object provided in the distribution for my tests and added
background = java.awt.Color.RED
but that does not take effect on my mac.
object UIDemo extends SimpleSwingApplication {
...
object slider extends Slider {
min = 0
value = tabs.selection.index
max = tabs.pages.size-1
majorTickSpacing = 1
background = java.awt.Color.RED
}
...
}
I had in mind that this was working before - did I miss something along the way?
Thanks, Paul
Solution
Chance is that opaque
property is set to false, i.e. it is transparent. Set it back to true for background to show up.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow