Fix new chapter adding at top of tree
This commit is contained in:
@@ -2155,9 +2155,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
public void addChapter() {
|
public void addChapter() {
|
||||||
Debug.trace();
|
Debug.trace();
|
||||||
Chapter c = book.addChapter();
|
Chapter c = book.addChapter();
|
||||||
Chapter lc = book.getLastChapter();
|
bookTreeModel.insertNodeInto(c, book, book.getChildCount());
|
||||||
int i = bookTreeModel.getIndexOfChild(book, lc);
|
|
||||||
bookTreeModel.insertNodeInto(c, book, i+1);
|
|
||||||
bookTree.scrollPathToVisible(new TreePath(c.getPath()));
|
bookTree.scrollPathToVisible(new TreePath(c.getPath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user