How to set divider location for JSplitPane on start-up
问题 I have JPanel which contains JSplitPane. The JPanel is injected during a runtime into a JFrame using the method invokeAndWait. Then the invokeLater is called to update divider location in SplitPane. The problem is, when the divider update is invoked, JPanel width is still 0. When I add sleep or a breakpoint anywhere in the code (except the invokeLater), the code works fine. final JPanel viewPanel = new JPanel(); viewPanel.setLayout(new BorderLayout()); final JPanel header = getPresenterHeader