Results 1 to 4 of 4
Thread: Get Row/Column In JEditorPane
- 11-08-2010, 12:22 AM #1
Member
- Join Date
- Mar 2010
- Location
- Hilton Head, SC
- Posts
- 34
- Rep Power
- 0
Get Row/Column In JEditorPane
Is it possible to get the row and column when you click on a spot in the JEditorPane. My current thought is to get the position of the click event and do a few calculations based on the row height and column width but I wanted to know if there is an existing way that is less likely to incur errors.
- 11-08-2010, 12:42 AM #2
Senior Member
- Join Date
- May 2010
- Posts
- 436
- Rep Power
- 4
JEditorPane extends JTextComponent which has a nifty method viewToModel(Point pt). You should check out the API for more on this method and give it a try. Please let us know if it doesn't work.
- 11-08-2010, 12:53 AM #3
Member
- Join Date
- Mar 2010
- Location
- Hilton Head, SC
- Posts
- 34
- Rep Power
- 0
Works like a charm. I never realized this was the function I was looking for when I was browsing the API. Thanks for the help.
You'd figure this would be a 'get*' method.
- 11-08-2010, 01:10 AM #4
Senior Member
- Join Date
- May 2010
- Posts
- 436
- Rep Power
- 4
Similar Threads
-
insert row and column and delete row and column
By daredavil82 in forum New To JavaReplies: 13Last Post: 09-22-2011, 06:10 PM -
JEditorPane + MouseWheel
By Moncleared in forum New To JavaReplies: 2Last Post: 10-09-2010, 01:27 AM -
selecting column names dynamically from table column header
By neha_sinha in forum AWT / SwingReplies: 1Last Post: 07-06-2010, 04:50 PM -
JEditorPane Example
By Java Tip in forum javax.swingReplies: 0Last Post: 06-27-2008, 07:47 PM -
JEditorPane
By drmmr11 in forum Java AppletsReplies: 0Last Post: 08-02-2007, 06:08 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks