List of usage examples for javax.swing JToggleButton JToggleButton
public JToggleButton(Action a)
From source file:MainClass.java
public static void main(String args[]) { JFrame f = new JFrame("JToggleButton Sample"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.add(new JToggleButton("North"), BorderLayout.NORTH); f.add(new JToggleButton("East"), BorderLayout.EAST); f.add(new JToggleButton("West"), BorderLayout.WEST); f.add(new JToggleButton("Center"), BorderLayout.CENTER); f.add(new JToggleButton("South"), BorderLayout.SOUTH); f.setSize(300, 200);//from w w w . j a v a2 s. c o m f.setVisible(true); }
From source file:Main.java
public static void main(String[] args) { AbstractButton jb = new JToggleButton("Press Me"); jb.setSelectedIcon(new MyIcon()); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().add(jb);/*from w w w .j a v a2s. c om*/ f.pack(); f.setVisible(true); }
From source file:Main.java
public static void main(String[] args) { AbstractButton jb = new JToggleButton("Press Me"); jb.setIcon(new MyIcon()); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().add(jb);//from ww w. j av a 2s .com f.pack(); f.setVisible(true); }
From source file:Main.java
public static void main(String[] args) { AbstractButton jb = new JToggleButton("Press Me"); jb.setDisabledIcon(new MyIcon()); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().add(jb);/*from ww w.j a va 2s .c o m*/ f.pack(); f.setVisible(true); }
From source file:Main.java
public static void main(String[] args) { AbstractButton jb = new JToggleButton("Press Me"); jb.setDisabledSelectedIcon(new MyIcon()); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().add(jb);/* ww w . ja v a 2 s . co m*/ f.pack(); f.setVisible(true); }
From source file:Main.java
public static void main(String[] args) { AbstractButton jb = new JToggleButton("Press Me"); jb.setRolloverEnabled(true);/*from w ww .j av a 2 s . c o m*/ jb.setRolloverIcon(new MyIcon()); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().add(jb); f.pack(); f.setVisible(true); }
From source file:Main.java
public static void main(String[] args) { AbstractButton jb = new JToggleButton("Press Me"); jb.setPressedIcon(new MyIcon()); System.out.println(jb.getPressedIcon()); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().add(jb);/*from w ww . ja v a 2 s . c om*/ f.pack(); f.setVisible(true); }
From source file:Main.java
public static void main(String[] args) { AbstractButton jb = new JToggleButton("Press Me"); jb.setHorizontalTextPosition(20);/* w w w . ja va2 s . co m*/ jb.setIcon(new MyIcon()); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().add(jb); f.pack(); f.setVisible(true); }
From source file:Main.java
public static void main(String[] args) { AbstractButton jb = new JToggleButton("Press Me"); jb.setHorizontalAlignment(SwingConstants.RIGHT); jb.setIcon(new MyIcon()); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().add(jb);/*from www. ja v a 2 s .co m*/ f.pack(); f.setVisible(true); }
From source file:ToggleButtonSample.java
public static void main(String args[]) { JFrame f = new JFrame("JToggleButton Sample"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container content = f.getContentPane(); content.add(new JToggleButton("North"), BorderLayout.NORTH); content.add(new JToggleButton("East"), BorderLayout.EAST); content.add(new JToggleButton("West"), BorderLayout.WEST); content.add(new JToggleButton("Center"), BorderLayout.CENTER); content.add(new JToggleButton("South"), BorderLayout.SOUTH); f.setSize(300, 200);/* w w w. jav a 2 s . c o m*/ f.setVisible(true); }