for (Component co : up.getContentPane().getComponents())
{
System.out.println(co.getClass().toString()); //得到co的类型
if (co.getClass().toString().toLowerCase().contains("jpanel"))
{
for (Component control : ((JPanel)co).getComponents())
{
System.out.println(control.getClass().toString()); //得到co的类型
if (!control.getClass().toString().toLowerCase().contains("jlabel"))
{
control.setEnabled(false);
}
}
}
}
http://www.cnblogs.com/jirigala/archive/2013/05/09/3068134.html
http://blog.csdn.net/xdlxia/article/details/6504077
http://zuoqiang.iteye.com/blog/1461287
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
} catch (Exception e) {
e.printStackTrace();
}
swing Nimbus