0
我想知道添加覆蓋整個JFrame的JPanel的正確語法。如何將JPanel添加到JFrame中
這裏是我迄今編寫的代碼:欲瞭解更多信息請閱讀Swing tutorial
package frame;
import javax.swing.JFrame;
public class Frame {
public static void main(String[] args) {
JFrame Frame = new JFrame("My Window");
Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Frame.setVisible(true);
Frame.setSize(320, 240);
Frame.setResizable(false);
Frame.setLocationRelativeTo(null);
//Thanks in advance
}
}