SWING HACKS电子书及范例代码

SWING HACKS电子书及范例代码
购书地址:http://www.oreilly.com.cn/index.php?func=book&isbn=978-7-302-14334-5
介绍
Java编程语言一般是和重要的企业级应用程序联系在一起的,运行它们的服务器可能就位于蒙大拿的某个冰冷的机房里。不过,是桌面应用催生了Java,未来也必将是桌面应用让Java能更加光彩夺目。通过AWT和现在的Swing,Java为编写图形化用户界面提供了丰富的客户端API。不过想要让Java、AWT和Swing达到最佳性能并不容易(也不方便),特别是在模拟交互式Web站点或像Windows XP和Mac OS X这样的操作系统外观时更是如此。
本书能帮助Java开发人员跳过Swing的基础细节直接让桌面应用程序贴近现实。如果读者是一个Java开发人员,并想开发带有一流外观的企业级应用程序,那就应该掌握Swing。不过对Swing的hack并不仅仅局限于对它的正常使用,而是关于一些读者或许要经过许多年才能领会到的技巧。它们是一些富有创造性的、原创的甚至是诡异的hack,能让读者发出由衷的惊叹:“我可没想过居然能用Swing干这个!”
在本书中,读者将学到:
● 过滤不用的列表控件,对用户的输入做出合适的反应
● 为列表和组合框组件提供拖放功能
● 在图形组件之间实现动态切换效果,并能创建动态列表式界面
● 控制任何方面,从鼠标指针到光标,乃至闪动键盘灯
● 在Swing中构建分层、覆盖组件并灵活使用透明窗格屏蔽Swing接口内部的复杂细节和伸缩性
虽然含有丰富的技巧和经验,但本书并不是仅为那些想要构建更好用户界面的开发人员所准备的。对于其他人也一样适用,包括希望提供优雅应用程序的Java开发人员、希望推动Java客户端程序发展的热心人,以及那些希望为自己的应用程序引入更强大功能的编码人员。



--------------------------------------------------------------------------------

相关链接
试读章节
8 动态切换分页
38 可振动的对话框
44 将对话框变为停靠于窗口的漂浮对话框
59 创建取色器
65 文件拖放
89 有趣的键盘灯
下载范例代码
勘误表
购买选项
定价:66.00元
前往 China-Pub 购买
查看 China-Pub 购物车

联系出版社邮购SWING HACKS
Joshua Marinacci, Chris Adamson 著
徐晔 译
出版时间:2007年02月
页数:552

--------------------------------------------------------------------------------

介绍
Java编程语言一般是和重要的企业级应用程序联系在一起的,运行它们的服务器可能就位于蒙大拿的某个冰冷的机房里。不过,是桌面应用催生了Java,未来也必将是桌面应用让Java能更加光彩夺目。通过AWT和现在的Swing,Java为编写图形化用户界面提供了丰富的客户端API。不过想要让Java、AWT和Swing达到最佳性能并不容易(也不方便),特别是在模拟交互式Web站点或像Windows XP和Mac OS X这样的操作系统外观时更是如此。
本书能帮助Java开发人员跳过Swing的基础细节直接让桌面应用程序贴近现实。如果读者是一个Java开发人员,并想开发带有一流外观的企业级应用程序,那就应该掌握Swing。不过对Swing的hack并不仅仅局限于对它的正常使用,而是关于一些读者或许要经过许多年才能领会到的技巧。它们是一些富有创造性的、原创的甚至是诡异的hack,能让读者发出由衷的惊叹:“我可没想过居然能用Swing干这个!”
在本书中,读者将学到:
● 过滤不用的列表控件,对用户的输入做出合适的反应
● 为列表和组合框组件提供拖放功能
● 在图形组件之间实现动态切换效果,并能创建动态列表式界面
● 控制任何方面,从鼠标指针到光标,乃至闪动键盘灯
● 在Swing中构建分层、覆盖组件并灵活使用透明窗格屏蔽Swing接口内部的复杂细节和伸缩性
虽然含有丰富的技巧和经验,但本书并不是仅为那些想要构建更好用户界面的开发人员所准备的。对于其他人也一样适用,包括希望提供优雅应用程序的Java开发人员、希望推动Java客户端程序发展的热心人,以及那些希望为自己的应用程序引入更强大功能的编码人员。

目录
目录 致谢 1 前言 5 第1章 基本JComponent 13 1 创建图像主题组件 13 2 别满足于枯燥的文本标签 20 3 以图片填充边框 26 4 以定制的日历显示日期 31 5 在文本组件中添加水印 35 6 在滚动窗格中引入水印 38
目录
致谢 1
前言 5
第1章 基本JComponent 13
1 创建图像主题组件 13
2 别满足于枯燥的文本标签 20
3 以图片填充边框 26
4 以定制的日历显示日期 31
5 在文本组件中添加水印 35
6 在滚动窗格中引入水印 38
7 向文本域背景添加NASA照片 42
8 动态切换分页 45
9 对失效组件添加模糊效果 52
10 构建下拉菜单按钮 55
11 创建带下拉阴影的菜单 62
12 为菜单添加透明效果 66
第2章 列表和组合框 71
13 过滤JList 71
14 添加筛选历史记录 76
15 使JList可被复选 79
16 让不同列表项有不同的外观 84
17 使用拖放对JList进行重排序 94
18 让JList的选择拥有动态效果 101
19 在列表填充器中使用其他方法 106
20 创建支持Collection的JComboBox 110
第3章 表格和树 117
21 根据JTable内容确定列宽 117
22 为JTable添加按列选择功能 123
23 让JTable完成排序 125
24 创建一个JDBC表格模型 138
25 将表格数据导出到Excel 147
26 方便地搜索JTable 150
27 为JTree添加动态拖放效果 156
第4章 文件选择器 166
28 为文件选择器添加右键上下文菜单 166
29 在文件选择器中显示快捷方式 171
30 真正支持Windows快捷方式 175
31 向文件选择器添加图像预览功能 182
32 预览ZIP和JAR文件 186
第5章 窗口、对话框和窗框 194
33 为窗口实现吸附效果 194
34 实现可拖动的窗口 197
35 添加窗口尺寸调整图标 200
36 为窗口添加状态栏 206
37 保存窗口设置信息 213
38 可振动的对话框 218
39 旋转打开详情窗口 223
40 最小化为微型窗框 229
第6章 透明窗口和动画窗口 235
41 透明窗口 235
42 使窗口具有淡出效果 242
43 创建自定义提示框 247
44 将对话框变为停靠于窗口的漂浮对话框 251
45 为飘浮对话框实现动画效果 256
46 从任务栏中滑出提示 263
47 模糊式进度指示器 271
第7章 文本 281
48 使文本组件可被搜索 281
49 强制要求文本输入符合指定格式 285
50 带自动补全功能的文本域 290
51 文本反转 297
52 在文本组件中使用HTML和CSS 300
53 使用全局抗锯齿字体 304
54 不通过代码实现抗锯齿文本 309
55 通过自定义外观实现抗锯齿文本 311
第8章 渲染处理 313
56 创建放大镜组件 313
57 创建全局右键菜单 319
58 不通过模态对话框实现窗口阻塞 322
59 创建取色器 326
60 为整个程序改变字体 330
61 在运行时加载新字体 334
62 构建基于向量的按钮 336
63 为Swing添加第三维度 343
64 在Swing中吸引用户注意力 349
第9章 拖放处理 357
65 文件拖放 357
66 处理对URL的释放 363
67 处理对图像的释放 367
68 在Mac OS X上处理对Pict图像的释放 373
69 半透明拖放效果 379
第10章 音频 387
70 在Applet中播放音频 388
71 使用JavaSound播放音频 394
72 使用Java 媒体框架(JMF)播放音频 398
73 使用JavaSound播放音频 401
74 为JMF加入对MP3的支持 406
75 构建一个音频波形显示器 408
76 播放复杂音频 417
77 在播放时显示音频文件信息 423
78 在回放时控制音频 433
第11章 本地化集成和打包 440
79 在Windows中运行外部程序 440
80 在Mac OS X上打开文件、目录和URL 443
81 使Mac应用程序正常工作 445
82 控制Mac OS X中的 iTunes 450
83 在Windows中控制iTunes 453
84 构建单次运行的应用程序 456
85 为JAR包添加新内容 460
86 快速变换外观 466
87 创建黑白间隔的主题 471
第12章 其他技巧 476
88 显示鼠标指针为忙碌状态 476
89 有趣的键盘灯 479
90 用Robot类创建演示效果 483
91 通过Swing检查邮件 487
92 避免阻塞GUI 492
93 实现非阻塞的模型 498
94 抛出事件并避免bug 505
95 调试GUI 512
96 使用自定义透明窗格调试组件 515
97 创建应用程序的镜像 520
98 为动态HTML添加Velocity引擎 526
99 获取大文件图标 533
100 动态调整窗框尺寸 534
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
介绍Swing组件的电子书 How This Book Is Organized The book is divided into several chapters, organized by subject: Chapter 1, Basic JComponents Here you'll find simple hacks for the basic components like labels, buttons, and text fields. This chapter contains a lot of bang for the buck, and it illustrates some of the techniques that we will explore more fully later on. From fancy JLabels to translucent menus, this is a great place to start. Chapter 2, Lists and Combos This chapter features complicated Swing components that are used everywhere. Bend them to your will! Make them look good with polymorphic renderers and animated selections. Make them perform well with filtering and Collections support. Chapter 3, Tables and Trees This chapter revelas the secrets of these mystic componentsfrom Excel exporting to proper JTree drop targets. Make the JTree and JTable dance. Chapter 4, File Choosers One of Swing's most maligned components, the JFileChooser, actually has a lot of power hiding inside some murky APIs. This chapter will let you use custom icons, detect Windows shortcuts, and even navigate ZIP files. Chapter 5, Windows, Dialogs, and Frames This is where the fun begins. Every application needs a container, so why not make it pretty and powerful? Make your windows drag and snap. Build custom windows like the earthquake login and spin open dialog. You can even save your window settings automatically with almost no code changes. Chapter 6, Transparent and Animated Windows If you went through the previous chapter and still want more, then this chapter is for you. We push windows to the limit with transparency, animations, slide-in OS X stylesheets, and some of the coolest special effects you've ever seen. Chapter 7, Text Text components seem boring, but there's a lot of power hiding in there. This chapter will show you how to do regular expression searching, dot completion, backward text, and even three different ways to give your application the bright sheen of anti-aliasing. Chapter 8, Rendering This chapter has the meat of the graphics hacks. Custom fonts, a magnifying glass, vector buttons, and even some work with Java3D. We've got some great things to make your application pop. Chapter 9, Drag-and-Drop When your users want two pieces of software to work together the first thing they want to do is drag-and-drop data from their other programs to yours. This chapter covers how to do robust and attractive drag-and-drop entirely within Java. Chapter 10, Audio What would be a cool modern application without some media support? This chapter covers four different ways to play sound, how to display waveforms, and how to embed MP3 support in your own programs. Chapter 11, Native Integration and Packaging The best software works well with the native operating system. Here you'll learn how to launch web browsers, hack the Windows registry, customize your program for specific platforms, and even control iTunes. Chapter 12, Miscellany This chapter offers a grab bag of things that didn't fit anywhere else, but were too cool not to include. Animated cursors, better threading, flashing the keyboard lights, and a bunch of quick one-liners to let you make the most of your busy day.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值