[問題] super.setLayout(null)的super
書本的範例,我有省略程式碼
我把塗色的「super.」拿掉
run起來也是一樣結果
那麼為什麼範例要加super.呢?
thanks
class MyJFrame extends JFrame {
ImageIcon[] icons = new ImageIcon[5];
JButton[] jbtn = new JButton[8];
MyJFrame() {
super.setLayout(null);
super.setTitle("Test");
(略)
setSize(430, 360);
setVisible(true);
}
}
public class Main {
public static void main(String[] args) {
new MyJFrame();
}
}
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.163.106.192
※ 文章網址: http://www.ptt.cc/bbs/java/M.1406270200.A.572.html
→
07/25 14:38, , 1F
07/25 14:38, 1F
推
07/25 15:26, , 2F
07/25 15:26, 2F
※ 編輯: dharma (118.163.106.192), 07/26/2014 12:40:42
java 近期熱門文章
PTT數位生活區 即時熱門文章