JMenu extending class behaves weird

I have extended JMenu and overwritten getText and setText to get proper Locale dependent behaviour and to enforce future users to use locale independent programming.

Due to that the text you enter into settext and get from getText is not the text that ought to be displayed.

Now my problem is that somewhere during displaying my getText method is called and the result is written to the supers setText. therefore the not to be displayed string appears. (I checked that returning a constant string via getText, that apeared nowhere else in my programm and it got written on all the menues)

Any idea how to fix that or what i did wrong?

[666 byte] By [arcosh] at [2007-9-26 1:59:47]
# 1

Sounds like this might be a problem in the menu UI delegates. You may have to create UI delegates that behave according to your rules of processing.

I would examine BasicMenuUI very carefully to see if there is some extraneous routing of property handling that might be giving you trouble.

Mitch Goldstein

Author, Hardcore JFC (Cambridge Univ Press)

mdgoldstein@hotmail.com

mitchg at 2007-6-29 3:19:26 > top of Java-index,Archived Forums,Swing...
# 2
I got the same problems with JButton and JLabelwhen overwriting getText()There is nothing in the API-DOC saying that getText() should not be overwritten.
christoph.gille@charite.de at 2007-6-29 3:19:26 > top of Java-index,Archived Forums,Swing...