import javax.swing.*;
import java.awt.*;
public class SliderPorgressBar extends JApplet
{
JProgressBar pbar=new JProgressBar(JProgressBar.HORIZONTAL,0,100);
JSlider sd=new JSlider(JSlider.HORIZONTAL,0,100,60);
public void start()
{
Container cp=getContentPane();
cp.setLayout(new FlowLayout());
cp.add(sd);
sd.setPaintTicks(true);
sd.setMajorTickSpacing(20);
sd.setMinorTickSpacing(5);
sd.setPaintLabels(true);
cp.add(pbar);
pbar.setModel(sd.getModel());
pbar.setStringPainted(true);
pbar.setString("Copy Files");
}
}
保存为SliderPorgressBar.java
编写HTML语言!
如下!
运行通过!高兴中啊!呵呵 !