Java2实用教程(第二版)程序代码——第二十五章 Java Swing 基础
1
//例子1
2
import javax.swing.*;import java.awt.*;import java.awt.event.*;
3
public class Example25_1
4
{ public static void main(String args[])
5
{ JButton button=new JButton("轻组件按钮");
6
JTextArea text=new JTextArea("轻组件",20,20);
7
JFrame jframe=new JFrame("根窗体");
8
jframe.setSize(200,300);jframe.setBackground(Color.blue);
9
jframe.setVisible(true);jframe.pack();
10
jframe.addWindowListener(new WindowAdapter()
11
{public void windowClosing(WindowEvent e)
12
{System.exit(0);}
13
});
14
Container contentpane=jframe.getContentPane();//获得内容面板。
15
contentpane.add(button,BorderLayout.SOUTH); //向内容面板加入组件。
16
contentpane.add(text,BorderLayout.CENTER);
17
jframe.pack();
18
}
19
}
20![]()
21
//例子2
22
import javax.swing.*;import java.awt.*;import java.awt.event.*;
23
class Mywindow extends JFrame
24
{ JButton button;JTextArea text;
25
Mywindow()
26
{ setSize(200,400);setVisible(true);
27
Container con=getContentPane(); con.setLayout(new FlowLayout());
28
button=new JButton("ok");text=new JTextArea(10,20);
29
con.add(button);con.add(text);pack();
30
addWindowListener(new WindowAdapter()
31
{public void windowClosing(WindowEvent e)
32
{System.exit(0);}
33
});
34
}
35
}
36
public class Example25_2
37
{ public static void main(String args[])
38
{ Mywindow win=new Mywindow();win.pack();
39
}
40
}
41![]()
42
//例子3
43
import javax.swing.*;import java.awt.BorderLayout;
44
public class Example25_3 extends JApplet
45
{ JButton button; JTextArea text;
46
public void init()
47
{ button=new JButton("确定");text=new JTextArea();
48
getContentPane().add(text,BorderLayout.CENTER); //小程序容器得到内容面板。
49
getContentPane().add(button,BorderLayout.WEST);//并向内容面板中添加组件。
50
}
51
}
52![]()
53
//例子4
54
import javax.swing.*;import java.awt.*;import java.awt.event.*;
55
class Dwindow extends JFrame //建立根窗体用的类。
56
{ JButton button1,button2;
57
Dwindow(String s)
58
{ super(s);
59
Container con=getContentPane();
60
button1=new JButton("打开"); button2=new JButton("关闭");
61
con.add(button1);con.add(button2);pack();
62
setVisible(true);
63
addWindowListener(new WindowAdapter()
64
{ public void windowClosing(WindowEvent e)
65
{System.exit(0);}
66
});
67
}
68
}
69
class Mydialog extends JDialog //建立对话框类。
70
{ JButton button1,button2;
71
Mydialog(JFrame F,String s) //构造方法。
72
{ super(F,s);
73
button1=new JButton("open"); button2=new JButton("close");
74
setSize(90,90);setVisible(true);setModal(false);
75
Container con=getContentPane();con.setLayout(new FlowLayout());
76
con.add(button1);con.add(button2);
77
addWindowListener(new WindowAdapter()
78
{ public void windowClosing(WindowEvent e)
79
{System.exit(0);}});
80
}
81
}
82
public class Example25_4 extends JApplet
83
{ Dwindow window; Mydialog dialog; JButton button;
84
public void init()
85
{ window=new Dwindow("带对话框窗口");//创建窗口。
86
dialog=new Mydialog(window,"我是对话框"); //创建依赖于窗口window的对话框。
87
button=new JButton("ok"); getContentPane().add(button);
88
}
89
}
90![]()
91
//例子5
92
import javax.swing.*;import java.awt.*;import java.awt.event.*;
93
class Myframe extends JFrame implements ActionListener
94
{ JButton button;JTextArea text;
95
Myframe()
96
{ setSize(200,400);setVisible(true);
97
Container con=getContentPane();
98
con.setLayout(new FlowLayout());
99
button=new JButton("ok");text=new JTextArea(10,20);
100
con.add(button);con.add(text);
101
button.addActionListener(this);
102
addWindowListener(new WindowAdapter()
103
{ public void windowClosing(WindowEvent e)
104
{System.exit(0);}});
105
}
106
public void actionPerformed(ActionEvent e)
107
{ if(e.getSource()==button)
108
text.setText("i am a boy,and you?");
109
}
110
}
111
public class Example25_5
112
{ public static void main(String args[])
113
{ Myframe fr=new Myframe();fr.pack();
114
}
115
}
116![]()
117
//例子6
118
import javax.swing.*; import java.awt.*;
119
class Mycanvas extends JPanel
120
{ public void paintComponent(Graphics g)
121
{ super.paintComponent(g);
122
g.setColor(Color.red); g.drawString("a Jpanel used as canvas",50,50);
123
}
124
}
125
public class Example25_6 extends JApplet
126
{ Mycanvas canvas; JPanel panel;JButton button;
127
public void init()
128
{ canvas=new Mycanvas();panel=new JPanel();button=new JButton("ok");
129
panel.add(button); Container con=getContentPane();
130
con.add(panel,BorderLayout.NORTH); con.add(canvas,BorderLayout.CENTER);
131
}
132
}
133![]()
134
//例子7
135
import javax.swing.*;import java.awt.*;import java.awt.event.*;
136
class Mywindow extends JFrame
137
{ JButton button;JTextArea text;JScrollPane scroll;
138
Mywindow()
139
{ setSize(200,400);setVisible(true);
140
Container con=getContentPane();
141
button=new JButton("ok");text=new JTextArea(10,20);
142
scroll=new JScrollPane(text);
143
con.add(button,BorderLayout.SOUTH);con.add(scroll,BorderLayout.CENTER);
144
addWindowListener(new WindowAdapter()
145
{public void windowClosing(WindowEvent e)
146
{System.exit(0);}});
147
}
148
}
149
public class Example25_7
150
{ public static void main(String args[])
151
{ Mywindow win=new Mywindow();win.pack();
152
}
153
}
154![]()
155
//例子8
156
import javax.swing.*;import java.awt.*;import java.awt.event.*;
157
class Mywindow extends JFrame
158
{ JButton button1,button2;JTextArea text;JSplitPane split_one,split_two;
159
Mywindow()
160
{ setSize(200,400);setVisible(true); Container con=getContentPane();
161
button1=new JButton("ok"); button2=new JButton("No");
162
text=new JTextArea("I love you,java",10,20);
163
split_one=new JSplitPane(JSplitPane.VERTICAL_SPLIT,button1,button2);
164
split_two=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,split_one,text);
165
con.add(split_two,BorderLayout.CENTER);
166
addWindowListener(new WindowAdapter()
167
{public void windowClosing(WindowEvent e)
168
{System.exit(0);}});
169
}
170
}
171
public class Example25_8
172
{ public static void main(String args[])
173
{ Mywindow win=new Mywindow();win.pack();
174
}
175
}
176![]()
177
//例子9
178
import javax.swing.*;
179
import java.awt.*;
180
import java.awt.event.*;
181
class Mywindow extends JFrame
182
{ JButton button1,button2;
183
JInternalFrame interframe_1,
184
interframe_2;
185
Mywindow()
186
{ setSize(200,200); setVisible(true);
187
Container con=getContentPane();
188
con.setLayout(new GridLayout(1,2));
189
button1=new JButton("Boy"); button2=new JButton("Girl");
190
interframe_1=
191
new JInternalFrame("内窗体1",true,true,true,true);
192
interframe_1.setSize(100,100);interframe_1.setVisible(true);
193
interframe_1.getContentPane().add(button1);
194
JDesktopPane desk1=new JDesktopPane();
195
desk1.add(interframe_1);
196
interframe_2=new JInternalFrame("内窗体2",true,true,true,true);
197
interframe_2.setSize(300,150);interframe_2.setVisible(true);
198
interframe_2.getContentPane().add(button2,BorderLayout.CENTER);
199
interframe_2.getContentPane().add(new JLabel("ookk"),BorderLayout.NORTH);
200
JDesktopPane desk2=new JDesktopPane();
201
desk2.add(interframe_2);
202
con.add(desk1);con.add(desk2);
203
addWindowListener(new WindowAdapter()
204
{public void windowClosing(WindowEvent e)
205
{System.exit(0);}});
206
}
207
}
208
public class Exam25_9
209
{ public static void main(String args[])
210
{ Mywindow win=new Mywindow();win.pack();
211
}
212
}
213![]()
214
//例子10
215
import javax.swing.*; import java.awt.*;
216
import java.awt.event.*;
217
class MyWin extends JFrame
218
{ JButton b1,b2,b3;
219
public MyWin()
220
{ setBounds(100,100,300,200); setVisible(true);
221
addWindowListener(new WindowAdapter()
222
{ public void windowClosing(WindowEvent e)
223
{ System.exit(0);
224
}
225
});
226
b1=new JButton("按钮1",new ImageIcon("f:/2000/a1.gif"));
227
b2=new JButton("按钮2",new ImageIcon("f:/2000/a2.gif"));
228
b3=new JButton("按钮3",new ImageIcon("f:/2000/a3.gif"));
229
b1.setRolloverIcon(b2.getIcon());
230
b2.setRolloverIcon(b3.getIcon());
231
b3.setRolloverIcon(b1.getIcon());
232
b1.setHorizontalTextPosition(AbstractButton.LEFT);
233
b1.setVerticalTextPosition(AbstractButton.TOP);
234
b2.setHorizontalTextPosition(AbstractButton.RIGHT);
235
b2.setVerticalTextPosition(AbstractButton.BOTTOM);
236
b3.setHorizontalTextPosition(AbstractButton.CENTER);
237
b3.setVerticalTextPosition(AbstractButton.CENTER);
238
Container con=getContentPane();
239
con.setLayout(new FlowLayout());
240
con.add(b1);con.add(b2); con.add(b3);
241
con.validate();
242
}
243
}
244
public class Example25_10
245
{ public static void main(String args[])
246
{ new MyWin();
247
}
248
}
249![]()
250
//例子11
251
import javax.swing.*;import java.awt.BorderLayout;
252
import java.awt.event.*;import java.awt.*;
253
public class Example25_11 extends JApplet implements ActionListener
254
{ JLabel label_1,label_2;JButton button;JTextArea text;
255
public void init()
256
{ button=new JButton("确定");text=new JTextArea();
257
Icon icon=new ImageIcon("tom.jpg");
258
label_1=new JLabel("标签1",icon,JLabel.CENTER);
259
label_2=new JLabel("标签2");
260
getContentPane().add(text,BorderLayout.CENTER);
261
getContentPane().add(button,BorderLayout.WEST);
262
getContentPane().add(label_1,BorderLayout.NORTH);
263
getContentPane().add(label_2,BorderLayout.SOUTH);
264
button.addActionListener(this);
265
}
266
public void actionPerformed(ActionEvent e)
267
{ button.setIcon(label_1.getIcon());
268
label_1.setHorizontalTextPosition(JLabel.LEFT);
269
}
270
}
271![]()
272
//例子12
273
import javax.swing.*;
274
import java.awt.*;
275
import java.awt.event.*;
276
import javax.swing.border.*;
277
class 候选人 extends JCheckBox
278
{ int 得票数=0;
279
候选人(String name,Icon icon)
280
{ super(name,icon);
281
}
282
public int 获取得票数()
283
{ return 得票数;
284
}
285
public void 增加票数()
286
{ 得票数++;
287
}
288
}
289![]()
290
class MyWin extends JFrame implements ActionListener
291
{ Box baseBox,boxH,boxV;
292
JTextArea text;
293
JButton button;
294
候选人 候选人1, 候选人2, 候选人3;
295
public MyWin()
296
{ setBounds(100,100,300,200);
297
setVisible(true);
298
addWindowListener(new WindowAdapter()
299
{ public void windowClosing(WindowEvent e)
300
{ System.exit(0);
301
}
302
});
303
baseBox=Box.createHorizontalBox();
304
boxH=Box.createHorizontalBox();
305
boxV=Box.createVerticalBox();
306
候选人1=new 候选人("张小兵",new ImageIcon("a1.gif"));
307
候选人2=new 候选人("李大营",new ImageIcon("a2.gif"));
308
候选人3=new 候选人("王中堂",new ImageIcon("a3.gif"));
309
候选人1.setSelectedIcon(new ImageIcon("b1.gif"));
310
候选人2.setSelectedIcon(new ImageIcon("b2.gif"));
311
候选人3.setSelectedIcon(new ImageIcon("b3.gif"));
312
boxH.add(候选人1); boxH.add(候选人2); boxH.add(候选人3);
313
text=new JTextArea();
314
button=new JButton("显示得票数");
315
button.addActionListener(this);
316
boxV.add(text); boxV.add(button); baseBox.add(boxH);
317
baseBox.add(boxV);
318
Container con=getContentPane();
319
con.setLayout(new FlowLayout());
320
con.add(baseBox);
321
con.validate();
322
}
323
public void actionPerformed(ActionEvent e)
324
{ text.setText(null);
325
if(候选人1.isSelected())
326
{ 候选人1.增加票数();
327
}
328
if(候选人2.isSelected())
329
{ 候选人2.增加票数();
330
}
331
if(候选人3.isSelected())
332
{ 候选人3.增加票数();
333
}
334
text.append("\n"+候选人1.getText()+":"+候选人1.获取得票数());
335
text.append("\n"+候选人2.getText()+":"+候选人2.获取得票数());
336
text.append("\n"+候选人3.getText()+":"+候选人3.获取得票数());
337
候选人1.setSelected(false); 候选人2.setSelected(false);
338
候选人3.setSelected(false);
339
}
340
}
341
public class Example25_12
342
{ public static void main(String args[])
343
{ new MyWin();
344
}
345
}
346![]()
347
//例子13
348
import javax.swing.*;
349
import java.awt.*;import java.awt.event.*;
350
class Mywindow extends JFrame implements ItemListener
351
{ JRadioButton button1,button2,button3;ButtonGroup fruit;
352
JLabel label ;JScrollPane scroll;JPanel panel;JSplitPane split;
353
Mywindow()
354
{ setSize(200,400);setVisible(true);
355
Container con=getContentPane();
356
fruit=new ButtonGroup();
357
button1=new JRadioButton("苹果");
358
fruit.add(button1);
359
button2=new JRadioButton("香蕉");
360
fruit.add(button2);
361
button3=new JRadioButton("西瓜");
362
fruit.add(button3);
363
label=new JLabel();panel=new JPanel();
364
scroll=new JScrollPane(label);
365
panel.add(button1);panel.add(button2);panel.add(button3);
366
split=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,panel, scroll);
367
con.add(split);
368
button1.addItemListener(this);button2.addItemListener(this);
369
button3.addItemListener(this);
370
addWindowListener(new WindowAdapter()
371
{public void windowClosing(WindowEvent e)
372
{System.exit(0);}});
373
}
374
public void itemStateChanged(ItemEvent e)
375
{if(e.getItemSelectable()==button1)
376
{label.setIcon(new ImageIcon("a.jpg")); }
377
else if(e.getItemSelectable()==button2)
378
{label.setIcon(new ImageIcon("b.jpg")); }
379
else if(e.getItemSelectable()==button3)
380
{label.setIcon(new ImageIcon("c.jpg")); }
381
}
382
}
383
public class Example25_13
384
{ public static void main(String args[])
385
{ Mywindow win=new Mywindow();win.pack();
386
}
387
}
388![]()
389
//例子14
390
import javax.swing.*;import java.awt.*;import java.awt.event.*; import java.net.*;
391
public class Example25_14 extends JApplet implements ItemListener
392
{ JComboBox choice1,choice2; JSplitPane split1,split2;
393
JLabel label; URL url;
394
public void init()
395
{ Container con=getContentPane(); String[] s={"苹果", "香蕉" ,"西瓜"};
396
choice1=new JComboBox(s);choice2=new JComboBox();
397
label=new JLabel();choice2.setEditable(true);
398
split1=newJSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,choice1,choice2);
399
split2=new JSplitPane(JSplitPane.VERTICAL_SPLIT,true,split1,label);
400
choice1.addItemListener(this);choice2.addItemListener(this);con.add(split2);
401
}
402
public void itemStateChanged(ItemEvent e)
403
{ if(e.getItemSelectable()==choice1)
404
{ if(choice1.getSelectedIndex()==0)
405
{ label.setIcon(new ImageIcon("a.jpg"));}
406
else if(choice1.getSelectedIndex()==1)
407
{ label.setIcon(new ImageIcon("b.jpg")); }
408
else if(choice1.getSelectedIndex()==2)
409
{label.setIcon(new ImageIcon("c.jpg"));}
410
}
411
else if(e.getItemSelectable()==choice2)
412
{ try{url=new URL((String)choice2.getSelectedItem());
413
label.setText("你正在连接到:"+choice2.getSelectedItem());
414
}
415
catch(MalformedURLException g)
416
{ label.setText("不正确的URL:"+url);
417
}
418
getAppletContext().showDocument(url);
419
}
420
}
421
}
422![]()
423
//例子15
424
import javax.swing.*;
425
import javax.swing.text.*;
426
import java.awt.*;
427
class DigitDocumnet extends PlainDocument
428
{ public void insertString(int offset ,String s,AttributeSet a)
429
{ char c=s.charAt(0);
430
if ((c<='9'&&c>='0')||(c=='.'))
431
{ try {super.insertString(offset,s,a);}
432
catch(BadLocationException e){}
433
}
434
}
435
}
436
public class DigitText extends JApplet
437
{ JTextField text=null;
438
DigitDocumnet document=new DigitDocumnet();
439
public void init()
440
{ text=new JTextField(30);
441
Container con= getContentPane();
442
con.setLayout(new FlowLayout());
443
text.setDocument(document);
444
con.add(text);
445
}
446
}
447![]()
448
//例子16
449
import javax.swing.*;
450
import javax.swing.text.*;
451
import java.awt.*;
452
public class Example25_16 extends JApplet
453
{ JTextPane textpane;
454
public void init()
455
{ textpane=new JTextPane();//创建文本窗格。
456
getContentPane().add(textpane);
457
}
458
}
459![]()
460
//例子17
461
import javax.swing.*;import javax.swing.text.*;
462
import java.awt.*;
463
public class Example25_17 extends JApplet
464
{ JTextPane textpane;
465
MutableAttributeSet center_align,char_style;
466
public void init()
467
{ textpane=new JTextPane();//创建文本窗格。
468
JScrollPane scroll=
469
new ScrollPane(textpane,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
470
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
471
center_align=new SimpleAttributeSet();
472
char_style=new SimpleAttributeSet(); //创建属性对象。
473
StyleConstants.setAlignment(center_align,StyleConstants.ALIGN_CENTER);
474
StyleConstants.setFontFamily( char_style,"Serif");
475
StyleConstants.setFontSize(char_style,70);
476
StyleConstants.setForeground(char_style,Color.red);//为属性对象指定值
477
textpane.setParagraphAttributes(center_align,true);//文本窗格设置文本的属性
478
textpane.setCharacterAttributes(char_style,true);
479
getContentPane().add(scroll);
480
}
481
}
482![]()
483
//例子18
484
import javax.swing.*;import javax.swing.text.*;
485
import java.awt.*;
486
public class Example25_18 extends JApplet
487
{ JTextPane textpane;
488
MutableAttributeSet center_align,char_style_1,char_style_2;
489
public void init()
490
{ textpane=new JTextPane();//创建文本窗口
491
JScrollPane scroll=new
492
JScrollPane(textpane,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
493
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
494
Document mydocument=textpane.getDocument();//初始化一个文档。
495
center_align=new SimpleAttributeSet();
496
char_style_1=new SimpleAttributeSet();
497
char_style_2=new SimpleAttributeSet();
498
StyleConstants.setAlignment(center_align,StyleConstants.ALIGN_CENTER);
499
StyleConstants.setFontFamily( char_style_1,"Courier");
500
StyleConstants.setFontSize(char_style_1,20);
501
StyleConstants.setForeground(char_style_1,Color.red);
502
StyleConstants.setFontFamily( char_style_2,"Serif");
503
StyleConstants.setFontSize(char_style_2,14);
504
StyleConstants.setForeground(char_style_2,Color.blue);
505
textpane.setParagraphAttributes(center_align,true);
506
textpane.setCharacterAttributes(char_style_1,true);
507
try{ textpane.insertIcon(new ImageIcon("a.jpg"));
508
mydocument.insertString(mydocument.getLength(),"Lovely Apple\n",char_style_1);
509
}
510
catch(BadLocationException e) {}
511
textpane.setParagraphAttributes(center_align,true);
512
textpane.setCharacterAttributes(char_style_2,true);
513
try{ mydocument.insertString(mydocument.getLength(),
514
"I Want It\n",char_style_2);
515
}
516
catch(BadLocationException e) {}
517
getContentPane().add(scroll);
518
}
519
}
520![]()
521
//例子19
522
import javax.swing.*;
523
import javax.swing.text.*;
524
import java.awt.*;import java.io.*;
525
public class Example25_19 extends JApplet
526
{ JTextPane textpane;FileInputStream readfile;
527
public void init()
528
{ textpane=new JTextPane();//创建文本窗口
529
JScrollPane scroll=new JScrollPane(textpane);
530
try{ readfile=new FileInputStream("Example25_19.java");
531
}
532
catch(IOException ee){}
533
try{textpane.read(readfile,this);
534
}
535
catch(Exception e)
536
{}
537
getContentPane().add(scroll);
538
}
539
}
540![]()
541
//例子20
542
import javax.swing.*;import java.awt.*;
543
import java.awt.event.*;import java.io.*;
544
class FileWin extends JFrame implements ActionListener
545
{ JButton button; JTextArea text;JTextPane textpane;FileInputStream readfile;
546
JScrollPane scroll;Container con;
547
JFileChooser chooser=new JFileChooser();
548
FileWin()
549
{ super("有文件选择器的窗口");
550
button=new JButton("打开文件选取器");
551
button.addActionListener(this);
552
textpane=new JTextPane();
553
scroll=new JScrollPane(textpane);
554
setSize(200,200); setVisible(true);
555
addWindowListener(new WindowAdapter()
556
{public void windowClosing(WindowEvent e)
557
{ System.exit(0);}} );
558
con=getContentPane();con.add(button,BorderLayout.NORTH);
559
con.add(scroll,BorderLayout.CENTER);
560
}
561
public void actionPerformed(ActionEvent e)
562
{if(e.getSource()==button)
563
{String s;
564
int state=chooser.showOpenDialog(null);
565
File file=chooser.getSelectedFile();
566
if(file!=null&&state==JFileChooser.APPROVE_OPTION)
567
{ try{ readfile=new FileInputStream(file); //建立到文件的输入流。
568
}
569
catch(IOException ee){}
570
try{ textpane.read(readfile,this);//从流中读取数据。
571
}
572
catch(IOException e1){}
573
}
574
}
575
}
576
}
577
public class Example25_20
578
{public static void main(String args[])
579
{FileWin Win=new FileWin(); Win.pack(); }
580
}
581![]()
582
//例子21
583
import javax.swing.*;
584
import java.awt.*;import java.awt.event.*;
585
class TimeWin extends JFrame implements ActionListener
586
{ static JTextArea text1,text2; Boy boy=new Boy();
587
JScrollPane scroll_1,scroll_2;Container con;
588
Timer time_1,time_2 ; //声明2个计时器对象。
589
JSplitPane splitpane;
590
TimeWin()
591
{super("有计时器窗口");
592
time_1=new Timer(1000,this);//TimeWin对象做计时器的监视器。
593
time_2=new Timer(2000,boy);//Boy对象做计时器的监视器。
594
text1=new JTextArea(); text2=new JTextArea();
595
scroll_1=new JScrollPane(text1);
596
scroll_2=new JScrollPane(text2);
597
splitpane=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,scroll_1,
598
scroll_2);
599
setSize(200,200);
600
setVisible(true);
601
con=getContentPane();con.add(splitpane);
602
time_1.start();time_2.start();//启动计时器。
603
addWindowListener(new WindowAdapter()
604
{public void windowClosing(WindowEvent e)
605
{ System.exit(0);}} );
606
}
607
public void actionPerformed(ActionEvent e)
608
{text1.append("欢迎光临!"+"\n"); }
609
}
610
class Boy implements ActionListener
611
{ public void actionPerformed(ActionEvent e)
612
{ TimeWin.text2.append("再见!"+"\n"); }
613
}
614
public class Example25_21
615
{public static void main(String args[])
616
{TimeWin Win=new TimeWin(); Win.pack(); }
617
}
618![]()
619
//例子22
620
import javax.swing.*;import java.awt.*;
621
import java.awt.event.*;
622
class BarWin extends JFrame implements ActionListener
623
{ Timer time_1; int sum=0,i=1;
624
JProgressBar p_bar;Container con;
625
BarWin()
626
{super("窗口");
627
time_1=new Timer(1000,this);//TimeWin对象做计时器的监视器,每
628
//1000毫秒震铃一次。
629
p_bar=new JProgressBar(0,55);
630
p_bar.setBackground(Color.white);
631
p_bar.setStringPainted(true);
632
setSize(200,200);
633
setVisible(true);
634
con=getContentPane();con.add(p_bar,BorderLayout.NORTH);
635
time_1.start();
636
addWindowListener(new WindowAdapter()
637
{public void windowClosing(WindowEvent e)
638
{ System.exit(0);}} );
639
}
640
public void actionPerformed(ActionEvent e)
641
{ sum=sum+i;
642
p_bar.setValue(sum);//吃掉sum/55
643
i=i+1;
644
if(sum>=55)
645
time_1.stop();
646
}
647
}
648
public class Example25_22
649
{public static void main(String args[])
650
{BarWin Win=new BarWin(); Win.pack(); }
651
}
652![]()
653
//例子23
654
import javax.swing.*;
655
import java.io.*;import java.awt.*;import java.awt.event.*;
656
public class Example25_23
657
{ public static void main(String args[])
658
{ byte b[]=new byte[30];
659
JTextArea text=new JTextArea(20,20);
660
JFrame jframe=new JFrame();
661
jframe.setSize(200,300);jframe.setBackground(Color.blue);
662
jframe.setVisible(true);
663
jframe.addWindowListener(new WindowAdapter()
664
{public void windowClosing(WindowEvent e)
665
{System.exit(0);} });
666
Container contentpane=jframe.getContentPane();
667
contentpane.add(text,BorderLayout.CENTER);
668
669
try{ FileInputStream input=new FileInputStream("Example25_23.java");
670
ProgressMonitorInputStream input_progress=
671
new ProgressMonitorInputStream(contentpane,"读取java文件",input);
672
ProgressMonitor p=input_progress.getProgressMonitor();//获得进度条。
673
while(input_progress.read(b)!=-1)
674
{ String s=new String(b);
675
text.append(s);
676
Thread.sleep(1000);//由于文件较小,为了看清进度条这里有意延缓1秒。
677
}
678
}
679
catch(InterruptedException e){}
680
catch(IOException e){}
681
}
682
}
683![]()
684
//例子24
685
import javax.swing.*;import java.awt.*;
686
import java.awt.event.*;
687
public class Example25_24 extends JFrame implements ActionListener
688
{ JTable table;Object a[][];
689
Object name[]={"姓名","英语成绩","数学成绩","总成绩"};
690
JButton button;
691
Example25_24()
692
{ a=new Object[8][4];
693
for(int i=0;i<8;i++)
694
{ for(int j=0;j<4;j++)
695
{if(j!=0)
696
a[i][j]="0";
697
else
698
a[i][j]="姓名";
699
}
700
}
701
button=new JButton("计算每人总成绩");
702
table=new JTable(a,name);
703
button.addActionListener(this);
704
getContentPane().add(new JScrollPane(table),BorderLayout.CENTER);
705
getContentPane().add(new JLabel("修改或录入数据后,需回车确认"),BorderLayout.SOUTH);
706
getContentPane().add(button,BorderLayout.SOUTH);
707
setSize(200,200);
708
setVisible(true);
709
validate();
710
addWindowListener(new WindowAdapter()
711
{public void windowClosing(WindowEvent e)
712
{ System.exit(0);
713
}
714
});
715
}
716
public void actionPerformed(ActionEvent e)
717
{ for(int i=0;i<8;i++)
718
{ double sum=0;
719
boolean boo=true;
720
for(int j=1;j<=2;j++)
721
{ try{
722
sum=sum+Double.parseDouble(a[i][j].toString());
723
}
724
catch(Exception ee)
725
{
726
boo=false;
727
table.repaint();
728
}
729
if(boo==true)
730
{
731
a[i][3]=""+sum;
732
table.repaint();
733
}
734
}
735
}
736
}
737
public static void main(String args[])
738
{ Example25_24 Win=new Example25_24();
739
}
740
}
741![]()
742
//例子25
743
import javax.swing.*;
744
import java.awt.event.*;
745
import java.sql.*;
746
import java.awt.*;
747
class ResultWin extends JFrame implements ActionListener
748
{ Object a[][];
749
Object columnName[]={"学号","姓名","出生日期","数学","物理","英语"};
750
JTable table;JButton button;
751
Container container;
752
String name,xuehao;Date date; int math,physics,english;
753
Connection con;Statement sql; ResultSet rs;
754
JProgressBar p_bar;
755
ResultWin()
756
{ super("数据查询");
757
a=new Object[30][6];
758
table=new JTable(a,columnName);
759
setSize(300,300);setVisible(true);
760
button=new JButton("确定");
761
addWindowListener(new WindowAdapter()
762
{public void windowClosing(WindowEvent e)
763
{ System.exit(0);}} );
764
button.addActionListener(this);
765
p_bar=new JProgressBar(JProgressBar.VERTICAL,0,50);
766
p_bar.setStringPainted(true) ;
767
container=getContentPane();
768
container.add(button,BorderLayout.SOUTH);
769
container.add(new JScrollPane(table),BorderLayout.CENTER);
770
container.add(p_bar,BorderLayout.WEST);
771
}
772
public void actionPerformed(ActionEvent evt)
773
{if(evt.getSource()==button)
774
{int i=0;
775
try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); }
776
catch(ClassNotFoundException e){}
777
try
778
{con=DriverManager.getConnection("jdbc:odbc:redsun","snow","ookk");
779
sql=con.createStatement();
780
rs=sql.executeQuery("SELECT * FROM chengjibiao");
781
while(rs.next())
782
{ xuehao=rs.getString(1); name=rs.getString(2);date=rs.getDate(3);
783
math=rs.getInt("数学"); physics=rs.getInt("物理");english=rs.getInt("英语");
784
a[i][0]=xuehao;a[i][1]=name;a[i][2]=date;a[i][3]=String.valueOf(math);
785
a[i][4]=String.valueOf(physics);a[i][5]=String.valueOf(english);
786
i++;
787
p_bar.setValue(i);p_bar.setString("查询了"+i+"条记录");
788
}
789
con.close();
790
}
791
catch(SQLException e1) {}
792
}
793
}
794
}
795
public class Example25_25
796
{ public static void main(String args[])
797
{ResultWin win=new ResultWin(); win.pack(); }
798
}
799![]()
800
//例子26
801
import javax.swing.*;
802
import java.awt.*;
803
import java.awt.event.*;
804
public class Example24_26 extends JApplet
805
{ Container con;
806
public void init()
807
{con=getContentPane();
808
JMenuBar menubar=new JMenuBar();
809
con.add(menubar,BorderLayout.NORTH);
810
JMenu fileMenu=new JMenu("文件");
811
JMenu editMenu=new JMenu("编辑");
812
JMenu helpMenu=new JMenu("帮助");
813
JMenuItem item1=new JMenuItem("打开");
814
JMenuItem item2=new JMenuItem("保存"); //创建6个菜单项。
815
fileMenu.add(item1); fileMenu.add(item2);
816
menubar.add(fileMenu); menubar.add(editMenu);
817
menubar.add(helpMenu);
818
}
819
}
820![]()
821
//例子27
822
import javax.swing.*;import java.awt.*;
823
import java.awt.event.*;
824
class ToolWin extends JFrame implements ActionListener
825
{ JButton button1,button2; JToolBar bar; Container con;
826
ToolWin()
827
{con=getContentPane();
828
setSize(300,250);setVisible(true);
829
Icon open_icon =new ImageIcon("open.gif");
830
Icon save_icon =new ImageIcon("save.gif");
831
button1=new JButton(open_icon); button2=new JButton(save_icon);
832
bar=new JToolBar();//工具条对象
833
bar.add(button1);bar.add(button2);
834
con.add(bar,BorderLayout.NORTH);
835
button1.addActionListener(this);
836
button1.setToolTipText("open");//设置组件的提示文字
837
button2.setToolTipText("save");
838
}
839
public void actionPerformed(ActionEvent e)
840
{if(e.getSource()==button1)
841
{JFileChooser c=new JFileChooser();
842
c.showOpenDialog(null);
843
}
844
}
845
}
846
public class Example25_27
847
{static void main(String args[])
848
{ToolWin win=new ToolWin() ;win.pack();}
849
}
850![]()
851
//例子28
852
import javax.swing.*;import javax.swing.tree.*;
853
import java.awt.*;
854
public class Mytree extends JApplet
855
{ public void init()
856
{Container con=getContentPane();
857
DefaultMutableTreeNode root=new DefaultMutableTreeNode("c:\\");//树的根节点。
858
DefaultMutableTreeNode t1=new DefaultMutableTreeNode("dos");//节点。
859
DefaultMutableTreeNode t2=new DefaultMutableTreeNode("java");//节点。
860
DefaultMutableTreeNode t1_1=new DefaultMutableTreeNode("applet");
861
DefaultMutableTreeNode t1_2=new DefaultMutableTreeNode("jre");
862
root.add(t1);root.add(t2);
863
t1.add(t1_1);t1.add(t1_2);//t1_1,t1_2成为t1的子节点。
864
JTree tree =new JTree(root); //创建根为root的树。
865
JScrollPane scrollpane=new JScrollPane(tree);
866
con.add(scrollpane);
867
}
868
}
869![]()
870
//例子29
871
import javax.swing.*;
872
import javax.swing.tree.*;import java.awt.*;
873
import java.awt.event.*;import javax.swing.event.*;
874
public class Mytree2 extends JFrame implements TreeSelectionListener
875
{ JTree tree=null;JTextArea text=new JTextArea(20,20);
876
Mytree2()
877
{Container con=getContentPane();
878
DefaultMutableTreeNode root=new DefaultMutableTreeNode("同学通讯录");
879
DefaultMutableTreeNode t1=new DefaultMutableTreeNode("大学同学");
880
DefaultMutableTreeNode t2=new DefaultMutableTreeNode("研究生同学");
881
DefaultMutableTreeNode t1_1=new DefaultMutableTreeNode("董明光");
882
DefaultMutableTreeNode t1_2=new DefaultMutableTreeNode("李晓");
883
DefaultMutableTreeNode t2_1=new DefaultMutableTreeNode("王光明");
884
DefaultMutableTreeNode t2_2=new DefaultMutableTreeNode("代学才");
885
root.add(t1);root.add(t2);
886
t1.add(t1_1);t1.add(t1_2); t2.add(t2_1);t2.add(t2_2);
887
tree =new JTree(root);
888
JScrollPane scrollpane=new JScrollPane(text);
889
JSplitPane splitpane=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
890
true,tree,scrollpane);
891
tree.addTreeSelectionListener(this);
892
con.add(splitpane);
893
addWindowListener(new WindowAdapter()
894
{ public void windowClosing(WindowEvent e)
895
{System.exit(0);} });
896
setVisible(true);setBounds(70,80,200,300);
897
}
898
public void valueChanged(TreeSelectionEvent e)
899
{ if(e.getSource()==tree)
900
{DefaultMutableTreeNode node=
901
(DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
902
if(node.isLeaf())
903
{ String str=node.toString();
904
if(str.equals("董明光"))
905
{text.setText(str+":联系电话:0411-4209876");}
906
else if(str.equals("李晓"))
907
{text.setText(str+":联系电话:010-62789876");}
908
else if(str.equals("王光明"))
909
{text.setText(str+":联系电话:0430-63596677");}
910
else if(str.equals("代学才"))
911
{text.setText(str+":联系电话:020-85192789");}
912
}
913
else
914
{text.setText(node.getUserObject().toString());
915
}
916
}
917
}
918
}
919
class Example25_29
920
{public static void main(String args[])
921
{ Mytree2 win=new Mytree2();win.pack();}
922
}
923![]()
924
//例子30
925
import javax.swing.*;import javax.swing.tree.*;
926
import java.awt.*;
927
public class Mytree3 extends JApplet
928
{ public void init()
929
{Container con=getContentPane();
930
DefaultMutableTreeNode root=new DefaultMutableTreeNode("c:\\");//树的根节点。
931
DefaultMutableTreeNode t1=new DefaultMutableTreeNode("dos");//节点。
932
DefaultMutableTreeNode t2=new DefaultMutableTreeNode("java");//节点。
933
DefaultMutableTreeNode t1_1=new DefaultMutableTreeNode("wps");
934
DefaultMutableTreeNode t1_2=new DefaultMutableTreeNode("epg");
935
DefaultMutableTreeNode t2_1=new DefaultMutableTreeNode("applet");
936
DefaultMutableTreeNode t2_2=new DefaultMutableTreeNode("jre");
937
root.add(t1);root.add(t2);
938
t1.add(t1_1);t1.add(t1_2);
939
t2.add(t2_1);t2.add(t2_2);
940
JTree tree =new JTree(root); //创建根为root的树。
941
DefaultTreeCellRenderer render=new DefaultTreeCellRenderer();
942
render.setLeafIcon(new ImageIcon("leaf.gif"));
943
render.setBackground(Color.yellow);
944
render.setClosedIcon(new ImageIcon("close.gif"));
945
render.setOpenIcon(new ImageIcon("open.gif"));
946
render.setTextSelectionColor(Color.red);
947
render.setTextNonSelectionColor(Color.green);
948
render.setFont(new Font("TimeRoman",Font.BOLD,16));
949
tree.setCellRenderer(render);
950
JScrollPane scrollpane=new JScrollPane(tree);
951
con.add(scrollpane);
952
}
953
}
954![]()
955
//例子31
956
import javax.swing.*;
957
import javax.swing.tree.*;
958
import java.awt.*;
959
import java.awt.event.*;
960
import java.io.*;import java.util.*;
961
class Classmate extends JFrame
962
{ JTree tree=null; DefaultMutableTreeNode root;
963
BufferedReader in; FileReader file;
964
Classmate()
965
{ Container con=getContentPane();
966
String s=null;
967
try { File f=new File("通讯录.txt");
968
file=new FileReader(f);
969
in=new BufferedReader(file);
970
}
971
catch(FileNotFoundException e){}
972
try { s=in.readLine(); //读取第一行并用它创建根节点。
973
root=new DefaultMutableTreeNode(s);
974
}
975
catch(IOException exp){}
976
try
977
{ while((s=in.readLine())!=null&&(s.startsWith("%")))
978
{ s=in.readLine();
979
DefaultMutableTreeNode 同学种类=new DefaultMutableTreeNode(s);
980
root.add(同学种类);
981
while((s=in.readLine())!=null&&!(s.startsWith("end")))
982
{ StringTokenizer tokenizer=new StringTokenizer(s,"#");
983
String temp=tokenizer.nextToken();
984
DefaultMutableTreeNode 同学种类_姓名
985
=new DefaultMutableTreeNode(temp);
986
同学种类.add(同学种类_姓名);
987
while(tokenizer.hasMoreTokens())
988
{
989
同学种类_姓名.add(new DefaultMutableTreeNode(tokenizer.nextToken()));
990
}
991
}
992
}
993
}
994
catch(IOException exp){}
995
tree =new JTree(root);
996
JScrollPane scrollpane=new JScrollPane(tree);
997
con.add(scrollpane);
998
addWindowListener(new WindowAdapter()
999
{ public void windowClosing(WindowEvent e)
1000
{System.exit(0);} });
1001
setVisible(true);setBounds(70,80,200,300);
1002
}
1003
}
1004
public class Example31
1005
{ public static void main(String args[])
1006
{ Classmate win=new Classmate();win.pack();}
1007
}
1008![]()
1009
//例子32
1010
import javax.swing.*;
1011
import javax.swing.tree.*;
1012
import java.awt.*;
1013
import java.awt.event.*;
1014
import javax.swing.event.*;
1015
import java.io.*;
1016
class Remember extends JFrame implements TreeSelectionListener,ActionListener
1017
{ JTree tree=null;JTextArea text=new JTextArea(" ",20,20);int i=0;
1018
DefaultMutableTreeNode root;JButton b_save=new JButton("保存日志"),
1019
b_del=new JButton("删除日志");
1020
DefaultMutableTreeNode month[]=new DefaultMutableTreeNode[13];
1021
Remember()
1022
{ Container con=getContentPane();
1023
DefaultMutableTreeNode root=new DefaultMutableTreeNode("日历记事本");
1024
for(i=1;i<=12;i++)
1025
{ month[i]=new DefaultMutableTreeNode(""+i+"月");
1026
root.add(month[i]);
1027
}
1028
for(i=1;i<=12;i++)
1029
{ if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
1030
{ for(int j=1;j<=31;j++)
1031
month[i].add(new DefaultMutableTreeNode(j+"日"));
1032
}
1033
else if(i==4||i==6||i==9||i==11)
1034
{ for(int j=1;j<=30;j++)
1035
month[i].add(new DefaultMutableTreeNode(j+"日"));
1036
}
1037
else
1038
{ for(int j=1;j<=28;j++)
1039
month[i].add(new DefaultMutableTreeNode(j+"日"));
1040
}
1041
}
1042
b_save.addActionListener(this); b_del.addActionListener(this);
1043
tree =new JTree(root);
1044
JPanel p=new JPanel();p.setLayout(new BorderLayout());
1045
JScrollPane scrollpane_1=new JScrollPane(text);
1046
p.add(scrollpane_1,BorderLayout.CENTER);
1047
JPanel p_1=new JPanel();p_1.add(b_save);p_1.add(b_del);
1048
p.add(p_1,BorderLayout.NORTH);
1049
JScrollPane scrollpane_2=new JScrollPane(tree);
1050
JSplitPane splitpane=
1051
new SplitPane(JSplitPane.HORIZONTAL_SPLIT,true,scrollpane_2,p);
1052
tree.addTreeSelectionListener(this);
1053
con.add(splitpane);
1054
addWindowListener(new WindowAdapter()
1055
{ public void windowClosing(WindowEvent e)
1056
{System.exit(0);
1057
}
1058
});
1059
setVisible(true);setBounds(70,80,200,300);
1060
}
1061
public void valueChanged(TreeSelectionEvent e)
1062
{ text.setText(" ");
1063
if(e.getSource()==tree)
1064
{ DefaultMutableTreeNode node=
1065
(DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
1066
if(node.isLeaf())
1067
{ String str=node.toString();
1068
for(int i=0;i<=12;i++)
1069
{ if(node.getParent()==month[i])
1070
{ try
1071
{ String temp=null;
1072
File f=new File(node.getParent().toString()+str+".txt");
1073
FileReader file=new FileReader(f);
1074
BufferedReader in=new BufferedReader(file);
1075
while((temp=in.readLine())!=null)
1076
text.append(temp+'\n');
1077
file.close();in.close();
1078
}
1079
catch(FileNotFoundException e1){}
1080
catch(IOException e1){}
1081
}
1082
}
1083
}
1084
}
1085
}
1086
public void actionPerformed(ActionEvent e)
1087
{ if(e.getSource()==b_save)
1088
{ DefaultMutableTreeNode node=
1089
(DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
1090
String str=node.toString();
1091
if(node.isLeaf())
1092
{ try
1093
{ File f=new File(node.getParent().toString()+str+".txt");
1094
FileWriter tofile=new FileWriter(f);
1095
BufferedWriter out=new BufferedWriter(tofile);
1096
out.write(text.getText(),0,(text.getText()).length());
1097
out.flush();
1098
tofile.close();out.close();
1099
}
1100
catch(FileNotFoundException e1){}
1101
catch(IOException e1){}
1102
}
1103
}
1104
else if(e.getSource()==b_del)
1105
{ DefaultMutableTreeNode node=
1106
(DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
1107
String str=node.toString();
1108
if(node.isLeaf())
1109
{
1110
File f=new File(node.getParent().toString()+str+".txt");
1111
f.delete();
1112
}
1113
}
1114
}
1115
}
1116
public class Example25_32
1117
{ public static void main(String args[])
1118
{ Remember win=new Remember();win.pack();
1119
}
1120
}
1121![]()

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

398

399

400

401

402

403

404

405

406

407

408

409

410

411

412

413

414

415

416

417

418

419

420

421

422

423

424

425

426

427

428

429

430

431

432

433

434

435

436

437

438

439

440

441

442

443

444

445

446

447

448

449

450

451

452

453

454

455

456

457

458

459

460

461

462

463

464

465

466

467

468

469

470

471

472

473

474

475

476

477

478

479

480

481

482

483

484

485

486

487

488

489

490

491

492

493

494

495

496

497

498

499

500

501

502

503

504

505

506

507

508

509

510

511

512

513

514

515

516

517

518

519

520

521

522

523

524

525

526

527

528

529

530

531

532

533

534

535

536

537

538

539

540

541

542

543

544

545

546

547

548

549

550

551

552

553

554

555

556

557

558

559

560

561

562

563

564

565

566

567

568

569

570

571

572

573

574

575

576

577

578

579

580

581

582

583

584

585

586

587

588

589

590

591

592

593

594

595

596

597

598

599

600

601

602

603

604

605

606

607

608

609

610

611

612

613

614

615

616

617

618

619

620

621

622

623

624

625

626

627

628

629

630

631

632

633

634

635

636

637

638

639

640

641

642

643

644

645

646

647

648

649

650

651

652

653

654

655

656

657

658

659

660

661

662

663

664

665

666

667

668

669

670

671

672

673

674

675

676

677

678

679

680

681

682

683

684

685

686

687

688

689

690

691

692

693

694

695

696

697

698

699

700

701

702

703

704

705

706

707

708

709

710

711

712

713

714

715

716

717

718

719

720

721

722

723

724

725

726

727

728

729

730

731

732

733

734

735

736

737

738

739

740

741

742

743

744

745

746

747

748

749

750

751

752

753

754

755

756

757

758

759

760

761

762

763

764

765

766

767

768

769

770

771

772

773

774

775

776

777

778

779

780

781

782

783

784

785

786

787

788

789

790

791

792

793

794

795

796

797

798

799

800

801

802

803

804

805

806

807

808

809

810

811

812

813

814

815

816

817

818

819

820

821

822

823

824

825

826

827

828

829

830

831

832

833

834

835

836

837

838

839

840

841

842

843

844

845

846

847

848

849

850

851

852

853

854

855

856

857

858

859

860

861

862

863

864

865

866

867

868

869

870

871

872

873

874

875

876

877

878

879

880

881

882

883

884

885

886

887

888

889

890

891

892

893

894

895

896

897

898

899

900

901

902

903

904

905

906

907

908

909

910

911

912

913

914

915

916

917

918

919

920

921

922

923

924

925

926

927

928

929

930

931

932

933

934

935

936

937

938

939

940

941

942

943

944

945

946

947

948

949

950

951

952

953

954

955

956

957

958

959

960

961

962

963

964

965

966

967

968

969

970

971

972

973

974

975

976

977

978

979

980

981

982

983

984

985

986

987

988

989

990

991

992

993

994

995

996

997

998

999

1000

1001

1002

1003

1004

1005

1006

1007

1008

1009

1010

1011

1012

1013

1014

1015

1016

1017

1018

1019

1020

1021

1022

1023

1024

1025

1026

1027

1028

1029

1030

1031

1032

1033

1034

1035

1036

1037

1038

1039

1040

1041

1042

1043

1044

1045

1046

1047

1048

1049

1050

1051

1052

1053

1054

1055

1056

1057

1058

1059

1060

1061

1062

1063

1064

1065

1066

1067

1068

1069

1070

1071

1072

1073

1074

1075

1076

1077

1078

1079

1080

1081

1082

1083

1084

1085

1086

1087

1088

1089

1090

1091

1092

1093

1094

1095

1096

1097

1098

1099

1100

1101

1102

1103

1104

1105

1106

1107

1108

1109

1110

1111

1112

1113

1114

1115

1116

1117

1118

1119

1120

1121
