| Author |
JTextPane inside JScrollPane
|
Alexander D�ubler
Greenhorn
Joined: Feb 15, 2006
Posts: 11
|
|
Hi everyone, I try to use a JTextPane within a JScrollPane - if I use the followinh code snippet, everything works fine: However, the width of the JTextPane must be alterable (if I use the code snippet from above the JTextPane takes the full width of the application window). I tried to add the JTextPane to a JPanel instance and assign this JPanel to the JScrollBar - however, in this case the JPanel is much too wide as its bounds are out of the JScrollBar's bounds on the right side. Does anyone have a solution for my problem??
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15230
|
|
I'm lost. You are asking about putting a JTextPane in a JScrollPane, and you reference code that does not do this. Now, thinking about this, if you place a component on a JPanel and it is the only component and you give the JPanel a GridBagLayout but you don't set any constraints on the component, then I'd imagine it would just fill up the JPanel.
|
 |
 |
|
|
subject: JTextPane inside JScrollPane
|
|
|