• 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 Scroller 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 loads a DefaultStyledDocument.

Every row in this Styeld Document is ending with a "\n". To the right of this text i am drawing(overrides the paint method).

I have set a scroll that is visible bouth as vertical and horizontal. Now it is only using the vertical scroller to be abled to scrool down and see the text. But i realy need it to be abled to scrool vertical to see the drawings.

Is there any way? maby i can set the size on the Styleddocument? i cant set the size on the JTextPane i think?

//Jimmy
 
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
Hey again!

by overridering this in JTextPane

public void setBounds(int x, int y,int width, int height)
{

Dimension size = this.getPreferredSize();
super.setBounds(x
,y
,1000+Math.max(size.width, width)
,height
);

}

i get the horixontal scroller like i whant, but if i try to scroll it just jumps back on place 0 again?

ples help

//JImmy
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic