load_o_crap
asked on
Scroll to most recent item in List box
public class udpClient extends Applet {
Label lblCommon = new Label("Text Here");
Panel pTop = new Panel();
Button bEnter = new Button("Enter");
TextField txtChat = new TextField(20);
List lst = new List(4, false);
public void init() {
class BL implements ActionListener {
public void actionPerformed(ActionEven t e){
lst.add(txtChat.getText()) ;
lst.add(Integer.toString(l st.getItem Count()));
lst.select(lst.getItemCoun t());
lst.makeVisible(lst.getIte mCount());
}
}
BL a = new BL();
bEnter.addActionListener(a );
resize(320,400);
setLayout(new BorderLayout());
add(pTop,BorderLayout.NORT H) ;
pTop.add(lblCommon);
pTop.add(txtChat);
pTop.add(bEnter);
add(lst, BorderLayout.CENTER);
}
}
how do i make the list box scroll to the most recent added item
thanks.. the code above didnt release any errors.. but items were added.. just that the select and makeVisible method doesnt seem to work
thanks
Label lblCommon = new Label("Text Here");
Panel pTop = new Panel();
Button bEnter = new Button("Enter");
TextField txtChat = new TextField(20);
List lst = new List(4, false);
public void init() {
class BL implements ActionListener {
public void actionPerformed(ActionEven
lst.add(txtChat.getText())
lst.add(Integer.toString(l
lst.select(lst.getItemCoun
lst.makeVisible(lst.getIte
}
}
BL a = new BL();
bEnter.addActionListener(a
resize(320,400);
setLayout(new BorderLayout());
add(pTop,BorderLayout.NORT
pTop.add(lblCommon);
pTop.add(txtChat);
pTop.add(bEnter);
add(lst, BorderLayout.CENTER);
}
}
how do i make the list box scroll to the most recent added item
thanks.. the code above didnt release any errors.. but items were added.. just that the select and makeVisible method doesnt seem to work
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.