Hi,

        A menu that has for example, "small, medium, large". We
        have several different font sizes within the application
        so we set them all relative to a user specified standard
        (i.e. if "medium" maps to size 17, we use 13,15,17,19,
        if "large" maps to 21, we use 17,19,21,23, or whatever).

        When the user changes the font, we are using UIManager.put
        of font (UIResource) properties, and then calling
        SwingUtilities.updateComponentTreeUI, which ultimately
        ends up calling setFont( new UI resource font ) on all
        components in the application.

        We don't want all JLabels to have the same font. If we
        subclass JLabel to make a label specific to certain
        components, it still uses the same UI property "Label.font".
        The property it uses is not configurable. We certainly don't
        want to start subclassing all of the UIs for this purpose,
        as that would be a maintenance nightmare. Shouldn't these
        property names in the UIs be configurable?

        What we decided to do is override setFont( font ) in our
        subclasses and have it look up its font in the UI table,
        (eg "OurLabel.font") and then use that font instead of
        the one passed in.

        Any comments on our conclusions? Are we missing a better,
        more elegant way? Does anything about our approach stand
        out as a bad idea?

        Thanks... Roger

_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to