• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Force Scrool on JTextPane?

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic