summaryrefslogtreecommitdiff
path: root/javax/swing/JToggleButton.java
blob: 1ffa2a33cc66c48ff499c665e693e7f9bb4085d9 (plain)
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
package javax.swing;

import java.awt.*;
import java.awt.event.*;
import javax.swing.plaf.*;

public class JToggleButton extends AbstractButton
{
    JToggleButton()
    {
	this(null, null);
    }
    JToggleButton(Action a)
    {
	this();
	setAction(a);
    }

    JToggleButton(Icon icon)
    { 
	this(null, icon);
    }    
  
    JToggleButton(String text)
    {
	this(text, null);
    }
      
    JToggleButton(String text, Icon icon)
    {
	this(text, icon, false);
    }

    JToggleButton (String text, Icon icon, boolean selected) 
    {
	super(text, icon);

        // Create the model
        setModel(new ToggleButtonModel(this));
	
        model.setSelected(selected);
    }


    
    AccessibleContext getAccessibleContext()
    {
	//Gets the AccessibleContext associated with this JToggleButton. 
	return null;
    }
  
    String getUIClassID()
    {
	//Returns a string that specifies the name of the L&F class that renders this component.  
	return "JToggleButton";
    }
  
    protected  String paramString()
    {
	return "JToggleButton";
    }
  
  
    void updateUI()
    {	
	ButtonUI b = (ButtonUI)UIManager.getUI(this);
	setUI(b);
    }
}