How to determine number of visible lines

From: stevewi (stevewi_at_nortelnetworks.com)
Date: 08/26/04


Date: 26 Aug 2004 14:53:53 -0700

How do you find out the number of lines that are visible in
JEditorPane?

I'm displaying nothing but text and using a single font in the
display. I'm using a JScrollPane to handle the scrolling.

I've tried getting the viewport.getVisibleRect() and dividing it by
the font height, but it doesn't match the actual number of lines being
displayed.

Thanks!



Relevant Pages

  • Re: How to determine number of visible lines
    ... >>I'm displaying nothing but text and using a single font in the ... > You want to count the lines of content in the display area or the ... Example, displaying 50 lines, calculation ...
    (comp.lang.java.gui)
  • Grid scroll freeze up
    ... I am working on an application that uses a grid and a timer which moves through the records to be displayed then starts again at the first record - a kind of automatic scroll. ... If I press a key or move the mouse at all it starts scrolling again. ... Which is a pain as this needs to operate without user input for long periods displaying timing results from a motorsports event. ...
    (microsoft.public.fox.helpwanted)
  • Re: Change Subform Datasheet Size
    ... > Is there a way to change the size of a subform that is displaying as a ... I thought if I could change the size from say 12 pitch to 10 pitch ... > could get everything to fit without scrolling. ...
    (microsoft.public.access.formscoding)
  • Change Subform Datasheet Size
    ... Is there a way to change the size of a subform that is displaying as a ... I thought if I could change the size from say 12 pitch to 10 pitch I ... could get everything to fit without scrolling. ...
    (microsoft.public.access.formscoding)
  • Re: Password managers
    ... scrolling down past old stuff. ... and you are displaying bad etiquette by refusing to comply. ...
    (comp.sys.mac.apps)