复制代码
- //:Progress.java
- //Usingprogressbarsandsliders
- packagec13.swing;
- importjava.awt.*;
- importjava.awt.event.*;
- importjavax.swing.*;
- importjavax.swing.event.*;
- importjavax.swing.border.*;
- publicclassProgressextendsJPanel{
- JProgressBarpb=newJProgressBar();
- JSlidersb=
- newJSlider(JSlider.HORIZONTAL,0,100,60);
- publicProgress(){
- setLayout(newGridLayout(2,1));
- add(pb);
- sb.setValue(0);
- sb.setPaintTicks(true);
- sb.setMajorTickSpacing(20);
- sb.setMinorTickSpacing(5);
- sb.setBorder(newTitledBorder("SlideMe"));
- pb.setModel(sb.getModel());//Sharemodel
- add(sb);
- }
- publicstaticvoidmain(Stringargs[]){
- Show.inFrame(newProgress(),200,150);
- }
- }///:~
欢迎光临 仓酷云 (http://ckuyun.com/) | Powered by Discuz! X3.2 |