一帧中的两个不同面板-Java [英] Two Different Panels in One Frame - Java

查看:103
本文介绍了一帧中的两个不同面板-Java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题. 我有一个主框架,在左边有一个带有菜单的侧边栏. 我的问题是,是否可以在主框架中制作另一个面板, 因此,如果单击菜单1,则相关内容应显示在主框架的后半部分,而当按下其他菜单时,则根据选择的内容显然是相关内容.有点难以解释,对不起.有谁知道,是否可以在Java中使用Eclipse?

I have a question. I have one main frame, and to the left i have a sidebar with menus. My question is, is it possible to make another panel within the main frame, so that if menu1 is clicked, the related contents should be displayed to the second half of the main frame, and when other menus are pressed then obviously the relevant stuff according to what is selected. its a bit hard to explain, sorry. Has anyone got an idea, whether that is possible in Java with Eclipse?

推荐答案

是的,您很有可能查看了 LayoutManager 可以为实现 JPanel JFrame

yes this's pretty possible you have look at CardLayout, this LayoutManager could be provide the simple way how to implement switching betweens JPanel in the JFrame

这篇关于一帧中的两个不同面板-Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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