mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-20 12:42:06 +02:00
Auto-scroll when creating logs
This commit is contained in:
@@ -24,6 +24,7 @@ import javax.swing.JTextField;
|
|||||||
import javax.swing.JTextPane;
|
import javax.swing.JTextPane;
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
import javax.swing.text.BadLocationException;
|
import javax.swing.text.BadLocationException;
|
||||||
|
import javax.swing.text.DefaultCaret;
|
||||||
import javax.swing.text.SimpleAttributeSet;
|
import javax.swing.text.SimpleAttributeSet;
|
||||||
import javax.swing.text.StyleConstants;
|
import javax.swing.text.StyleConstants;
|
||||||
import javax.swing.text.StyledDocument;
|
import javax.swing.text.StyledDocument;
|
||||||
@@ -139,6 +140,8 @@ public class MainWindow implements Runnable {
|
|||||||
logPanel.setVisible(false);
|
logPanel.setVisible(false);
|
||||||
logPanel.setPreferredSize(new Dimension(300, 300));
|
logPanel.setPreferredSize(new Dimension(300, 300));
|
||||||
logPanel.add(logTextScroll, gbc);
|
logPanel.add(logTextScroll, gbc);
|
||||||
|
DefaultCaret caret = (DefaultCaret) logText.getCaret();
|
||||||
|
caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
|
||||||
|
|
||||||
historyPanel = new JPanel(new GridBagLayout());
|
historyPanel = new JPanel(new GridBagLayout());
|
||||||
historyPanel.setBorder(emptyBorder);
|
historyPanel.setBorder(emptyBorder);
|
||||||
|
Reference in New Issue
Block a user