aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes jmenubar,menuitem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "jmenubar,menuitem" Watch "jmenubar,menuitem" New topic
Author

jmenubar,menuitem

purushotham naisa
Greenhorn

Joined: Oct 27, 2011
Posts: 2
sir i have a problem on my project.in my project i was used Jmenubar, menuitems it is not refresh based on the component now i am looking for a solution that is whenever user selected one menu item corresponding result will be displayed on same frame
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> sir i have a problem

probably just me, but your desciption gives
me no idea what the problem is.

if you post your code and explain what it does
do vs what you want it to do, we/i might
get a better grasp of the problem.
purushotham naisa
Greenhorn

Joined: Oct 27, 2011
Posts: 2
Michael Dunn wrote:> sir i have a problem

probably just me, but your desciption gives
me no idea what the problem is.

if you post your code and explain what it does
do vs what you want it to do, we/i might
get a better grasp of the problem.




ok sir just wait i am sending my code

this is my code
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
the basic problem is whenever you add anything to a container that is visible, you need to call:

[container].revalidate();
[container].repaint();

or, for awt

[container].validate();
[container].repaint();

but, going by your menuItems, you would probably be better off setting up the app as a CardLayout,
pre-building each panel, then just 'show' the panel relevent to the menuItem clicked.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jmenubar,menuitem