我得到**窗口非常薄的进度条服务器2012 **,当我使用
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
酒吧看行不行在Windows 7,Windows Server 2012中的非常薄。
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的行为,但我看不到与之相关的任何文件。