Wednesday, February 17, 2016

Program to add Scrolling List in a Frame.

import java.awt.*;
class ListAdd extends Frame
{
public static void main(String args[ ] )
{
List lt= new List( 5 , true);
lt.add ( "Window 98" );
lt.add ( "Window 2000" );
lt.add ( "Window XP" );
lt.add ( "Window NT" );
ListAdd f1=new ListAdd();
f1.setTitle("Adding a List in a Frame!!!");
f1.setLayout(new FlowLayout());
f1.add(lt);
f1.setSize(500,300);
f1.setVisible(true);
}
}
Output:

No comments:

Post a Comment