Java 类javax.swing.plaf.metal.MetalSliderUI 实例源码
项目:jdk8u-jdk
文件:Test6657026.java
private static void test(JSlider slider) {
MetalSliderUI ui = (MetalSliderUI) slider.getUI();
int actual = ui.getTickLength();
if (actual != 11) {
throw new Error(actual + ", but expected 11");
}
}
项目:openjdk-jdk10
文件:Test6657026.java
private static void test(JSlider slider) {
MetalSliderUI ui = (MetalSliderUI) slider.getUI();
int actual = ui.getTickLength();
if (actual != 11) {
throw new Error(actual + ", but expected 11");
}
}
项目:openjdk9
文件:Test6657026.java
private static void test(JSlider slider) {
MetalSliderUI ui = (MetalSliderUI) slider.getUI();
int actual = ui.getTickLength();
if (actual != 11) {
throw new Error(actual + ", but expected 11");
}
}
项目:jdk8u_jdk
文件:Test6657026.java
private static void test(JSlider slider) {
MetalSliderUI ui = (MetalSliderUI) slider.getUI();
int actual = ui.getTickLength();
if (actual != 11) {
throw new Error(actual + ", but expected 11");
}
}
项目:lookaside_java-1.8.0-openjdk
文件:Test6657026.java
private static void test(JSlider slider) {
MetalSliderUI ui = (MetalSliderUI) slider.getUI();
int actual = ui.getTickLength();
if (actual != 11) {
throw new Error(actual + ", but expected 11");
}
}
项目:infobip-open-jdk-8
文件:Test6657026.java
private static void test(JSlider slider) {
MetalSliderUI ui = (MetalSliderUI) slider.getUI();
int actual = ui.getTickLength();
if (actual != 11) {
throw new Error(actual + ", but expected 11");
}
}
项目:jdk8u-dev-jdk
文件:Test6657026.java
private static void test(JSlider slider) {
MetalSliderUI ui = (MetalSliderUI) slider.getUI();
int actual = ui.getTickLength();
if (actual != 11) {
throw new Error(actual + ", but expected 11");
}
}
项目:jdk7-jdk
文件:Test6657026.java
private static void test(JSlider slider) {
MetalSliderUI ui = (MetalSliderUI) slider.getUI();
int actual = ui.getTickLength();
if (actual != 11) {
throw new Error(actual + ", but expected 11");
}
}
项目:openjdk-source-code-learn
文件:Test6657026.java
private static void test(JSlider slider) {
MetalSliderUI ui = (MetalSliderUI) slider.getUI();
int actual = ui.getTickLength();
if (actual != 11) {
throw new Error(actual + ", but expected 11");
}
}
项目:java-swing-tips
文件:MainPanel.java
private MainPanel() {
super(new BorderLayout(5, 5));
JSlider slider1 = new JSlider(0, 100, 0);
slider1.setUI(new TriSliderUI());
slider1.setMajorTickSpacing(10);
slider1.setMinorTickSpacing(5);
slider1.setPaintTicks(true);
slider1.setPaintLabels(true);
JSlider slider2 = new JSlider(0, 100, 0);
slider2.setUI(new MetalSliderUI() {
@Override protected void paintHorizontalLabel(Graphics g, int v, Component l) {
// [JDK-5099681] Windows/Motif L&F: JSlider should use foreground color for ticks. - Java Bug System
// https://bugs.openjdk.java.net/browse/JDK-5099681
JLabel lbl = (JLabel) l;
lbl.setForeground(Color.GREEN);
super.paintHorizontalLabel(g, v, lbl);
}
});
// slider2.setBackground(Color.BLACK);
slider2.setForeground(Color.BLUE);
slider2.setMajorTickSpacing(10);
slider2.setMinorTickSpacing(5);
slider2.setPaintTicks(true);
slider2.setPaintLabels(true);
Box box = Box.createVerticalBox();
box.add(Box.createVerticalStrut(5));
box.add(makeTitledPanel("TriangleSliderUI", slider1));
box.add(Box.createVerticalStrut(5));
box.add(makeTitledPanel("HorizontalLabelColor", slider2));
box.add(Box.createVerticalGlue());
add(box);
setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
setPreferredSize(new Dimension(320, 240));
}
项目:svarog
文件:LogarithmicJSlider.java
private void setLogSliderUI() {
if (this.getUI() instanceof MetalSliderUI) {
this.setUI(new LogMetalSliderUI(this));
} else {
this.setUI(new LogBasicSliderUI(this));
}
}
项目:OLD-OpenJDK8
文件:Test6657026.java
private static void test(JSlider slider) {
MetalSliderUI ui = (MetalSliderUI) slider.getUI();
int actual = ui.getTickLength();
if (actual != 11) {
throw new Error(actual + ", but expected 11");
}
}
项目:JAVA_UNIT
文件:Test6657026.java
private static void test(JSlider slider) {
MetalSliderUI ui = (MetalSliderUI) slider.getUI();
int actual = ui.getTickLength();
if (actual != 11) {
throw new Error(actual + ", but expected 11");
}
}
项目:openjdk-jdk7u-jdk
文件:Test6657026.java
private static void test(JSlider slider) {
MetalSliderUI ui = (MetalSliderUI) slider.getUI();
int actual = ui.getTickLength();
if (actual != 11) {
throw new Error(actual + ", but expected 11");
}
}
项目:openjdk-icedtea7
文件:Test6657026.java
private static void test(JSlider slider) {
MetalSliderUI ui = (MetalSliderUI) slider.getUI();
int actual = ui.getTickLength();
if (actual != 11) {
throw new Error(actual + ", but expected 11");
}
}