Java Reference
In-Depth Information
JToolBar toolbar = new JToolBar();
for (int i=0, n=looks.length; i<n; i++) {
JButton button = new JButton(looks[i].getName());
button.setActionCommand(looks[i].getClassName());
button.addActionListener(actionListener);
toolbar.add(button);
}
frame.add(toolbar, BorderLayout.NORTH);
JScrollPane scrollPane = new JScrollPane(table);
frame.add(scrollPane, BorderLayout.CENTER);
frame.setSize(400, 400);
frame.setVisible(true);
}
};
EventQueue.invokeLater(runner);
}
}
Figure 20-3 shows an example of running the property lister.
Figure 20-3. Sample property lister display
Tip To reset a property to the default for the currently installed look and feel, set it to null . This will cause
the component to get the original default from the look and feel.
 
Search WWH ::




Custom Search