2014-01-27 1 views
0

전 화면으로 이동하는 기능이있는 스윙 응용 프로그램에서 작업 중입니다. 모든 키 이벤트에서 setFullScreenWindow (null)를 사용하여 전체 화면 창을 종료하려고 시도하지만 작동하지 않습니다. 여기에 코드가 있습니다. 키 이벤트에 전체 화면을 종료하기 위해 JFrame의 전체 화면을setFullScreenWindow (null)은 MAC os x에서 작동하지 않습니다. 스윙 응용 프로그램

frame.getJMenuBar().setVisible(false); 
       gd.setFullScreenWindow(frame); 
       frame.setVisible(false); 
       frame.setVisible(true); 

코드를 설정

코드 :

@Override 
     protected void process(List<Boolean> chunks) { 
      for(Boolean b:chunks){ 
       System.out.println(b); 
       if(b){ 
        if(timer !=null) 
         timer.stop(); 
        Window window = gd.getFullScreenWindow(); 
        if(window != null){ 
         window.dispose(); 
        } 
        gd.setFullScreenWindow(null); 

        frame.getJMenuBar().setVisible(false); 
       } 
      } 
     } 

하십시오 조언. :(

답변

0

전에 아래처럼 ::

if(gd.isFullScreenSupported()) 
     gd.setFullScreenWindow(null); 

지금 완벽하게 작동합니다 :)

을 전체 화면 지원 여부를 확인 여부를 위해 필요한 전체 화면 창 널 (null)을 설정