Java框架:如何将一个Jframe用于多种用途 [英] Java Frame: How to use one Jframe for many purposes

查看:98
本文介绍了Java框架:如何将一个Jframe用于多种用途的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早上的家伙。

我想知道是否可以将一个Jframe用于多种用途。

例如,如果我点击addnew按钮,标题为newclient open的框架;当我点击编辑按钮时,同一帧打开但不同的标题editclient。

两个帧相似,除了标题和保存和编辑按钮。



谢谢。亲切的问候

Morning guys.
I would like to know if it''s possible to use one Jframe for many purposes.
For example, if i click on addnew button, the frame titled newclient open; and when i click edit button, the same frame open but a different title editclient.
the both frames are similar except the title and the save and edit button.

thanks. kind regards

推荐答案

你需要使用Panels。你可以切换面板。



当你在可视组件上创建一个应用程序ontop时,你会有更多的otpions。



另外请考虑使用框架 - 有一些可以帮助您。

因为您还需要一些应用程序生命周期和一些数据存储。
You need to use Panels. You can switch the Panel.

When you create a Application ontop of the visual components you''ll have much more otpions.

Also please think about using a Framework - there are some out there that help you.
Cause you will also need some Application lifecycle and some data storage.


这篇关于Java框架:如何将一个Jframe用于多种用途的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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