1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
/**
* @param args the command line arguments
*/
public static void main(String[] args)
{
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
UIManager.getDefaults().put("ProgressBar.selectionForeground", Color.YELLOW);
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
JProgressBar bar = new JProgressBar();
bar.setForeground(Color.RED);
bar.setBackground(Color.GREEN);
bar.setValue(60);
bar.setStringPainted(true);
frame.getContentPane().add(bar);
frame.pack();
frame.setVisible(true);
}
});
} |
Partager