使用すると、 **windows server 2012 ** で非常に薄い進行状況バーが表示されます
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
Windows Server 2012 ではバーが非常に薄く、Windows 7 では問題ないように見えます。
Java のバージョンはすべて (JDK と JRE の両方) 1.6.0_25、32 ビットです。
これは、私がjdk 1.6.0_25を使用している問題(またはドキュメントの問題)を示す完全なコードです
package demos;
import javax.swing.*;
import javax.swing.plaf.metal.DefaultMetalTheme;
import javax.swing.plaf.metal.MetalLookAndFeel;
import java.awt.*;
public class ProgressBarLookAndFeelDemo {
private void createAndShowGUI() {
//Create and set up the window.
JFrame frame = new JFrame("FrameDemo");
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
JPanel progPanel = new JPanel();
progPanel.setLayout(new GridBagLayout());
frame.getContentPane().add(progPanel, BorderLayout.CENTER);
//
JProgressBar progressBar = new JProgressBar();
progressBar.setIndeterminate(true);
progPanel.add(progressBar);
//Display the window.
frame.pack();
frame.setVisible(true);
}
public void showUI(String name) throws ClassNotFoundException, UnsupportedLookAndFeelException, InstantiationException, IllegalAccessException {
MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
if ( name.equalsIgnoreCase("system")) {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
public static void main(String[] args) throws
ClassNotFoundException, UnsupportedLookAndFeelException,
InstantiationException, IllegalAccessException {
if (args.length <1 ) {
System.out.println("usage : One argument is expected none|system");
throw new IllegalArgumentException("java classname none|system");
}
new ProgressBarLookAndFeelDemo().showUI(args[0]);
}
}
これはおそらく Windows 2012 の動作ですが、関連するドキュメントは見つかりませんでした。