Results 1 to 5 of 5
- 02-09-2012, 08:46 PM #1
Member
- Join Date
- Mar 2010
- Posts
- 28
- Rep Power
- 0
First and Last row number from viewable portion of jtextarea
HI,
I am trying to get the row numbers of first and last from viewable portion of jtextarea. The starting row is working correctly, but i am not getting the last row number.
[Java] //editor is jtextarea Rectangle r = editor.getVisibleRect(); Point top = new - Pastebin.com
- 02-09-2012, 08:57 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,392
- Blog Entries
- 7
- Rep Power
- 17
Re: First and Last row number from viewable portion of jtextarea
The JTextArea inherits the viewToModel method; you can take it from there ...
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 02-09-2012, 09:26 PM #3
Re: First and Last row number from viewable portion of jtextarea
Please use correct case/capitalization when referring to JDK classes so that we know whether you are indeed referring to JTextArea or some badly named class of your own named jtextarea.
Also, to get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem. Most members here won't click a link, and for some of those who might, many free hosting sites are blocked by a corporate firewall.
Moving to AWT/Swing
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 02-09-2012, 11:40 PM #4
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,143
- Rep Power
- 5
Re: First and Last row number from viewable portion of jtextarea
- 02-10-2012, 12:28 AM #5
Re: First and Last row number from viewable portion of jtextarea
Thanks for the heads up. No use wasting time here, then.
db
edit Another cross post
First and Last Row numbers from viewable portion of jtextarea? (Java in General forum at JavaRanch)Last edited by DarrylBurke; 02-10-2012 at 12:34 AM.
Why do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
Making a portion of JTextArea uneditable
By nik_meback in forum AWT / SwingReplies: 1Last Post: 12-15-2010, 01:38 PM -
Limit number of cols in JTextArea (again)
By berkeleybross in forum AWT / SwingReplies: 6Last Post: 07-22-2010, 09:55 PM -
Downloaded images aren't viewable
By pietertje in forum New To JavaReplies: 12Last Post: 07-05-2010, 02:56 PM -
Limit number of cols in JTextArea
By berkeleybross in forum AWT / SwingReplies: 6Last Post: 06-27-2010, 03:20 PM -
Get Imageable/Viewable Area of HTML Document
By oblivionph in forum XMLReplies: 0Last Post: 05-07-2010, 07:27 AM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks