You know what I love about programming? The part where I get to solve interesting problems. You know what isn’t interesting? solving the same problem over and over again. Even less interesting is having to solve a problem that I know someone else has solved but where I can’t copy the answer. That’s not only uninteresting, it’s frustrating.
So, I’m writing a tool in Java and I need for it to allow the user to input styled text (simple typeface stuff – italics, bold, strikethrough). We’re not changing font family and we’re not laying it out for print; we just need to be able to capture this style stuff. And then persist it. Ultimately, it’s going to be stored as XHTML. So I look around, and sure enough, JTextPane turns out to be the thing I need to be able to display the text. Pretty soon we’ll want to have inline images that the text can flow around, and that component can handle those things. So, that’s great.