Skip to main content

on replace & static attributes

1 reply [Last post]
zandig
Offline
Joined: 2006-10-16
Points: 0

I have the following code block:

static attribute sliderValue : Integer = 0 on replace {
System.out.println("Slider value has changed: {sliderValue}");
};

When I try to compile it, I get the following compile error:

cannot find symbol:
symbol : method get$sliderValue()
location: interface mypackage.MyClass$Intf
static attribute sliderValue : Integer = 0 on replace {
1 error

If I change "static attribute" to just "attribute", I do not get the compile error, but this is not what I want. Why is this? Is this a bug or is there a way around this problem?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
michael_heinrichs
Offline
Joined: 2007-11-15
Points: 0

The static keyword is most likely going to be removed shortly. To get something like a static attribute, you have to move it outside the class.