Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Force Scrool on JTextPane?

 
Jimmy Nilsson
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey

I have a JTextPane that i have added som text in, this text is to the left, by this i dont get the horizontal scrollbara available.

I am drawing some drwaings in this JTextPane and need to be abled to scrool horizontal to see all the drawings.

How do i do this? i know that JPane have a prefersize witch works fine, but JTextPane does not respond on this method?

How do i solve this?

//SnowJim
 
Joe Ess
Bartender
Posts: 9320
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JTextPane does not have scrollbars. You have to use a JScrollPane.
 
Jimmy Nilsson
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes i use JScrollbars, exacly as i do to the JPane, but in the jpane i can set the preferedsize and the horizontal jscoolbar will be activated, this does not wokr in JTextPane.

I have tryed before to set values to the JScroolbar but this wount work, maby you could show me?

As i said, i can get the vertical scroolbars active by adding text but to activet the hrozontal whene there is no text simes hard?

//SnowJim
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic