Monday, December 10, 2001 08:24 PM
I'll bet you don't really
want to add a button or a label into a JTextPane. What you probably want to do is add those components so that they are near
the JTextPane, but not in
If you really want to, you can add anycomponent to a JTextPane, from ImageIcons to fully interactive components like a JFileChooser, JColorChooser, or your own component. They will appear in-line with the text, and scroll around just like strings.
Cool, but probably not what you're looking for.
If you just want to have a button or other component placed neatly near your text, then you should investigate use of the various LayoutManagers. I would suggest a quick spin through Sun's excellent Swing tutorial for that.