- 6
- 0
- 约1.07万字
- 约 19页
- 2017-08-31 发布于河南
- 举报
java中轻松实现界面跳转(Easy interface jump in Java)
java中轻松实现界面跳转(Easy interface jump in Java)
If such a situation, we use the javax.swing package to build the system interface, the interface is based on the BaseView, he is a container, of course he should provide access control element function, like buttons, drop-down box, table, of course, is just a container, we deploy all elements of the interface in JPanel.
Describe as:
An interface is a BaseView, which contains only one JPanel, which contains JPanel, including all of our Swing controls, such as JButton, JLable, and so on.
The question arises: we usually need to complete a business because the interface will automatically jump to the next interface, a complete interface and can jump back (P.S. because our operation is based on the GUI, so often can save Session information, and Web do not), which is often a system to achieve a factor of low efficiency in the process, I will see my current system used in a judgment on 600 lines of code interface should be which one to jump over, because many interfaces can jump to the current interface.
Of course, theres a way to include variables that point to the last interface in the next interface class, which we say is inconvenient and dependent, which is bad for software.
Next, I give my solution, and I hope it will be beneficial to friends who use this interface structure.
(all of the following are described in simplified models.)
1., simply, lets assume that BaseView inherits JWindow, and of course it can be other containers (depending on your implementation), presumably like this:
Public, abstract, class, BaseView, extends, JWindow{
...
(to achieve some interface control and interface information)
}
2. each interface class is defined like this:
Public, class, MyView, extends, BaseView{
JPanel myPanel;
Public, void, playoutPanel () {
JButton myButton = new JButton (OK);
MyPanel.add (myButton);
......
(add the controls and layout you need to myPanel.)
}
}
3. assume that there are other interfaces OneView, TwoView, ThreeVi
您可能关注的文档
- 20篇作文(20 compositions).doc
- 2014最新阳泉交通公示(2014, the latest Yangquan traffic publicity).doc
- 210个字谜灯谜(210 puzzle lantern riddles).doc
- 21世纪想成功必看的——网商经(Twenty-first Century - net business must want to succeed).doc
- 21招 让脂肪燃烧大提速(21 strokes so that fat burning speed).doc
- 21yod 2011-8-24 74632 药店名称订单总数发货数甘肃德生堂医药(21yod 2011-8-24 74632 the total number of orders shipped Gansu drugstore name deshengtang medicine).doc
- 2014香港标杆房企住宅、豪宅、别墅及商业地产考察(9月26-28日)(2014 Hongkong benchmark housing prices, residential, luxury, villas and commercial real estate inspection (September 26-28)).doc
- 220th水冷方形分离器循环流化床锅炉的设计及运行(Design and operation of 220th water-cooled square separator circulating fluidized bed boiler).doc
- 23万余条意见里的百企业培训姓视角 个税改革三大焦点(More than 23 views of 100 enterprises training, surname perspective, tax reform focus of three).doc
- 23万余条意见里的百姓视角 个税改革三大焦点(More than 23 views of the people in the views of three major focus of tax reform).doc
- 小区绿化施工协议书.docx
- 墙面施工协议书.docx
- 1 古诗二首(课件)--2025-2026学年统编版语文二年级下册.pptx
- (2026春新版)部编版八年级道德与法治下册《3.1《公民基本权利》PPT课件.pptx
- (2026春新版)部编版八年级道德与法治下册《4.3《依法履行义务》PPT课件.pptx
- (2026春新版)部编版八年级道德与法治下册《6.2《按劳分配为主体、多种分配方式并存》PPT课件.pptx
- (2026春新版)部编版八年级道德与法治下册《6.1《公有制为主体、多种所有制经济共同发展》PPT课件.pptx
- 初三教学管理交流发言稿.docx
- 小学生课外阅读总结.docx
- 餐饮门店夜经济运营的社会责任报告(夜间贡献)撰写流程试题库及答案.doc
最近下载
- 黑龙江省园林绿化工程消耗量定额2024版.docx VIP
- N—乙酰氨基葡萄糖合成方法的改进.pdf VIP
- L-CKC L-CKC 220工业闭式齿轮油 工业润滑剂 220 说明书.pdf
- 2025年春人教版历史七年级下册全册教学课件.pptx
- 自考14653《证券投资理论与实务》高频考点串讲.docx VIP
- 2026年湖南安全技术职业学院单招职业技能考试题库及完整答案详解一套.docx VIP
- 新城商开事业部产品配置标准及成本控制手册(2020版).pdf VIP
- 四川大学《通信原理》期末试题B卷.docx VIP
- 2024年度实验室CNAS内审全套资料.pptx VIP
- 2026年度护理人员培训计划(两篇).docx VIP
原创力文档

文档评论(0)