ここにコードがあり、いくつかのコマンドが何をするのかわかりません:
//this bit is the body of the main method
//lots of stuff omitted
project frame = new project();
frame.createGUI();
private void createGUI() {
setDefaultCloseOperation(EXIT_ON_CLOSE);
panel = new JPanel();
}
が呼び出さframe.createGUI();れると、 の 2 つのコマンドはどうなるcreateGUI();でしょうか。彼らは
setDefaultCloseOperation(EXIT_ON_CLOSE);
panel = new JPanel();
また
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
frame.panel = new JPanel();
それともまったく別のものですか?私は Java の初心者で、今年は 12 年目のコンピューター サイエンスを始めましたが、クラスよりも少し進んでいます。
御時間ありがとうございます!