English 中文(简体)
使用 NetBeans 图形界面改变 JFrame 内部的 JFrame 配方
原标题:Change JPanels within JFrame using NetBeans GUIBuilder

我在NetBeans制作一个 GUI 工程。 我有一个 JFrame 和 3 个 JPanel 。 一次只能显示其中的一个 JPanel 。 显示的 JPanel 应用菜单选项修改( 听众工作) 。

我的问题是,我如何把它们切掉?我如何把它们切掉?我曾经尝试过去除旧的JPanel, 并插入新的JPanel。我曾经尝试过在 JFrame 中添加第四个JPanel, 并且所有三个JPanel都存在于第四个 JFrame 中, 这样我就可以使用 < code> removeall < () removeAll (错误技术) (错误) < removeall > (但是我绝望了) 。我尝试过改变对象引用, 以便它指向新的JPaveel, 而不是旧的。 在每一个案例中, 我完成了代码的剪切。

    revalidate();
    repaint();

没有效果。 我见过很多关于 < code> CardLayout 和 < Code> GroupLayout 的话题, 但我不知道如何使用 NetBeans GUIBuilder 来实施这些话题。 你们中是否有人能告诉我如何切换 JPanel?

最佳回答

使用层版Pane 。 30 charactermin

问题回答

暂无回答




相关问题
Netbeans CVS - existing repo - existing working copy

I m using Netbeans to develop with Drupal. I m trying to let Netbeans get drupal core and modules from the repository on drupal.org to my local working copy. Problem is: I already have a working ...

Java Library and Class Path Problems

Quick personal background: I was hired a few months ago as the sole .NET developer (C#) by a company whose other devs are all php devs. A week into the job I was told they wanted to switch to Java ...

Privileged operations in netbeans mobility

I m writing a Java ME app that will use privileged operations such as messaging. By default the user is prompted to confirm each of these operations, but I would like to run it as a background ...

Running unit tests on both windows and linux

Is there a way, a method, to be able to effectively run unit tests (phpunit) on both linux and windows? I need to do this because some parts of the system is only available under linux, but i do want ...

Dependency bundle (jar-files/sources/API docs) in Eclipse

I m developing various in-house extensions for JIRA, the issue tracker we use. So far I worked with Netbeans and everything worked like a charm. However, now I need to switch to Eclipse and I m ...

热门标签