Keeping the format on text retrieval
I am making a network application that has a chat function. On the chat I have one JTextPane for displaying messages and one more for input. Then I have some buttons that allow to add style on the input text(bold,italic,font size,colour). The text is formatted correctly on input pane , although when moved to the display pane(once the correct JButton is pressed) it only has the format of last character. How can I move the text while keeping its original format?For example if I write "Hello Worl d " on the input , display shows "Hello Worl d" textPane is the input pane Where set : final