java - How to set and lock the JScrollpane to the bottom? -
how can set jscrollpane bottom of jtextarea? tried defaultcaret caret = (defaultcaret)getcaret(); caret.setupdatepolicy(defaultcaret.always_update);
didnt work didnt automatically go down.
here current code
public class subtextareamessages extends jtextarea implements actionlistener{ private arraylist al; public subtextareamessages() { seteditable(false); listthemessages(); timer t = new timer(500,this); t.start(); } public void listthemessages() { connectmysql.getusernamestest(this); } @override public void actionperformed(actionevent e) { try { system.out.print(gettext(185,186)); } catch (badlocationexception e1) { // todo auto-generated catch block e1.printstacktrace(); } } } jsptextfield = new jscrollpane(new subtextareamessages()); mainpanel2.add(jsptextfield ,borderlayout.center);
depending on exact requirement, 1 of following should help
Comments
Post a Comment