鎖住 JFrame 類似程式作設定的 功能
增加 windows listner
f2.addWindowFocusListener(new WindowFocusListener(){
//Override
public void windowGainedFocus(WindowEvent e) {
// TODO Auto-generated method stub
}
//Override
public void windowLostFocus(WindowEvent e) {
// TODO Auto-generated method stub
f2.requestFocus()
注意
一定要同時宣告 lost 與 gain 不能會編不過
參考:
某一討論區論壇的七樓
囧