Skip to content

Commit 34bff63

Browse files
Fix F1 help focus issue in InterestPointExplorer
The F1 help key wasn't working until the user clicked on the table. This commit fixes that by: - Making the panel focusable with setFocusable(true) - Adding mouse listeners to automatically request focus when: * Mouse enters the panel area * Mouse is pressed/clicked anywhere in the panel Now F1 works immediately when you hover or click anywhere in the InterestPointExplorer window, without requiring a table row click first. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a28ad01 commit 34bff63

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/main/java/net/preibisch/mvrecon/fiji/spimdata/explorer/interestpoint/InterestPointExplorerPanel.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ public InterestPointExplorerPanel( final ViewInterestPoints viewInterestPoints,
8989
this.delete = new ArrayList< Pair< InterestPoints, ViewId > >();
9090

9191
this.viewSetupExplorer = viewSetupExplorer;
92+
93+
// Make the panel focusable to receive key events
94+
setFocusable( true );
95+
9296
initComponent( viewInterestPoints );
9397
}
9498

@@ -440,6 +444,25 @@ public void mouseClicked(MouseEvent e)
440444

441445
addPopupMenu( table );
442446
addHelpListener( table );
447+
448+
// Request focus on this panel when the mouse enters, so F1 works
449+
this.addMouseListener( new MouseListener()
450+
{
451+
@Override
452+
public void mouseReleased(MouseEvent e) {}
453+
454+
@Override
455+
public void mousePressed(MouseEvent e) { requestFocusInWindow(); }
456+
457+
@Override
458+
public void mouseExited(MouseEvent e) {}
459+
460+
@Override
461+
public void mouseEntered(MouseEvent e) { requestFocusInWindow(); }
462+
463+
@Override
464+
public void mouseClicked(MouseEvent e) {}
465+
});
443466
}
444467

445468
protected void addHelpListener( final JTable table )

0 commit comments

Comments
 (0)