public JToggleButton(Action a)
public JToggleButton(String text,Icon icon)
import javax.swing.*;public JToggleButton(String text,Icon icon,boolean selected)
CODING:
import java.awt.*;
import java.awt.event.*;
class myframe extends JFrame
{
myframe()
{
setTitle("Simple JToggleButton");
setLayout(new FlowLayout());
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JToggleButton jb = new JToggleButton("Toggle Button");
jb.setPreferredSize(new Dimension(150,50));
add(jb);
setSize(700, 200);
setVisible(true);
}
}
public class tooggle
{
public static void main(String[] args) {
myframe x = new myframe();
}
}
No comments:
Post a Comment