本文整理汇总了Java中javax.swing.plaf.synth.SynthSliderUI类的典型用法代码示例。如果您正苦于以下问题:Java SynthSliderUI类的具体用法?Java SynthSliderUI怎么用?Java SynthSliderUI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SynthSliderUI类属于javax.swing.plaf.synth包,在下文中一共展示了SynthSliderUI类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import javax.swing.plaf.synth.SynthSliderUI; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(new SynthLookAndFeel());
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
JSlider slider = new JSlider();
slider.setUI(new SynthSliderUI(slider) {
@Override
protected void paintTrack(SynthContext context, Graphics g, Rectangle trackBounds) {
throw new RuntimeException("Test failed: the SynthSliderUI.paintTrack was invoked");
}
});
slider.setPaintTrack(false);
slider.setSize(slider.getPreferredSize());
BufferedImage bufferedImage = new BufferedImage(slider.getWidth(), slider.getHeight(),
BufferedImage.TYPE_INT_ARGB);
slider.paint(bufferedImage.getGraphics());
}
});
}