KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > puppycrawl > tools > checkstyle > InputScopeAnonInner


1 ////////////////////////////////////////////////////////////////////////////////
2
// Test case file for checkstyle.
3
// Created: 2001
4
////////////////////////////////////////////////////////////////////////////////
5
package com.puppycrawl.tools.checkstyle;
6
7 import java.awt.event.MouseEvent JavaDoc;
8 import java.awt.event.MouseAdapter JavaDoc;
9 import javax.swing.JButton JavaDoc;
10
11 /**
12  * Tests for anonymous inner types
13  * @author Lars Kühne
14  **/

15 public class InputScopeAnonInner
16 {
17     /**
18        button.
19     */

20     private JButton JavaDoc mButton = new JButton JavaDoc();
21
22     /**
23        anon inner in member variable initialization.
24     */

25     private Runnable JavaDoc mRunnable = new Runnable JavaDoc() {
26         public void run() // should not have to be documented, class is anon.
27
{
28             System.out.println("running");
29         }
30     };
31
32     /**
33        anon inner in constructor.
34     */

35     InputScopeAnonInner()
36     {
37         mButton.addMouseListener( new MouseAdapter JavaDoc()
38             {
39                 public void mouseClicked( MouseEvent JavaDoc aEv )
40                 {
41                     System.out.println("click");
42                 }
43             } );
44     }
45
46     /**
47        anon inner in method
48     */

49     public void addInputAnonInner()
50     {
51         mButton.addMouseListener( new MouseAdapter JavaDoc()
52             {
53                 public void mouseClicked( MouseEvent JavaDoc aEv )
54                 {
55                     System.out.println("click");
56                 }
57             } );
58     }
59 }
60
Popular Tags