This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
In a JInternalFrame, I have a JMenubar, JToolbar,JTable and other components. When the JTable loose focus i am supposed to validate the data in the JTable. It works fine when I clicks on the JToolbar (Focus from JTable is lost). But when I click on the JMenubar, the focus is not loosing. I tried setFocusable(true) for my JMenubar and jMenu and JMenuBar. but it does not work Thanks Sri
I am just going to guess here, but I think it may be because you set the MenuBar for the InternalFrame where as you set the ToolBar on the contentPane or JPanel of the InternalFrame. I think that when you are in the JTable and then click the JMenuBar the Focus is never technically "lost" from the JTable. This happens because there are times when you want a menu action to be performed on the currently focused component. For example, if you wanted to select a Cell and then do a copy and paste function, you wouldn't want to lose focus of the Cell when you clicked the Menu Options to perform your action. I know this is not a solution to your problem, but I think is has something to do with that. Maybe someone else can reiterate a more intelligent response than this. [ September 23, 2002: Message edited by: Gregg Bolinger ]