开发者

How to display frame within menu options window

开发者 https://www.devze.com 2023-02-18 00:00 出处:网络
I am developing a Java application 开发者_StackOverflowusing Swing.I am using menu bar in my application.Whenever I click a menu item I need to open a new panel/frame within the window containing menu

I am developing a Java application 开发者_StackOverflowusing Swing. I am using menu bar in my application. Whenever I click a menu item I need to open a new panel/frame within the window containing menu options.

To be precise I don't want to open a new window on clicking a menu item. What is the possible solution to this problem?

Thanks in advance.


If you want to put windows inside of other windows, you should look at JInternalFrame:

http://download.oracle.com/javase/tutorial/uiswing/components/internalframe.html


If you don't want to open a new window when clicking a menu item, CardLayout is a good choice. Also, don't overlook the convenience of using actions in your menus.

0

精彩评论

暂无评论...
验证码 换一张
取 消