看板 java 關於我們 聯絡資訊
※ 引述《TheOnlyWay (====ONLYway)》之銘言: : 請問各位高手 : 我現在想把 視窗中 的 "往下還原/最大化" 那個鎖住 ,請問一下我該如何做呢? 最基本的作法是把Frame設成不能按啦XD setEnabled(false); 不過想分開做的話 最大化的部份,只要把resizeable鎖住就不用管它了 this.setResizable(false); 至於鎖住往下還原 我目前只有找到底下這兩個方法 是做得到,可以參考看看。:) http://java.sun.com/j2se/1.5.0/docs/api/java/awt/event/WindowListener.html void windowDeiconified(WindowEvent e) Invoked when a window is changed from a minimized to a normal state. void windowIconified(WindowEvent e) Invoked when a window is changed from a normal to a minimized state. -- addWindowListener( new WindowAdapter(){ public void windowIconified(WindowEvent e){ JFrame jf= (JFrame)e.getSource(); jf.setState(jf.NORMAL); } public void windowDeiconified(WindowEvent e){ JFrame jf= (JFrame)e.getSource(); jf.setState(jf.NORMAL); } }); -- 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