posts - 42,  comments - 84,  trackbacks - 0
原来弄过QuaQua的东西,但是一直不能把JFrame和JDialog变成Ox mac的样式
原因是,如果系统并不是苹果的系统就需要显示的加载JFrame和JDialog的样式



System.setProperty("Quaqua.tabLayoutPolicy","wrap");
          
        
if(!System.getProperty("os.name").toLowerCase().startsWith("mac"))
        
{
            
try
            
{
                Methods.invokeStatic(JFrame.
class"setDefaultLookAndFeelDecorated", Boolean.TYPE, Boolean.TRUE);
                Methods.invokeStatic(JDialog.
class"setDefaultLookAndFeelDecorated", Boolean.TYPE, Boolean.TRUE);
            }

            
catch(NoSuchMethodException e)
            
{
                e.printStackTrace();
            }

        }

        
try 
        
{
            UIManager.setLookAndFeel(
"ch.randelshofer.quaqua.QuaquaLookAndFeel");
        }
 
        
catch(Exception e){}
posted on 2008-01-26 13:01 Dong 阅读(2951) 评论(6)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: