See http://wiki.netbeans.org/DevFaqOpenFileAtLine
LineCookie
- see https://forums.netbeans.org/topic59253.html
or
NbDocument#openDocument()
- see http://bits.netbeans.org/dev/javadoc/org-openide-text/org/openide/text/NbDocument.html#openDocument(org.openide.util.Lookup.Provider, int, int, org.openide.text.Line.ShowOpenType, org.openide.text.Line.ShowVisibilityType)
Example using LineCookie
FileObject fo = null;
LineCookie lc = DataObject.find(fo).getLookup().lookup(LineCookie.class);
int lineNumber=42;
int colNumber=43;
Line line = lc.getLineSet().getOriginal(lineNumber);
line.show(Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FRONT, colNumber);
More examples at