JSwing components don't appear until frame is resized [duplicate]
问题 This question already has an answer here : Java Layout not showing components (sometimes) (1 answer) Closed 3 years ago . bit of an issue. I'm trying to make a JSwing frame with a label, textfield, and two buttons. When the routine first runs, the buttons and the textframe are invisible. When I resize the frame, the buttons and textframe appear, and remain there when I return the frame to its original size. Any ideas why this is happening? 回答1: You should call setVisible(true) on your frame