thread用在一般类,runnable用在主类(有main方法的那个)

解决方案 »

  1.   

    java.awt.Insets
    public class Insets
    extends Object
    implements Cloneable, SerializableAn Insets object is a representation of the borders of a container. It specifies the space that a container must leave at each of its edges. The space can be a border, a blank space, or a title.
    JPanel panel = new JPanel();
            panel.setLayout(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.gridy = 0;
            gbc.insets = new Insets(5, 10, 5, 10);