2010-03-15 5 views

답변

2

감사 예를 들면 다음과 같습니다. 아래 코드를 사용하여 모든 룩앤필 클래스 이름을 얻을 수 있습니다.

UIManager.LookAndFeelInfo[] lookAndFeelInfos = UIManager.getInstalledLookAndFeels(); 
    for (int i = 0; i < lookAndFeelInfos.length; i++) { 
     UIManager.LookAndFeelInfo lookAndFeelInfo = lookAndFeelInfos[i]; 

     // 
     // Get the name of the look and feel 
     // 
     String name = lookAndFeelInfo.getName(); 
     System.out.println("name = " + name); 

     // 
     // Get the implementation class for the look and feel 
     // 
     String className = lookAndFeelInfo.getClassName(); 
     System.out.println("className = " + className); 
    } 
+0

설치된 모든 모양과 느낌이 표시됩니다. – Samurai

3

당신은 당신은 프로그램의 GUI가 보이는 후에도 setLookAndFeel와 L & F를 변경할 수 있습니다에 대한 setting the L&F in Java

이 일 자습서를 따를 수 있습니다.
기존 구성 요소가 새로운 L & F를 반영하도록하려면 최상위 컨테이너 당 SwingUtilitiesupdateComponentTreeUI 메서드를 한 번 호출하십시오.
그런 다음 포함 된 구성 요소의 새 크기를 반영하도록 각 최상위 컨테이너의 크기를 조정할 수 있습니다. 답장을 보내

UIManager.setLookAndFeel(lnfName); 
SwingUtilities.updateComponentTreeUI(frame); 
frame.pack(); 
+0

답장을 보내 주셔서 감사합니다. Look & Feel를 위해서 (때문에), InfName를 취득하는 방법. 우리는 NetBeans에서 고전적인 윈도우 OS를 사용하고 있습니다. 그것의 InfName은 무엇입니까? – Samurai

관련 문제