在 NetBeans 中检测设计时间

发布于 2024-08-10 20:36:30 字数 403 浏览 2 评论 0原文

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

public CustomComponent() {
    initComponents();

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

基本上我正在寻找类似.net的组件.设计模式

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜是你 2024-08-17 20:36:30

尝试:

java.beans.Beans.isDesignTime()

Try:

java.beans.Beans.isDesignTime()
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文