import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.border.*;
/**
*
* @author Hui Jian
*/
public class BookFrame extends JFrame implements ActionListener{
private JLabel titlelbl,authorlbl,pricelbl,booknamelbl;
private JButton bookBtn1,bookBtn2,bookBtn3,bookBtn4,bookBtn5,bookBtn6,bookBtn7,bookBtn8,bookBtn9;
private ImageIcon book1,book2,book3,book4,book5,book6,book7,book8,book9;
private JButton prevBtn,nextBtn,exitBtn,searchBtn;
private JTextField titleTxt,authorTxt,priceTxt,searchTxt;
private JPanel northPanel,centerPanel,southPanel;
private JRadioButton programmingBtn,politicsBtn,scifiBtn;
private int count = 0;
public BookFrame(){
titlelbl = new JLabel ("The Bookstore");
authorlbl = new JLabel ("Author:");
pricelbl = new JLabel ("Price:");
booknamelbl = new JLabel ("Title:");
searchBtn = new JButton ("Search");
prevBtn = new JButton ("Previous");
nextBtn = new JButton ("Next");
exitBtn = new JButton ("Exit");
titleTxt = new JTextField(7);
authorTxt = new JTextField(7);
priceTxt = new JTextField(7);
searchTxt = new JTextField(7);
programmingBtn = new JRadioButton ("Programming");
politicsBtn = new JRadioButton ("Politics");
scifiBtn = new JRadioButton ("Science Fiction");
northPanel = new JPanel ();
centerPanel = new JPanel ();
southPanel = new JPanel ();
bookBtn1 = new JButton();
book1 = new ImageIcon("book1.jpg");
bookBtn1.setIcon(book1);
bookBtn2 = new JButton();
book2 = new ImageIcon("book2.jpg");
bookBtn2.setIcon(book2);
bookBtn3 = new JButton();
book3 = new ImageIcon("book3.jpg");
bookBtn3.setIcon(book3);
bookBtn4 = new JButton();
book4 = new ImageIcon("book4.jpg");
bookBtn4.setIcon(book4);
bookBtn5 = new JButton();
book5 = new ImageIcon("book5.jpg");
bookBtn5.setIcon(book5);
bookBtn6 = new JButton();
book6 = new ImageIcon("book6.jpg");
bookBtn6.setIcon(book6);
bookBtn7 = new JButton();
book7 = new ImageIcon("book7.jpg");
bookBtn7.setIcon(book7);
bookBtn8 = new JButton();
book8 = new ImageIcon("book8.jpg");
bookBtn8.setIcon(book8);
bookBtn9 = new JButton();
book9 = new ImageIcon("book9.jpg");
bookBtn9.setIcon(book9);
centerPanel.add(bookBtn1);
centerPanel.add(bookBtn2);
centerPanel.add(bookBtn3);
centerPanel.add(bookBtn4);
centerPanel.add(bookBtn5);
centerPanel.add(bookBtn6);
centerPanel.add(bookBtn7);
centerPanel.add(bookBtn8);
centerPanel.add(bookBtn9);
centerPanel.setLayout(new GridLayout(3,3));
northPanel.add(titlelbl);
northPanel.add(programmingBtn);
northPanel.add(politicsBtn);
northPanel.add(scifiBtn);
southPanel.add(booknamelbl);
southPanel.add(titleTxt);
southPanel.add(authorlbl);
southPanel.add(authorTxt);
southPanel.add(pricelbl);
southPanel.add(priceTxt);
southPanel.add(searchBtn);
southPanel.add(searchTxt);
southPanel.add(prevBtn);
southPanel.add(nextBtn);
southPanel.add(exitBtn);
southPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
add(southPanel,BorderLayout.SOUTH);
add(northPanel,BorderLayout.NORTH);
add(centerPanel,BorderLayout.CENTER);