WindowConstants
is defined as this:
public interface WindowConstants
{
public static final int DO_NOTHING_ON_CLOSE = 0;
public static f
In Java 1.3, when this was all added, EXIT_ON_CLOSE
was relevant only to JFrame
and not to other implementations of WindowConstants
. As such - it was not present in WindowConstants
and was defined in JFrame
. The 3 other XXX_ON_CLOSE
options were in the interface. (English Javadoc is not online anymore, though still downloadable, so no reference here. If you search for "WindowConstants Java 1.3" you'll get a Japanese version of the Javadoc - but since the page structure is the same, you can still see the point)
It was later (1.4) moved to WindowConstants
, however the field was not removed from JFrame
due to compatibility issues.
There is no redefining there. What's happening is shadowing. I.e. the JFrame
field hides (but does not eliminate) the WindowConstants
field.