hei,
I have a little problem with scrolling...i am trying to develop a chat applet...when i receive a new message...i append it to the bottom of already existing messages( just like msn or other chat clients)...
But when i append new message...scroll pane should be at the bottom...but it remains at the top...so i have to scroll down to see the new message...
I want it to work same as in TextArea for example... please help...my brain is going to explode soon..part of my source code is given below:
//****************************************
Panel upperPanel = new Panel();
upperPanel.setLayout(
new FlowLayout(FlowLayout.LEFT));
JEditorPane jt = new JEditorPane();
jt.setEditable(false);
jt.setContentType("text/html");
jt.setText("<H2> Welcome </H2>");
JScrollPane editorScrollPane = new JScrollPane(jt);
editorScrollPane.setVerticalScrollBarPolicy(
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
editorScrollPane.setPreferredSize(
new Dimension(250, 300));
upperPanel.add(editorScrollPane);
//*****************************************![]()
![]()
![]()
![]()
![]()


Reply With Quote


Bookmarks