JTGT is a Java library for loading, manipulating, and writing Praat TextGrid files, and similar annotation files, such as XWaves lab. It's inspired by the TextGridTools module for Python.
Snapshot builds are OSSRH. Release versions are hosted on OSSRH and indexed in Maven Central.
String tgStr = new File("path/to/my.TextGrid").getText();
TextGrid tg = new TextGridSerializer().fromString(tgStr);
for (Annotation annot : tg.getTiers().get(0).getAnnotations()) {
System.out.println(annot.getText());
}