This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes   how to append a part of text of one JTextPane to another JTextPane.  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "  how to append a part of text of one JTextPane to another JTextPane.  " Watch "  how to append a part of text of one JTextPane to another JTextPane.  " New topic
Author

how to append a part of text of one JTextPane to another JTextPane.

mihir maniar
Ranch Hand

Joined: Sep 09, 2003
Posts: 88
> In a chatserver scenario whatever i type in my
> JTextPane must be appened to JTextPane of each and
> every window of each and every client that has logged
> on. my text is multi coloured,multi font,multi size .
> how do i go about acheiving this.

In a chatserver scenario means in a client server architecture.
Stuart Gray
Ranch Hand

Joined: Apr 21, 2005
Posts: 410
Well you will need to figure a wait of sending that information to other machines. You could send a String object, but that would not encapsulate the formatting information. Maybe you could send a HTML string. Take a looked at the StyledDocument interface.

To send the data to other machines you could take a look at RMI or the Socket and ServerSocket classes.
mihir maniar
Ranch Hand

Joined: Sep 09, 2003
Posts: 88
is there a way to take a html format of the text in the JTextPane and then ne method to append that part to the text that is already there in the other JTextPane.
 
Have you checked out Aspose?
 
subject: how to append a part of text of one JTextPane to another JTextPane.
 
It's not a secret anymore!