JSlider在Linux上隐藏了GTK +和Nimbus LookAndFeel的价值

时间:2016-11-18 04:41:47

标签: linux gtk look-and-feel jslider nimbus

我有这种情况(JSlider在不需要时显示值)。而且我不想在JSlider上显示当前的价值。

  1. 为什么只在Linux上使用LookAndFeel Nimbus和GTK +在JSlider中显示值?
  2. 如何隐藏此值?
  3. 显示在Windows 10,Cent OS 7和MacOS Sierra上运行代码的下一个图像

    enter image description here

    enter image description here

    这是我的代码:

    watch

1 个答案:

答案 0 :(得分:2)

public static void changeLAF(Container container, String laf) {
  try {
    UIManager.setLookAndFeel(laf);
    UIManager.put("Slider.paintValue", false);
  } catch (ClassNotFoundException | InstantiationException | 
      IllegalAccessException | UnsupportedLookAndFeelException e) {
  }
  SwingUtilities.updateComponentTreeUI(container);
}