scala Slider throws casting exception
Posted
by coubeatczech
on Stack Overflow
See other posts from Stack Overflow
or by coubeatczech
Published on 2010-03-17T23:51:10Z
Indexed on
2010/03/18
2:31 UTC
Read the original article
Hit count: 299
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].
© Stack Overflow or respective owner