JAVA技术网站

这里记录些不错的JAVA技术网站:
记录这些网站只是未以后养成一个好习惯,阅读第一手资料的好习惯。

http://docs.oracle.com/javase/tutorial/
这是官方技术网站,描述了很多技术细节,很有参考意义,比如看了下Swing,在谈到L&F时,就写了有哪些L&F,并详细的说明每种L&F的使用,以及很多细节,以前在程序运行后在改L&F时发现程序界面没有改变,简单以为再repaint一下就可以了,在这里的文档里就明确的写出:

Changing the Look and Feel After Startup
You can change the L&F with setLookAndFeel even after the program's GUI is visible. To make existing components reflect the new L&F, invoke the SwingUtilities updateComponentTreeUI method once per top-level container. Then you might wish to resize each top-level container to reflect the new sizes of its contained components. For example:

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

在百度里搜索:java swing改变lookandfeel如何生效
看到一篇文章写的是:
1. 利用UIManager.setLookAndFeel()方法(这个方法需要传入正确的Look and Feel名称,如下)设置新的Look and Feel外观。
    Metal风格——"javax.swing.plaf.metal.MetalLookAndFeel"
    Motif风格——"com.sun.java.swing.plaf.motif.MotifLookAndFeel"
    Windows风格——"com.sun.java.swing.plaf.windows.WindowsLookAndFeel"
2. 用SwingUtilities.updateComponentTreeUI()方法改变外观。

示例代码:
try {
    UIManager.setLookAndFeel(lnfName);
    SwingUtilities.updateComponentTreeUI(frame);
}
的确能实现效果,但发现用那种字符串指定L&F方式没有文档里例子使用:
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
方便,毕竟没有谁去记那个字符串。

还有对于frame这个变量也没有详细说明,但一般都知道是顶层容器,也就是最外面那个JFrame。



http://home.java.net/

http://www.java-gaming.org

http://www.cppblog.com/init/archive/2012/02/14/165529.html


//3D图形知识
[url]http://www.arcsynthesis.org/gltut/index.html [/url]

无聊了,就去这些地方看看吧


猜你喜欢

转载自qifan.iteye.com/blog/1842018