Duplicate :
|
|
Duplicate :
|
|
Duplicate :
|
|
Relates :
|
THE TEXT BELOW WAS FIXED FOR INACCURACIES - PLEASE RE-READ The spec for Component.getForeground() currently states: if this component does not have a foreground color, the foreground color of its parent is returned. Our customers and our internal J2ME implementation team were interpreting it that the foreground color is always inherited from the parent if it's not explicitly set. This interpretation doesn't match J2SE behavior for TextComponents, and the spec for setForeground() seems to hint that inheriting only happens if the child's foreground is set to null (explicitly or via a default value). The spec for getForeground() should say something like this instead: if this component HAS ITS foreground color SET TO NULL (EITHER EXPLICITLY OR BY DEFAULT), the foreground color of its parent is returned AND USED FOR RENDERING. Another issue is related to the default: which Components have nulls as defaults, and therefore implicitly inherit parent's settings. Sun's J2SE seems to have null defaults for all realized components except for TextComponents. This issue should be clarified in the spec as well. Third, it's unclear what inheriting from parent means when the component doesn't have a parent (such as Window). The spec should specifically cover this case. Finally, the exact same set of issues applies to background color. There might be other Component properties that have the same inheritance issues - if this is the case, we might want to cover them as well.
|