在NetBeans中检测设计时间 [英] Detect design time in NetBeans

查看:200
本文介绍了在NetBeans中检测设计时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在NetBeans中使用Swing图形编辑器时,自定义组件能否检测到它的设计时间?例如

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");
    }
}

基本上,我喜欢.net的 Component.DesignMode

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

推荐答案

尝试:

java.beans.Beans.isDesignTime()

这篇关于在NetBeans中检测设计时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆