Kotlin "val cannot be reassigned" except that I defined my variable as var


#1

Working with javafx and came across this weird error:

Apparently imgPreviewShow is a val even though I clearly said it’s a var?

How do I fix this?


#2

The problem is not the imgPreviewShow but the image property of ImageView.

However, ImageView.image is mutable so I don’t understand why that error is showing…

I’ll try to check it later in my pc.


#3

Found the error, apparently intelliJ had imported :man_shrugging:

javax.swing.text.html.ImageView