• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 169
  • Last Modified:

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(ActionEvent e){
            BL a = new BL();
          setLayout(new BorderLayout());
          add(pTop,BorderLayout.NORTH) ;
          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

1 Solution
what about "lst.getItemCount()-1" instead of "lst.getItemCount()" ?
(last index = count - 1 )


Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now