gpt4 book ai didi

java - 用按钮链接 2 个 jForms - java

转载 作者:行者123 更新时间:2023-12-01 13:40:22 25 4
gpt4 key购买 nike

我的项目中有 2 个 JForms,我正在尝试使用按钮将一个链接到另一个,因此一旦单击按钮,它就会显示 JForm,我的表单被调用;

家庭商店

这是我到目前为止的代码;

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
storeform = new store();
form.setVisible(true);
}

最佳答案

I have 2 JForms in my project and I'm attempting to link one to the other with a button so once the button is click it display the JForm, my forms are called;

  • 使用CardLayout阅读链接的 Oracle 教程以获取工作代码示例,而不是使用两个 JForm

  • 卡切换后调用JFrame.pack()

关于java - 用按钮链接 2 个 jForms - java,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20858153/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com