Auto-scroll when creating logs
This commit is contained in:
parent
3deddf3af6
commit
55e58b542d
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user