ava AWT Scrollbar The object of Scrollbar class is used to add horizontal and vertical scrollbar. Scrollbar is a GUI component allows us to see invisible number of rows and columns. AWT Scrollbar class declaration public class Scrollbar extends Component implements Adjustable, Accessible Java AWT Scrollbar Example import java.awt.*; class ScrollbarExample{ ScrollbarExample(){ Frame f= new Frame( "Scrollbar Example" ); Scrollbar s= new Scrollbar(); s.setBounds( 100 , 100 , 50 , 100 ); f.add(s); f.setSize( 400 , 400 ); f.setLayout( null ); f.setVisible( true ); } public static void main(String args[]){ new ScrollbarExample(); } } Output: Java AWT Scrollbar Example with AdjustmentListener import java.awt.*; import java.awt.event.*; class ScrollbarExample{ ScrollbarExample(){ Frame f= new Frame( "Scro
Comments
Post a Comment