I have created a JToggleButton with the Netbeans editor, setHideActionText to True and added an Action. However, the Button displays without text at all, all I see is a small square (like a checkbox). The Text of the Button is set to “b” and the Action used is StyledEditorKit.BoldAction and I haven’t set any Icon.
If I don’t add the Action it’s working fine. Is this a bug or am I missing something (probably very stupid)?
Maybe more clearly:
I want the button to show the text that I set with setText, not the one I set with Action.putValue(Action.NAME, "Some Name") and I don’t want to display an Icon.
That’s the expected behaviour, as documented in the api of setHideTextAction (why-o-why don’t you read the javadoc, it’s there for a reason):
don’t touch the property and be happy 😉
Edit: seeing more clearly now – thanks for the clarification
To have a “sticky” (button defined only) text property, sequence of method calls matters (which shouldn’t be case .. but then ..) First that hideText