Re: [問題] FRAME 排版問題

看板java作者 (Love you so much ^.^)時間19年前 (2006/04/20 00:55), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串5/6 (看更多)
恩 我重新把題目定義清楚 我有建構兩個frame 分別為 frame1與frame2 而我程式一開始執行的時候只會顯示出frame1 接著 當我按下frame1的其中一個button 則frame2就會顯示出來(frame2 為 internalframe) 下面是我那個button的程式碼 void jButton_actionPerformed(ActionEvent e) { Frame2 internalFrame = new Frame2(); internalFrame.setLocation( 20,20); internalFrame.setSize(200,200); internalFrame.setVisible(true); contentPane.add(internalFrame); try { internalFrame.setSelected(true); } catch (java.beans.PropertyVetoException ex) { System.out.println("Exception while selecting"); } 不過卻有一各問題 就是我 frame2 雖然會跑出來 可是卻會被 frame1 的button和label擋住(就是 frame2 會置於 frame1上各物件的後面) 我想請問 我應該在 button中加上 哪些指令讓 frame2 可以置於最上層 不會被frame1的物件擋住 -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.216.42.129
文章代碼(AID): #14Hck1TM (java)
文章代碼(AID): #14Hck1TM (java)