Java Swing : why must resize frame, so that can show components have added
问题 I have a simple Swing GUI. (and not only this, all swing GUI I have written). When run it, it doesn\'t show anything except blank screen, until I resize the main frame, so every components have painted again, and I can show them. Here is my simple code : public static void main(String[] args) { JFrame frame = new JFrame(\"JScroll Pane Test\"); frame.setVisible(true); frame.setSize(new Dimension(800, 600)); JTextArea txtNotes = new JTextArea(); txtNotes.setText(\"Hello World\"); JScrollPane