Detect design time in NetBeans

孤人 提交于 2019-12-21 21:27:45

问题


When using the Swing graphical editor in NetBeans is it possible for a custom component to detect that it's design time? E.g.

public CustomComponent() {
    initComponents();

    if (!isDesignTime()) {
        someIcon = IconFactory.loadIcon("icons/SomeIcon.png");
    }
}

Basically I'm after something like .net's Component.DesignMode


回答1:


Try:

java.beans.Beans.isDesignTime()


来源:https://stackoverflow.com/questions/1705656/detect-design-time-in-netbeans

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!