<分区>
Exception in thread "main" java.lang.NullPointerException at gui.CataloguePanel.(CataloguePanel.java)
我正在尝试在 CataloguePanel
中初始化一个 BookQuery
对象并调用 getBookList()
目录面板.java
package gui;
import java.util.ArrayList;
import backend.Book;
import backend.BookQuery;
// Catalog panel. Shows the library titles' information and allows users to place their orders.
public class CataloguePanel extends JPanel implements GBPanel {
BookQuery bQuery;
ArrayList<Book> bookList = bQuery.getBookList(); // Here's where the error occurred
}
编辑: http://www.reactionface.info/sites/default/files/imagecache/Node_Page/images/1314029819767.png