fixed focus in binary/hex mode

This commit is contained in:
rdavidek 2026-03-22 18:15:56 +01:00
parent a1b110628a
commit cabaa8e6e6

View File

@ -810,6 +810,7 @@ public class FileEditor extends JFrame {
}
hexControlPanel.setVisible(true);
northPanel.revalidate();
SwingUtilities.invokeLater(() -> textArea.requestFocusInWindow());
} else {
// switch back to text view if possible
// close RA if open
@ -971,6 +972,7 @@ public class FileEditor extends JFrame {
if (hexControlPanel.getParent() == null) northPanel.add(hexControlPanel);
hexControlPanel.setVisible(true);
northPanel.revalidate();
SwingUtilities.invokeLater(() -> textArea.requestFocusInWindow());
} else if (hexMode) {
buildHexViewText(0L);
} else {
@ -1024,6 +1026,7 @@ public class FileEditor extends JFrame {
textArea.setEditable(false);
textArea.setFont(new Font("Monospaced", Font.PLAIN, textArea.getFont().getSize()));
hexMode = true;
SwingUtilities.invokeLater(() -> textArea.requestFocusInWindow());
} else {
// Small or text file: load fully
fileBytes = Files.readAllBytes(file.toPath());
@ -1037,6 +1040,7 @@ public class FileEditor extends JFrame {
if (hexControlPanel.getParent() == null) northPanel.add(hexControlPanel);
hexControlPanel.setVisible(true);
northPanel.revalidate();
SwingUtilities.invokeLater(() -> textArea.requestFocusInWindow());
} else if (hexMode) {
buildHexViewText(0L);
} else {