diff options
author | Florian Pritz <bluewind@xinu.at> | 2013-07-15 14:06:57 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2013-07-15 14:06:57 +0200 |
commit | f00fd63cd8a4252d85f04359956d5f79036f0eb2 (patch) | |
tree | 7561272fd22e7d1cc844c4f636bd68c5d2527083 /src/com/joshwalters/bookcatalog/BookCatalog.java | |
parent | 8b12426328b9200acca352dba11263d0f51a3ba7 (diff) | |
download | BookCatalog-f00fd63cd8a4252d85f04359956d5f79036f0eb2.tar.gz BookCatalog-f00fd63cd8a4252d85f04359956d5f79036f0eb2.tar.xz |
Add field for defaul note when adding new booksworking
This allows the user to use the note feature to track in which shelf a
book is located without having to manually add the information to each
newly added book.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'src/com/joshwalters/bookcatalog/BookCatalog.java')
-rw-r--r-- | src/com/joshwalters/bookcatalog/BookCatalog.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/com/joshwalters/bookcatalog/BookCatalog.java b/src/com/joshwalters/bookcatalog/BookCatalog.java index 17aed55..8a1bf77 100644 --- a/src/com/joshwalters/bookcatalog/BookCatalog.java +++ b/src/com/joshwalters/bookcatalog/BookCatalog.java @@ -73,6 +73,10 @@ public class BookCatalog { */ private JTextField addBookField; /** + * Allows user to add book including a comment to catalog. + */ + private JTextField addBookNotesField; + /** * Displays the book catalog. */ // private JTable bookCatalogTable; @@ -183,6 +187,20 @@ public class BookCatalog { gridConstraints.fill = GridBagConstraints.REMAINDER; gridConstraints.anchor = GridBagConstraints.WEST; frame.add(addBookField, gridConstraints); + // The add book notes label + JLabel addBookNotesLabel = new JLabel("New Book Notes"); + gridConstraints.gridx = 5; + gridConstraints.gridy = 0; + frame.add(addBookNotesLabel, gridConstraints); + // The add book notes field + addBookNotesField = new JTextField(FIELD_WIDTH); + gridConstraints.gridx = 6; + gridConstraints.gridy = 0; + gridConstraints.insets.top = 10; + gridConstraints.insets.left = 10; + gridConstraints.fill = GridBagConstraints.REMAINDER; + gridConstraints.anchor = GridBagConstraints.WEST; + frame.add(addBookNotesField, gridConstraints); // Change the grid constraints back to their the normal state. gridConstraints.fill = GridBagConstraints.NONE; gridConstraints.anchor = GridBagConstraints.CENTER; @@ -322,7 +340,7 @@ public class BookCatalog { frame.add(deleteBookButton, gridConstraints); // Listens for add book input. addBookField.addActionListener(new AddBook(bookDatabase, bookLookup, - bookCatalogTable)); + bookCatalogTable, addBookNotesField)); // Listens for delete book button press. deleteBookButton.addActionListener(new DeleteBook(bookDatabase, titleField, authorField, dateField, descriptionArea, ISBNField, |