scala Slider throws casting exception
- by coubeatczech
hello, I create an Slider object:
val slider = new Slider{
min = 0
max = 30
labels = Map(0 -> new Label("Nula"),15-> new Label("Pul"),30-> new Label("Max"))
paintLabels = true
}
when I run this, an exception is thrown:
scala.swing.Label cannot be cast to java.awt.Component
but why?
When i browse the docs, the excpected type for labels is a Map[Int,Label].