Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Type mismatch on TableView example

Tags:

scalafx

I got another weird error trying out the examples from the scalafx-repo. This time I copied the whole file. But I still got the following error:

Error:(26, 11) type mismatch;
 found   : scalafx.scene.control.TableColumn[hello.Person,String]
 required: javafx.scene.control.TableColumn[hello.Person, ?]
          new TableColumn[Person, String] {
          ^

I wonder why this ScalaFX object requires a JavaFX object. The approach was like this. I cloned the hello-world from the scalafx-repository.

like image 379
Mario P. Waxenegger Avatar asked May 15 '26 21:05

Mario P. Waxenegger


1 Answers

The problem is that the implicit conversion from ScalaFX's TableColumn to JavaFX's TableColumn is not in scope. Add import TableColumn._ to your list of imports and you should be fine.

like image 157
DG2 Avatar answered May 19 '26 04:05

DG2



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!