View Single Post
Old 08-10-2002, 08:17 PM   #3 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
heh, i also hate the gui area of java, anyhow here is some code:

Code:
private JTextArea output; //the text area in question

output = new JTextArea(); //constructing it in another method somewhere
p.add(new JScrollPane(output), GDC); //adding it to my JPanel with GridBagConstraints

// in an inner class...
inData = in.readLine().trim().toLowerCase();
print(output, inData); //a print method i have

private void print(JTextArea jt, String s) //the print method
{
        jt.setText(jt.getText()+s+"\n");
}
that is pretty much all the neccessary code, im not sure if it makes any sense


but basically the inner class area is always calling the "print" method while data is coming in from the socket (in).. it may be better to use jt.append in the print method so i will try that now but i don't think that'll fix the prob

thanks for ur help

--- EDIT ---
.append() did nothing
__________________
-- bloomberg.
abc123 is offline   Reply With Quote