8
我的Windows 7機器上的垂直JSlider旋鈕(具有本機外觀)在兩個方向上確實非常小。不只是瘦,但也很短。 alt text http://img101.imageshack.us/img101/8946/verticalsliderproblemwi.jpgWindows 7外觀上的Java Swing渲染錯誤?
任何人都可以證實這一點嗎?我應該報告嗎?如果是這樣,在哪裏?謝謝!
下面是示例程序的代碼(在屏幕截圖):
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
public class SliderTest
{
public static void main(String[] args)
{
// Set the look and feel to that of the system
try
{ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); }
catch (Exception e)
{ System.err.println(e); }
// Launch the GUI from the event dispatch thread
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
JFrame window = new JFrame();
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel contentPane = new JPanel();
contentPane.add(new JSlider(SwingConstants.HORIZONTAL));
contentPane.add(new JSlider(SwingConstants.VERTICAL));
window.setContentPane(contentPane);
window.pack();
window.setLocationRelativeTo(null); // Center window
window.setVisible(true);
}
});
}
}
不知道這是否是一個錯誤,但我看到了同樣的事情。 – foxwoods 2010-05-02 18:02:26
我認爲值得讓Sun,呃,甲骨文可以看到; P我想我會在bugs.sun.com上發佈一些東西(我認爲這是去的地方?)。 – Vimes 2010-05-02 19:10:00
對於所有安裝的L&F,Mac OS X 10.5.8 Java 1.6看起來都很正常。這是'FlowLayout'的工件嗎,'JPanel'的默認值? – trashgod 2010-05-03 03:44:34