4 |
import java.awt.event.*; |
import java.awt.event.*; |
5 |
import javax.swing.plaf.*; |
import javax.swing.plaf.*; |
6 |
|
|
7 |
|
/** |
8 |
|
* An instance of JCheckbox can be added to a panel, frame etc |
9 |
|
* |
10 |
|
* @author Ronald Veldema (rveldema@cs.vu.nl) |
11 |
|
*/ |
12 |
|
|
13 |
|
|
14 |
|
|
15 |
public class JCheckBox extends JToggleButton |
public class JCheckBox extends JToggleButton |
16 |
{ |
{ |
17 |
JCheckBox() |
public JCheckBox() |
18 |
{ |
{ |
19 |
this(null, null); |
this(null, null); |
20 |
} |
} |
21 |
JCheckBox(Action a) |
public JCheckBox(Action a) |
22 |
{ |
{ |
23 |
this(); |
this(); |
24 |
setAction(a); |
setAction(a); |
25 |
} |
} |
26 |
|
|
27 |
JCheckBox(Icon icon) |
public JCheckBox(Icon icon) |
28 |
{ |
{ |
29 |
this(null, icon); |
this(null, icon); |
30 |
} |
} |
31 |
|
|
32 |
JCheckBox(String text) |
public JCheckBox(String text) |
33 |
{ |
{ |
34 |
this(text, null); |
this(text, null); |
35 |
} |
} |
36 |
|
|
37 |
JCheckBox(String text, Icon icon) |
public JCheckBox(String text, Icon icon) |
38 |
{ |
{ |
39 |
super(text, icon); |
super(text, icon); |
40 |
} |
} |
41 |
|
|
42 |
|
|
43 |
AccessibleContext getAccessibleContext() |
public AccessibleContext getAccessibleContext() |
44 |
{ |
{ |
45 |
//Gets the AccessibleContext associated with this JCheckBox. |
//Gets the AccessibleContext associated with this JCheckBox. |
46 |
return null; |
return null; |
47 |
} |
} |
48 |
|
|
49 |
String getUIClassID() |
public String getUIClassID() |
50 |
{ |
{ |
51 |
//Returns a string that specifies the name of the L&F class that renders this component. |
//Returns a string that specifies the name of the L&F class that renders this component. |
52 |
return "JCheckBox"; |
return "JCheckBox"; |