Pages

Subscribe:

Blogger templates

Sample Text

Total Pageviews

Followers

About Us

My Photo
MY Name is Vicky. I am student in Univercity.Programming and webdesigning but i don't like Maths.Someone should kill the teacher .Besides i like writing stories ,and sciencefiction scripts .Soon i will have my book and a movie !!Like so much cooking & travelling all over the world an learn about other cultures! An artistic kid and art is my breath !

Thursday, July 16, 2009

SCROLLBAR

import java.applet.*;
import java.awt.*;
import java.awt.event.*;

public class showScrollbar extends Applet implements
AdjustmentListener {

private Scrollbar scrb;
int i;
TextField tf;
String s;

public void init (){

scrb=new Scrollbar(Scrollbar.HORIZONTAL,20,10,0,255);
add(scrb);
scrb.addAdjustmentListener(this);
tf=new TextField(15);
add(tf);
}

public void adjustmentValueChanged(AdjustmentEvent e){
i=e.getValue();
s=String.valueOf(i);
tf.setText(s);
repaint();
}

}

0 comments:

Post a Comment