You're not wrong that it should "just work", but in order to actually do that we'd have to add a new property to the one-shot button with a different name and have the property selector use that. Doable, but low priority given the low rate of occurrence and the easy workaround. Plus, what do we name it? setValue2?
The underlying issue is that every component property has a getX and setX method, and there's no way for Jython to distinguish between a call to setValue() (meaning update the value property) and setValue (meaning give me the current set value of the component).
I was mistaken. setValue exists in the class as both a field and a method: Test Button Script:
oneShotButton = event.source.parent.getComponent('One Shot Button')
for field in oneShotButton.getClass().getDeclaredFields():
if field.name == 'setValue':
print 'Field Name = ', field.name
setValueField = field.get(oneShotButton)
print 'Field Type = ', type(setValueField)
for method in oneShotButton.getClass().getDeclaredMethods():
if method.name == 'setValue':
print 'Method Name = ', method.name
Field Name = setValue
Field Type = <type 'int'>
Method Name = setValue
Yeah. It's because Jython. Instead of requiring you to go to the class and reflectively look up the methods as Java does, Jython follows the Python model of allowing you to look up instance methods as first-class objects, so myClass.myInstanceMethod == bound method of myClass, and myClass.myInstanceMethod() == a call to that bound method. It doesn't show in the Javadocs because it's not "real", it's only there inside the Jython environment.
But it wasn't. You were conflating the setter for the value NetBeans property with the setValue property, whose setter is setSetValue(). But the two different NetBeans properties clash in jython because jython exposes both the native java methods and the implicit jython fields. Except it cannot in this case, due to the poor choice of name. (The setValue property could exist in this scheme if the value property did not exist.)
Yesterday, I was reading and replying to this from my phone, and everything looked good, but this morning, I was reading the forum from my computer, and uggh! ...that screenshot I posted of the setSetValue method rendered offensively large. The text is clear enough that the picture isn't necessary, so I've removed it. My apologies if that came across as obnoxious.