开发者

Scala swing 2.8 how do I set the background color of a Slider?

开发者 https://www.devze.com 2023-01-08 09:00 出处:网络
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

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


Chance is that opaque property is set to false, i.e. it is transparent. Set it back to true for background to show up.

0

精彩评论

暂无评论...
验证码 换一张
取 消