Hi,
There is probably no "desired way" about this.
The only advantage I see for using public constants, is when you write your
own PropertyChangeListener :
someClass.EVENT_DEFAULT_CLOSE_OPERATION, for instance, could then be used
by both the firing process and the listener, rather than using a
typo-error-prone string.
Regards,
Arnaud
> Some swing classes use a string in the firePorpertyChange method for
> instance, JFrame's
[quoted text clipped - 4 lines]
>
> Which way is desired?
John McGrath - 11 May 2005 15:52 GMT
> The only advantage I see for using public constants, is when you write
> your own PropertyChangeListener :
>
> someClass.EVENT_DEFAULT_CLOSE_OPERATION, for instance, could then be
> used by both the firing process and the listener, rather than using a
> typo-error-prone string.
I use constant (public static final) strings for exactly that reason.
In my opinion, it is always a good idea to write code in such a way to
decrease the chance of errors.

Signature
Regards,
John McGrath