JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Java SE 討論區  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友   
reply to postflat modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 Re:needs to be declared final?? [Re:Eva]
Duncan

還隱隱作痛

版主

發文: 7816
積分: 39
於 2003-08-04 00:26 user profilesend a private message to usersend email to Duncanreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Eva wrote:
我也想問大大一個問題
為什麼他這個程式 不能用
用setVisible(true) 放在MoveCircle()裡
取代掉f.show();

會根本沒出現window 然後 大概三秒鐘後 程式就結束了

可是我平常寫程式 都是在constructor 裡 放 setVisible(true);
是因為這個程式不是extends JFrame的關係嗎??


因為 MoveCircle 只是一個 JComponent,並不是一個 top level 的 container(Window/Frame/Dialog)。component.setVisible(true) 不見得能秀出 component,必須其上層的 top level container 先 visible 才行,要有 top level container 提供一塊畫布(native device context)讓 child component 畫出自己。


Duncan edited on 2003-08-04 13:02
reply to postreply to post

給我
辣味豆腐 其餘免談
話題樹型展開
人氣 標題 作者 字數 發文時間
6857 needs to be declared final?? missee 1957 2003-07-31 22:14
5565 Re:needs to be declared final?? Yoshi 441 2003-07-31 22:41
5056 Re:needs to be declared final?? Eva 156 2003-08-03 09:06
4985 Re:needs to be declared final?? missee 93 2003-08-03 23:17
4914 Re:needs to be declared final?? missee 494 2003-08-03 23:32
8745 Re:needs to be declared final?? Duncan 1616 2003-08-04 00:21
4873 Re:needs to be declared final?? Eva 194 2003-08-04 00:18
5847 Re:needs to be declared final?? Duncan 470 2003-08-04 00:26
4813 Re:needs to be declared final?? missee 24 2003-08-04 01:26
4877 Re:needs to be declared final?? Eva 14 2003-08-04 03:31
5022 Re:needs to be declared final?? worookie 41 2003-07-31 23:57
4917 Re:needs to be declared final?? missee 1454 2003-08-01 00:53
7522 Re:needs to be declared final?? Duncan 283 2003-08-01 01:58
4942 Re:needs to be declared final?? missee 1540 2003-08-01 02:37
4903 Re:needs to be declared final?? Eva 209 2003-08-01 04:07
4979 Re:needs to be declared final?? missee 1710 2003-08-01 11:33
6022 Re:needs to be declared final?? Duncan 1356 2003-08-01 14:06
4933 Re:needs to be declared final?? missee 3388 2003-08-02 14:46
6652 Re:needs to be declared final?? Duncan 355 2003-08-02 15:03
4867 Re:needs to be declared final?? missee 247 2003-08-02 15:14
5478 Re:needs to be declared final?? Duncan 716 2003-08-02 22:31
4935 Re:needs to be declared final?? missee 177 2003-08-03 02:12
» JWorld@TW »  Java SE 討論區

reply to postflat modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8