100个java小例子

源代码在线查看: demoslider.java

软件大小: 748 K
上传用户: kzdai22
关键词: java 100
下载地址: 免注册下载 普通下载 VIP

相关代码

				import javax.swing.*;
				import java.awt.*;
				
				public class DemoSlider extends JDialog {
				
				  public DemoSlider(JFrame f) {
				    super(f, "Demo Slider", true);
				    setBounds(200,200,300,100);
				      
				    JPanel JPc = new JPanel();
				    JPc.setLayout(new BorderLayout());      
				    //JLabel JL = new JLabel("Current Value: ");
				    //JPc.add(JL,BorderLayout.NORTH);
				
				    JSlider JS = new JSlider(JSlider.HORIZONTAL,0,100,0);
				    JS.setMinorTickSpacing(5);
				    JS.setMajorTickSpacing(10);
				    JS.setPaintTicks(true);
				    JS.setPaintLabels(true);
				    JS.setLabelTable(JS.createStandardLabels(10));
				    JPc.add(JS,BorderLayout.SOUTH);
				    
				    getContentPane().add(JPc);
				  }//end of DemoSlider()
				}//end of class DemoSlider
								

相关资源