Add a clear button for log content

This commit is contained in:
juewe 2024-06-25 07:16:59 +02:00 committed by GitHub
parent 3ae59a9809
commit 753edd83c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 0 deletions

View File

@ -86,6 +86,16 @@ public final class LogsPanelProvider {
clipboard.setContents(selection, null); clipboard.setContents(selection, null);
}); });
header.add(copyBtn); header.add(copyBtn);
JButton clearBtn =
new JButton(
MessageUtils.getLocalizedMessage("button.clear"));
clearBtn.setMargin(new Insets(3, 3, 3, 3));
clearBtn.addActionListener(
e -> {
logTextArea.setText(null);
});
header.add(clearBtn);
panel.add(header, BorderLayout.PAGE_START); panel.add(header, BorderLayout.PAGE_START);
panel.add(new JScrollPane(logTextArea), BorderLayout.CENTER); panel.add(new JScrollPane(logTextArea), BorderLayout.CENTER);