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.
Hi, is there a simple way to write a WYSIWYG (What u see is what u get editor) using java swings .... i tried wit JTextPane ..editor pane ..but no luck does any one have the code for it ... or a logic as to how to embed styles so that the text gets formatted as we type .. thanks a lot
Yes, can be done. You need to use JTextPane and then most probably create your own DefaultStyledDocument object that the Pane uses. The trick is to subclass these classes and provide your own custom behaviour and styles where necessary.
Its a bit of a hard slog to get up to speed on it all, but you have to know all about the insertString and remove methods in the Document object to be able to do anything useful.
I suggest that you set aside a couple of hours and go through Suns Text componant tutorial and run the webstart apps to get a feel for what is possible. Use this link: