1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
<!DOCTYPE HTML>
<htmllang="en-US">
<head>
<meta charset="UTF-8">
<title>CSS3 Full Background Slider </title>
<style type="text/css">
@importurl("http://www.w3cplus.com/demo/css3/base.css");
@importurl("http://fonts.googleapis.com/css?family=Yesteryear");
html,body {
height: 100%;
margin:0px;
}
/*设置背景图片全屏显示,并且居中*/
img.bg {
min-height: 100%;
min-width: 1024px;
width: 100%;
height: auto !important;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index:1;
}
/*设置背景图片从左向右移入显示的动画效果*/
/* Slide Left */

@-webkit-keyframes 'slideLeft' {
0% { left: -100%; }
100% { left: 0; }
}
@-moz-keyframes 'slideLeft' {
0% { left: -100%; }
100% { left: 0; }
}
@-o-keyframes 'slideLeft' {
0% { left: -100%; }
100% { left: 0; }
}
@-ms-keyframes 'slideLeft' {
0% { left: -100%; }
100% { left: 0; }
}
@keyframes 'slideLeft' {
0% { left: -100%; }
100% { left: 0; }
}
/*设置背景图像从底部向顶部移入的动画效果*/
/* Slide Bottom */

@-webkit-keyframes 'slideBottom' {
0% { top: 350px; }
100% { top: 0; }
}
@-moz-keyframes 'slideBottom' {
0% { top: 350px; }
100% { top: 0; }
}
@-ms-keyframes 'slideBottom' {
0% { top: 350px; }
100% { top: 0; }
}
@-o-keyframes 'slideBottom' {
0% { top: 350px; }
100% { top: 0; }
}
@keyframes 'slideBottom' {
0% { top: 350px; }
100% { top: 0; }
}
/*设置背景图片由小到大放大动画效果*/
/* Zoom In */

@-webkit-keyframes 'zoomIn' {
0% { -webkit-transform: scale(0.1); }
100% { -webkit-transform: none; }
}
@-moz-keyframes 'zoomIn' {
0% { -moz-transform: scale(0.1); }
100% { -moz-transform: none; }
}
@-ms-keyframes 'zoomIn' {
0% { -ms-transform: scale(0.1); }
100% { -ms-transform: none; }
}
@-o-keyframes 'zoomIn' {
0% { -o-transform: scale(0.1); }
100% { -o-transform: none; }
}
@keyframes 'zoomIn' {
0% { transform: scale(0.1); }
100% { transform: none; }
}
/*设置背景图像由大到小缩小动画效果*/
/* Zoom Out */

@-webkit-keyframes 'zoomOut' {
0% { -webkit-transform: scale(2); }
100% { -webkit-transform: none; }
}
@-moz-keyframes 'zoomOut' {
0% { -moz-transform: scale(2); }
100% { -moz-transform: none; }
}
@-ms-keyframes 'zoomOut' {
0% { -ms-transform: scale(2); }
100% { -ms-transform: none; }
}
@-o-keyframes 'zoomOut' {
0% { -o-transform: scale(2); }
100% { -o-transform: none; }
}
@keyframes 'zoomOut' {
0% { transform: scale(2); }
100% { transform: none; }
}
/*背景图像旋转出现动画效果*/
/* Rotate */

@-webkit-keyframes 'rotate' {
0% { -webkit-transform: rotate(-360deg) scale(0.1); }
100% { -webkit-transform: none; }
}
@-moz-keyframes 'rotate' {
0% { -moz-transform: rotate(-360deg) scale(0.1); }
100% { -moz-transform: none; }
}
@-ms-keyframes 'rotate' {
0% { -ms-transform: rotate(-360deg) scale(0.1); }
100% { -ms-transform: none; }
}
@-o-keyframes 'rotate' {
0% { -o-transform: rotate(-360deg) scale(0.1); }
100% { -o-transform: none; }
}
@keyframes 'rotate' {
0% { transform: rotate(-360deg) scale(0.1); }
100% { transform: none; }
}
/*设置背景图像不显示动画效果*/
@-webkit-keyframes 'notTarget' {
0% { z-index: 75; }
100% { z-index: 75; }
}
@-moz-keyframes 'notTarget' {
0% { z-index: 75; }
100% { z-index: 75; }
}
@-ms-keyframes 'notTarget' {
0% { z-index: 75; }
100% { z-index: 75; }
}
@-o-keyframes 'notTarget' {
0% { z-index: 75; }
100% { z-index: 75; }
}
@keyframes 'notTarget' {
0% { z-index: 75; }
100% { z-index: 75; }
}



.slider {
position: absolute;
width: 100%;
text-align: center;
z-index: 9999;
bottom: 100px;
}
.slider li {
display: inline-block;
width: 170px;
height: 130px;
margin-right: 15px;
}
.slider a {
display: inline-block;
width: 170px;
padding-top: 70px;
padding-bottom: 20px;
position: relative;
cursor: pointer;
border: 2px solid #fff;
border-radius: 5px;
vertical-align: top;
color: #fff;
text-decoration: none;
font-size: 22px;
font-family: 'Yesteryear', cursive;
text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.8),-2px -2px 1px rgba(0, 0, 0, 0.3),-3px -3px 1px rgba(0, 0, 0, 0.3);
}
/*任务一、设置不同列表的背景色*/

.slider ul li:nth-of-type(1) a{
background-color: #02646e;
}
.slider ul li:nth-of-type(2) a{
background-color: #eb0837;
}
.slider ul li:nth-of-type(3) a{
background-color: #67b374;
}
.slider ul li:nth-of-type(4) a{
background-color: #e6674a;
}
.slider ul li:nth-of-type(5) a{
background-color: #e61061;
}
/*任务二、设置缩略图形状*/
.slider li a::after{
content:"";
display: block;
height: 120px;
width: 120px;
border: 5px solid #fff;
border-radius: 50%;
position: absolute;
left: 50%;
margin-left: -60px;
z-index: 9999;
top: -80px;
}
/*任务三、设置缩略图背景图像*/
.slider li:nth-of-type(1) a::after{
background: url(http://p4.gexing.com/G1/M00/FB/8B/rBACFFI7u2uAcq4hAAEv1xanw5U252_200x200_3.png) no-repeat center;
}
.slider li:nth-of-type(2) a::after{
background: url(http://p3.gexing.com/G1/M00/69/21/rBACE1IHPUqBNBNYAAAU5l5wy0A616_200x200_3.jpg) no-repeat center;
}
.slider li:nth-of-type(3) a::after{
background: url(http://p2.gexing.com/G1/M00/67/3B/rBACFFIHj6fDFir7AAAhiX6dWfU282_200x200_3.jpg) no-repeat center;
}
.slider li:nth-of-type(4) a::after{
background: url(http://p3.gexing.com/G1/M00/34/D7/rBACE1H571HghyoyAAAVy0AOsB4191_200x200_3.jpg) no-repeat center;
}
.slider li:nth-of-type(5) a::after{
background: url(http://p3.gexing.com/G1/M00/A2/33/rBACFFIXQTazRAqrAAAWv2gMpjs851_200x200_3.jpg) no-repeat center;
}
/*任务四、给缩略图添加蒙板效果*/
.slider li a::before{
content:"";
display: block;
height: 120px;
width: 120px;
border: 5px solid #fff;
border-radius: 50%;
position: absolute;
left: 50%;
margin-left: -60px;
z-index: 99999;
top: -80px;
background: rgba(0,0,0,0.3);
}
/*任务五、鼠标悬浮时,修改缩略图蒙板透明度*/
.slider li:hover a::before{
opacity:0;
}
/*任务六、点击综略图,切换背景图*/
/*背景图从左向右出现*/
:target[class*=slideLeft]{
z-index: 100;
-webkit-animation-name: slideLeft;
-webkit-animation-duration: 1s;
-webkit-animation-iteration-count: 1;
-moz-animation-name: slideLeft;
-moz-animation-duration: 1s;
-moz-animation-iteration-count: 1;
-ms-animation-name: slideLeft;
-ms-animation-duration: 1s;
-ms-animation-iteration-count: 1;
-o-animation-name: slideLeft;
-o-animation-duration: 1s;
-o-animation-iteration-count: 1;
animation-name: slideLeft;
animation-duration: 1s;
animation-iteration-count: 1;
}
/*背景图从下向上出现*/
:target[class*=slideBottom]{
z-index: 100;

-webkit-animation-name: slideBottom;
-webkit-animation-duration: 1s;
-webkit-animation-iteration-count: 1;
-moz-animation-name: slideBottom;
-moz-animation-duration: 1s;
-moz-animation-iteration-count: 1;
-ms-animation-name: slideBottom;
-ms-animation-duration: 1s;
-ms-animation-iteration-count: 1;
-o-animation-name: slideBottom;
-o-animation-duration: 1s;
-o-animation-iteration-count: 1;
animation-name: slideBottom;
animation-duration: 1s;
animation-iteration-count: 1;
}
/*背景图由小到大出现*/
:target[class*=zoomIn]{
z-index: 100;
-webkit-animation-name: zoomIn;
-webkit-animation-duration: 1s;
-webkit-animation-iteration-count: 1;
-moz-animation-name: zoomIn;
-moz-animation-duration: 1s;
-moz-animation-iteration-count: 1;
-ms-animation-name: zoomIn;
-ms-animation-duration: 1s;
-ms-animation-iteration-count: 1;
-o-animation-name: zoomIn;
-o-animation-duration: 1s;
-o-animation-iteration-count: 1;
animation-name: zoomIn;
animation-duration: 1s;
animation-iteration-count: 1;
}

/*背景图由大到小出现*/
:target[class*=zoomOut]{
z-index: 100;
-webkit-animation-name: zoomOut;
-webkit-animation-duration: 1s;
-webkit-animation-iteration-count: 1;
-moz-animation-name: zoomOut;
-moz-animation-duration: 1s;
-moz-animation-iteration-count: 1;
-ms-animation-name: zoomOut;
-ms-animation-duration: 1s;
-ms-animation-iteration-count: 1;
-o-animation-name: zoomOut;
-o-animation-duration: 1s;
-o-animation-iteration-count: 1;
animation-name: zoomOut;
animation-duration: 1s;
animation-iteration-count: 1;
}

/*背景图旋转出现*/
:target[class*=rotate]{
z-index: 100;
-webkit-animation-name: rotate;
-webkit-animation-duration: 1s;
-webkit-animation-iteration-count: 1;
-moz-animation-name: rotate;
-moz-animation-duration: 1s;
-moz-animation-iteration-count: 1;
-ms-animation-name: rotate;
-ms-animation-duration: 1s;
-ms-animation-iteration-count: 1;
-o-animation-name: rotate;
-o-animation-duration: 1s;
-o-animation-iteration-count: 1;
animation-name: rotate;
animation-duration: 1s;
animation-iteration-count: 1;
}
/*任务七、设置不显示的背景图层级*/
/* Not Target */

img:not(:target){
-webkit-animation-name: notTarget;
-webkit-animation-duration: 1s;
-webkit-animation-iteration-count: 1;
-moz-animation-name: notTarget;
-moz-animation-duration: 1s;
-moz-animation-iteration-count: 1;
-ms-animation-name: notTarget;
-ms-animation-duration: 1s;
-ms-animation-iteration-count: 1;
-o-animation-name: notTarget;
-o-animation-duration: 1s;
-o-animation-iteration-count: 1;
animation-name: notTarget;
animation-duration: 1s;
animation-iteration-count: 1;
}
</style>
</head>
<body>
<div class="slider">
<ul class="clearfix">
<li><a href="#bg1">_(:з」∠)_</a></li>
<li><a href="#bg2">(●´∀‘●)</a></li>
<li><a href="#bg3">(。・`ω´・)</a></li>
<li><a href="#bg4">(〃∇〃)</a></li>
<li><a href="#bg5">(╯' - ')╯︵ ┻━┻</a></li>
</ul>
</div>
<img src="http://img4.duitang.com/uploads/item/201404/10/20140410201316_4shKU.jpeg" alt="" class="bg slideLeft" id="bg1" />
<img src="http://img5q.duitang.com/uploads/item/201406/01/20140601100050_afKZt.jpeg" alt="" class="bg slideBottom" id="bg2" />
<img src="http://cdn.duitang.com/uploads/item/201404/10/20140410101759_8Wd4T.jpeg" alt="" class="bg zoomIn" id="bg3" />
<img src="http://img5.duitang.com/uploads/item/201404/10/20140410095203_Ey8z3.jpeg" alt="" class="bg zoomOut" id="bg4" />
<img src="http://cdn.duitang.com/uploads/item/201404/10/20140410102139_ZQdPU.jpeg" alt="" class="bg rotate" id="bg5" />
</body>
</html>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html>
<html>
<head>
<title>CSS3 ao you logo</title>
<style type="text/css">
* {margin:0; padding:0}
.main {width:240px;margin: 0px auto;}
.main_wrapper {width:240px; height:240px; border-radius:120px; background:#B1E4FF; border:2px solid #789CB6; box-shadow:5px 5px 7px #999}
.main_wrap {width:230px; height:230px; border-radius:115px; position:relative; top:5px; left:5px; background:#3B99E3}
.white_1 {width:150px; height:100px; background:#FFF; position:relative; left:42px; top:70px; border-radius:3px 20px 3px 3px}
.white_2 {width:35px; height:45px; background:#FFF; position:relative; left:33px; top:30px; border:25px solid #3B99E3}
</style>
</head>
<body>
<div class="main">
<div class="main_wrapper">
<div class="main_wrap">
<div class="white_1">
<div class="white_2"></div>
</div>
</div>
</div>
</div>
</body>
</html>

String:
String.format
str.trim();// 返回 去前导 尾部空格 的字符串
import java.util.StringTokenizer;//P113
StringTokenizer(String str,String delim);//str 要去除空格的字符串 delim要去除的字符 返回去除后结果
StringBuffer
str.replaceAll(String regex,String replacement);//正则表达式
str.replace(String regex,String replacement);//字符(串)的替换
str.replaceFirst(regex,replacement);
str.split(delim);//会分出 无长字符
str.matches(String regex);//判断是否正则表达式
汉子匹配P133

StringBuilder:
.append(String str);
.append(StringBuffer str);
.insert(int offset,String str);

时间:
System.currentTimeMillis();//系统时间
Date date = new Date(); // 创建Date对象date

多个类文件前面要加package com.lzw;

import java.text.DecimalFormat;
DecimalFormat myFormat = new DecimalFormat(pattern);// 实例化DecimalFormat对象
String output = myFormat.format(value);
System.out.println(Object X)->调用String.valueof(X)->X.toString();//
自定义Class 调用Object默认的equals
getClass().getName();

不定长
public static int add(int… a) { // 定义不定长参数方法
int s = 0;
for (int i = 0; i < a.length; i++)
// 根据参数个数做循环操作
s += a[i]; // 将每个参数累加
return s; // 将计算结果返回
}
add(1,2, 3,4, 5,6, 7, 8, 9);

10.10 接口 向上转型

A instanceof B;A和B的关系要是 A extends B or B extends A//返回A是否为B的子类
抽象类不能实例化

new innerClass 11.07;
接口向上转型 直接调用内部类 11.08
e.printStackTrace;//catch (MyException e)

WindowConstants.DISPOSE_ON_CLOSE
||
JFrame.DISPOSE_ON_CLOSE

数据库:
加入数据
String sql= insert into tb_users (username,password,sex,age) values(‘adf’,’111’,’nan’,’22’)
Statement stmt = conn.createStatement();
stmt.executeUpdate(sql);

String Sql =insert into tb_users (username,password,sex,age)value(?,?,?,?);
PreparedStatement ps =conn.prepareStatement(sql);
ps.setString(1,””);
ps.setString(2,””);
ps.setString(3,””);
ps.executeUpdate();
获得数据
String sql=select * from tb_users;
Statement stmt = conn.createStatement();
ResultSet rs =stmt.executeQuery(sql);
while(rs.next()){
=rs.getInt(“id”);
=rs.getStringInt(2);
=rs.getString(“password”);
=rs.getInt(4);
}

更改数据
String sql=”update tb_users set age=20 where id=1”
Statement stmt = conn.createStatement();
stmt.executeUpdate(sql);

String sql=”update tb_users set password=? where sex=?”
PreparedStatement ps=conn.prepareStatement(sql);
ps.setString(1,”admin”);
ps.setString(2,”nan”);
int count=ps.executeUpdate();
删除数据
String sql=”delete from tb_users where id=1”
Statement stmt=conn.createStatement();
stmt.executeUpdate;
模糊查询
Statement stmt=conn.createStatement();
String sql=”select * from tb_users where username like ‘%李%’”;//通配符%=0个或多个字符 下划线_=一个字符
ResultSet rs =stmt.executeQuery(sql);
while(rs.next()){
=rs.getInt(“id”);
=rs.getStringInt(2);
=rs.getString(“password”);
=rs.getInt(4);
}

0%