Dear all,
googling quite a good deal didn't reveal an answer for a question which should be interesting many people:
Doing Java->Scala conversions, I several times stumbled over impossibility to access Scala class fields from Java code – with messages like
"java.lang.IllegalAccessError: tried to access field somePackage.SomeClass.x from class OtherClass"
or
"error: defaultFont has private access in SomeClass,"
though both field were actually public in their Scala classes:
case class Location(var x:Int, var y:Int) extends Serializable {
class GridWorldView(model:GridWorldModel) extends JFrame {
...
var defaultFont:Font= new Font("Arial", Font.BOLD, 10)
As I nowhere read this to be prohibited, and even fiddling around led to inconclusive results, e.g. model was readable, even when move down,
class GridWorldView() extends JFrame {
...
var defaultFont:Font= new Font("Arial", Font.BOLD, 10)
var model:GridWorldModel= _
So finally, I've become curious:
o are there specs I have overseen forbidding this?
o if no, did anybody here experience success doing it? (how...??)
o if yes, did anybody here experience similar problems?
o is there a place where such issues are discussed?
Thank you a lot in advance, Nick