Nút bấm trên JSlider thẳng đứng trên máy tính Windows 7 của tôi (với giao diện bản địa) thực sự rất nhỏ ở cả hai hướng. Không chỉ gầy mà còn ngắn. alt text http://img101.imageshack.us/img101/8946/verticalsliderproblemwi.jpgLỗi hiển thị Java Swing trên giao diện Windows 7?
Có ai xác nhận điều này không? Tôi có nên báo cáo không? Nếu vậy, ở đâu? Cảm ơn!
Đây là mã cho chương trình mẫu (trong ảnh chụp màn hình):
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);
}
});
}
}
Không chắc đó có phải là lỗi hay không nhưng tôi cũng thấy điều tương tự. – foxwoods
Tôi nghĩ rằng nó có giá trị làm cho hiển thị cho Sun, er, Oracle, P Tôi nghĩ rằng tôi sẽ đăng một cái gì đó trên bugs.sun.com (Tôi nghĩ rằng đó là nơi để đi?). – Vimes
Trông bình thường trên Mac OS X 10.5.8 Java 1.6 cho tất cả các cài đặt L & F. Đây có phải là một tạo phẩm của 'FlowLayout', giá trị mặc định cho' JPanel' không? – trashgod