JFrame add scrollbar
问题 I've tried a few tutorials and had a look at other answers but it still doesn't seem to help me, I want to add a scrollbar to this console-like JTextArea, and keep the property whereby each new line of text will push the rest up. This is what it looks like currently: And the code: Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); int width = 600; int height = 400; JFrame frame = new JFrame("ChanDown"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel panel = new JPanel