Methods Summary |
---|
protected void | build()
getContentPane().setLayout(new BorderLayout());
getContentPane().add(BorderLayout.CENTER, buildTabbedPane());
|
protected java.awt.Container | buildAnimatedPanel()
carder = new CardLayout();
cardPane = new JPanel(carder);
JPanel pane = new JPanel(new BorderLayout());
JTable table = new JTable(new CountTableModel());
JScrollPane scrollPane = new JScrollPane(table);
pane.add(BorderLayout.CENTER, scrollPane);
JPanel buttons = new JPanel();
JButton button = new JButton("Start");
buttons.add(button);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
carder.show(cardPane, "animation");
animated.start();
Thread performer = new Thread(new Runnable() {
public void run() {
try {
Thread.sleep(5000);
} catch (InterruptedException ie) { }
animated.stop();
carder.show(cardPane, "form");
}
}, "Performer");
performer.start();
}
});
pane.add(BorderLayout.SOUTH, buttons);
animated = new AnimatedPanel("Waiting in vain...",
UIHelper.readImageIcon("network.png"));
animated.setFont(animated.getFont().deriveFont(Font.BOLD, 16));
cardPane.add("form", pane);
cardPane.add("animation", animated);
return cardPane;
|
protected java.awt.Container | buildInfinitePanel()
JPanel pane = new JPanel(new BorderLayout());
glassPane = new InfiniteProgressPanel();
setGlassPane(glassPane);
JTable table = new JTable(new CountTableModel());
JScrollPane scrollPane = new JScrollPane(table);
pane.add(BorderLayout.CENTER, scrollPane);
JPanel buttons = new JPanel();
JButton button = new JButton("Start");
buttons.add(button);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
glassPane.start();
Thread performer = new Thread(new Runnable() {
public void run() {
try {
Thread.sleep(5000);
} catch (InterruptedException ie) { }
glassPane.stop();
}
}, "Performer");
performer.start();
}
});
pane.add(BorderLayout.SOUTH, buttons);
return pane;
|
protected java.awt.Container | buildTabbedPane()
JTabbedPane tabbedPane = new JTabbedPane();
tabbedPane.add("Animated", buildAnimatedPanel());
tabbedPane.add("Infinite", buildInfinitePanel());
return tabbedPane;
|
public static void | main(java.lang.String[] args)
Demo d = new Demo();
d.setVisible(true);
|