我得到**窗口非常薄的進度條服務器2012 **,當我使用Java的外觀和感覺:Windows Server 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的行爲,但我看不到與之相關的任何文件。
我認爲這是Java的外觀和感覺的行爲。但是,您可以自定義UI參數。 – khachik 2013-03-19 08:51:40