JAVA技术网站

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

[url]http://docs.oracle.com/javase/tutorial/[/url]
这是官方技术网站,描述了很多技术细节,很有参考意义,比如看了下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。


[url]http://home.java.net/[/url]

[url]http://www.java-gaming.org[/url]

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


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

无聊了,就去这些地方看看吧
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值