我想知道为什么当我在不调整窗口大小的情况下输入此代码时,我什么也看不到:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class GolfScoresGUI
{
public static void main(String[] args)
{
JFrame frame = new JFrame("GolfScoresGUI");
JLabel label = new JLabel("Did you score it? ");
JTextField textField = new JTextField(10);
frame.setVisible(true);
frame.getContentPane().add(textField);
}
}