Re: [問題] 請問Frame關閉的功能

看板java作者 (骨頭)時間18年前 (2006/06/24 22:29), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/7 (看更多)
※ 引述《PsMonkey (痞子軍團團長)》之銘言: : ※ 引述《Egriawei (斷背山狼與羊)》之銘言: : : 我在一個Frame上 : : 加入了若干元件用來輸入帳號密碼 : : 輸入完畢會傳出所需字串去找database : : 然後這些資料是另外一個主Frame需要的 : : 之後我想讓程式自動關閉這個輸入帳密的子Frame : : 請問應該用Frame的什麼方法?Frame方法太多我試了好幾個都不對orz : 基本做法... : 先 setVisible(false) : 然後再來把他 set null : ==== : 是不知道有沒有進階做法啦... dispose() 是window(frame的父類別)的標準拋去用法 不過我實測過, 對於frame的用處好像也只是serVisible(false)而已 因為我dispose以後再setVisible(true)還是又冒出來了XD ---- public void dispose() Releases all of the native screen resources used by this Window, its subcomponents, and all of its owned children. That is, the resources for these Components will be destroyed, any memory they consume will be returned to the OS, and they will be marked as undisplayable. The Window and its subcomponents can be made displayable again by rebuilding the native resources with a subsequent call to pack or show. The states of the recreated Window and its subcomponents will be identical to the states of these objects at the point where the Window was disposed (not accounting for additional modifications between those actions). Note: When the last displayable window within the Java virtual machine (VM) is disposed of, the VM may terminate. See AWT Threading Issues for more information. See Also: Component.isDisplayable(), pack(), show() -- String temp="relax"; | Life just like programing while(buringlife) String.forgot(temp); | to be right or wrong while(sleeping) brain.setMemoryOut(); | need not to say stack.push(life.running); | the complier will stack.push(scouting.buck()); | answer your life stack.push(bowling.pratice()); | Bone everything -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.138.240.58
文章代碼(AID): #14dKnURT (java)
討論串 (同標題文章)
文章代碼(AID): #14dKnURT (java)