AquaUtilControlSize.java 文件源码

java
阅读 49 收藏 0 点赞 0 评论 0

项目:OpenJSharp 作者:
private static void applyUISizing(final JComponent c, final Size size) {
    try {
        // see if this component has a "getUI" method
        final Class<? extends JComponent> clazz = c.getClass();
        final Method getUIMethod = clazz.getMethod("getUI", new Class[0]);

        // see if that UI is one of ours that understands sizing
        final Object ui = getUIMethod.invoke(c, new Object[0]);
        if (!(ui instanceof Sizeable)) return;

        // size it!
        final Sizeable sizeable = (Sizeable)ui;
        sizeable.applySizeFor(c, size);
    } catch (final Throwable e) { return; }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号