| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package com.bulenkov.iconloader; |
| 18 |
|
| 19 |
import javax.swing.*; |
| 20 |
import java.awt.*; |
| 21 |
|
| 22 |
public class IconLoaderDemoFrame extends JFrame { |
| 23 |
public static void main(String[] args) { |
| 24 |
new IconLoaderDemoFrame(); |
| 25 |
} |
| 26 |
|
| 27 |
public IconLoaderDemoFrame() throws HeadlessException { |
| 28 |
super("IconLoader Demo"); |
| 29 |
setSize(300, 100); |
| 30 |
final JPanel panel = new JPanel(new BorderLayout()); |
| 31 |
getContentPane().add(panel); |
| 32 |
JPanel bottom = new JPanel(new BorderLayout()); |
| 33 |
panel.add(bottom, BorderLayout.SOUTH); |
| 34 |
JButton disabledButton = new JButton("Print disabled", IconLoader.getIcon("/icons/print.png")); |
| 35 |
disabledButton.setEnabled(false); |
| 36 |
JButton enabledButton = new JButton("Print enabled", IconLoader.getIcon("/icons/print.png")); |
| 37 |
bottom.add(disabledButton, BorderLayout.WEST); |
| 38 |
bottom.add(enabledButton, BorderLayout.EAST); |
| 39 |
|
| 40 |
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); |
| 41 |
setVisible(true); |
| 42 |
} |
| 43 |
} |