• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with Focus when switching between JInternalFrames

 
Colleen Casey
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My application uses JInternalFrames. I'm having problems with the focus whenever I'm switching between the JInternal frames. I would appreciate any help.
Here's the scenario:
1. Display one JInternalFrame(#1) and it displays initial focus.
2. Bring up another JInternalFrame(#2) and it displays the initial focus.
3. Click on the original JInternalFrame (#1) & the focus is gone. You have to hit the tab key to get the cursor to appear.
4. Click on the other JInternalFrame (#2), and you have to hit the tab key to get the cursor to appear.
When switching, it's almost as if the focus is kind of there but the cursor isn't showing (or in the case of a button, the selection isn't showing). The same problem happens whenever I minimize & maximize the application.
FYI... I'm using JDK 1.2.2 and VA for Java 3.5
Thanks in advance!
 
Colleen Casey
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found one reason why I was having such problems with my cursor when flipping between JInternalFrames. It stems from code that is generated by VA for Java.
Our JInternalFrames use JTabbedPane. When you drop a JTabbedPane on the JInternalFrame, it creates a panel called Page. We were then dropping our created panels on this Page. Thus, we were creating a panel to hold our panel. So, focus was going to the Page panel and not where we wanted it to be.
We removed the Page panel and redropped our panel on the JTabbedPane. This eliminated about 95% of our problems. The cursor will now appear when we switch JInternalFrames most of the time. It appears that if we type something on a screen, we then get the cursor and focus appearing at the appropriate places. However, if we don't type anything, the focus is in the right place, but the caret isn't showing.
So, everything is better but we still have scenerios where the cursor is not appearing. If anyone has any ideas on how to fix this, please let me know. Thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!