List of usage examples for javax.swing.plaf.metal MetalIconFactory getFileChooserHomeFolderIcon
public static Icon getFileChooserHomeFolderIcon()
From source file:MainClass.java
public static void main(String args[]) { JFrame f = new JFrame("JToolBar Sample"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JToolBar toolbar = new JToolBar(); Icon icon = MetalIconFactory.getFileChooserDetailViewIcon(); JToggleButton button = new JToggleButton(icon); toolbar.add(button);/*from w w w. j a v a2 s . c o m*/ icon = MetalIconFactory.getFileChooserHomeFolderIcon(); button = new JToggleButton(icon); toolbar.add(button); icon = MetalIconFactory.getFileChooserListViewIcon(); button = new JToggleButton(icon); toolbar.add(button); f.add(toolbar, BorderLayout.NORTH); f.setSize(300, 100); f.setVisible(true); }
From source file:Main.java
public static void main(String args[]) { JFrame f = new JFrame("JToolbar Sample"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container content = f.getContentPane(); JToolBar toolbar = new JToolBar(); Icon icon = MetalIconFactory.getFileChooserDetailViewIcon(); JToggleButton button = new JToggleButton(icon); toolbar.add(button);/*from w w w . ja v a 2s .c o m*/ icon = MetalIconFactory.getFileChooserHomeFolderIcon(); button = new JToggleButton(icon); toolbar.add(button); icon = MetalIconFactory.getFileChooserListViewIcon(); button = new JToggleButton(icon); toolbar.add(button); content.add(toolbar, BorderLayout.NORTH); f.setSize(300, 100); f.setVisible(true); }
From source file:MainClass.java
public static void main(String[] a) { JFrame frame = new JFrame("Titled Borders"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Border thisBorder = BorderFactory.createTitledBorder("Easy"); Icon thatIcon = MetalIconFactory.getFileChooserHomeFolderIcon(); Border thatBorder1 = new MatteBorder(18, 20, 18, 20, thatIcon); Border thatBorder2 = new TitledBorder(thatBorder1, "Harder"); Font font = new Font("Serif", Font.ITALIC, 12); Border thatBorder = new TitledBorder(thatBorder2, "Hardest", TitledBorder.LEFT, TitledBorder.ABOVE_BOTTOM, font, Color.RED);//from w w w . ja v a 2 s. co m JButton thisButton = new JButton("Easy"); thisButton.setBorder(thisBorder); JButton thatButton = new JButton("Harder"); thatButton.setBorder(thatBorder); Container contentPane = frame.getContentPane(); contentPane.setLayout(new GridLayout(1, 2)); contentPane.add(thisButton); contentPane.add(thatButton); frame.setSize(300, 200); frame.setVisible(true); }
From source file:Main.java
public ShowAction() { super("About"); putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_A)); putValue(Action.SMALL_ICON, MetalIconFactory.getFileChooserHomeFolderIcon()); }
From source file:Main.java
public ShowAction() { super("About"); putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_A)); putValue(Action.NAME, "Go to number "); putValue(Action.LARGE_ICON_KEY, MetalIconFactory.getFileChooserHomeFolderIcon()); }
From source file:Main.java
public Main(String name) { getContentPane().setLayout(new FlowLayout()); JLabel labelTwo = new JLabel("www.java2s.com"); labelTwo.setBorder(BorderFactory.createEtchedBorder()); add(labelTwo);//from w ww .j a v a 2 s. co m JLabel labelThree = new JLabel("MatteBorder"); labelThree.setBorder(BorderFactory.createMatteBorder(10, 10, 10, 10, Color.pink)); add(labelThree); JLabel labelFour = new JLabel("TitledBorder"); labelFour.setBorder(BorderFactory.createTitledBorder( BorderFactory.createMatteBorder(10, 10, 10, 10, MetalIconFactory.getFileChooserHomeFolderIcon()), "Title", TitledBorder.RIGHT, TitledBorder.BOTTOM)); add(labelFour); JLabel labelSix = new JLabel("CompoundBorder"); Border one = BorderFactory.createEtchedBorder(); Border two = BorderFactory.createMatteBorder(4, 4, 4, 4, Color.blue); labelSix.setBorder(BorderFactory.createCompoundBorder(one, two)); add(labelSix); }
From source file:MainClass.java
public ShowAction(Component parentComponent) { super("About"); putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_A)); putValue(Action.SMALL_ICON, MetalIconFactory.getFileChooserHomeFolderIcon()); this.parentComponent = parentComponent; }