I am trying to implement a text component that can hold other components. To be concrete, lets say I want to have a text field that can have parts of text being clickable while the document still remaining editable as normal.
Now, when I click that part of text that is clickable, I should be able to handle the events like a JButton. What I already tried? I tried using JEditorPane with HTMLEditorKit to include a button using this html code for the text of the pane: <object classid='javax.swing.JButton' label='Click Me!' ></object> However, the button rendered does not blend very well with the look and feel of the document itself. Additionally, when the pane is editable it gets really hard to edit text around the button. As far as my understanding, there does not exist, anything like the one that I am looking for. So, I am willing to implement such a component. Hence, I would like you, if possible to advice me on how implement a component that fits well with the Swing architecture and any caveats that I might need to address while implementing this. (Basically, I am up for all sorts of suggestions!)
