I got a basic telnet socket connection working in an applet. YOu can log onto a server and type and read text. My issue is to show the servers chat i'm using a JTextArea. now this may be the best to use i dont know, maybe i just need to learn to manipulate it better.

Two issues with the JTextArea. one it doesnt auto scroll to the bottom when you add text. I got a routine to scroll it to the bottom but it may be tricky to let them scroll up. the second issue is when i select some text, it wont let me do right click, copy. Is this a jtextarea issue? Is it an applet issue? I had heard applets can copy within the application. there is no right click context menu on the jtextarea. I have set up a basic self signed certficiate which is why i'm able to use internet in the applet.


i got the scrolling figured out. i got a scroll lock button to click to enable you to scroll up , if you click it again it will once again begin auto scrolling ot hte bottom on new text.

but i'm finding controling the size of a jtextarea tricky. i think from component that it inherits from you can use setsize, but i find it doesnt work. the only way to control the size is by setting the collumns and setting the rows. now i want it to grow as they drag the dialoge that its on and make it bigger. particularly once i allow them to start changing the font, it seems tedious to try to work out on the font size how many rows and collums to set it to , to fill a certain x and y dimension size to match the dialouge sized area its on. also i am watching for the resize event on the dialoge but if they drag it down it doesnt update the rows right away. if you then also drag it a little to the right or left ( in addtion and afer the down resiging) it updated the rows. it's like one step out of synch.

any help appreciated.


I'm going to mark this solved. I found the answer to my intial question, i'm now using a JTextPane, it lets me do more like colorize. I will place a new post if any other questions like how to get a right click context menu, if i need any help, will google first.


This question has already been answered. Start a new discussion instead.