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

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?

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.

1 Like

Found the error, apparently intelliJ had imported :man_shrugging:

javax.swing.text.html.ImageView