Fix new chapter adding at top of tree

This commit is contained in:
2020-02-02 19:07:23 +00:00
parent 423d840d83
commit f95ae10d03
@@ -2155,9 +2155,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
public void addChapter() {
Debug.trace();
Chapter c = book.addChapter();
Chapter lc = book.getLastChapter();
int i = bookTreeModel.getIndexOfChild(book, lc);
bookTreeModel.insertNodeInto(c, book, i+1);
bookTreeModel.insertNodeInto(c, book, book.getChildCount());
bookTree.scrollPathToVisible(new TreePath(c.getPath()));
}