How to display frame within menu options window
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.
精彩评论