File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes detect a line in a jtextarea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "detect a line in a jtextarea" Watch "detect a line in a jtextarea" New topic

detect a line in a jtextarea

Gizzmo Zeuzere
Ranch Hand

Joined: May 11, 2001
Posts: 45
when i find a "{" i want to know the line where it appears. But i don't know how to do. Help please !!!
Angela Lamb
Ranch Hand

Joined: Feb 22, 2001
Posts: 156
Use the getLineOfOffset(int´┐Żoffset) function. The offset parameter will be the position of the '{' within your text.
I agree. Here's the link:
subject: detect a line in a jtextarea