/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Jaymark
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.Color;
public class Book
{
String title;
boolean borrowed;
public Book(String bookTitle)
{
title = bookTitle;
borrowed = false ;
}
public void borrowed()
{
borrowed = true;
}
public void returned()
{
borrowed = false;
}
public boolean isBorrowed()
{
return ((borrowed) ? true : false);
}
public String getTitle()
{
return title;
}
}
class Library
{
JFrame myFrame = new JFrame("Library");
JLabel jLabel1 = new JLabel("***JhayJheDiegz Books***");
JLabel jLabel2 = new JLabel("2nd Floor S-205, Science Centrum Building,");
JLabel jLabel3 = new JLabel("Colegio de Dagupan, Arellano St. Dagupan City");
JButton jButton1 = new JButton("Search");
JButton jButton2 = new JButton("Rent");
JButton jButton3 = new JButton("Return");
JButton jButton4 = new JButton("About");
FlowLayout layout = new FlowLayout(FlowLayout.CENTER);
Font font = new Font("Serif", Font.BOLD, 20);
private int pressed;
Book book1 = new Book("Hunger Games");
Book book2 = new Book("Catching Fire");
Book book3 = new Book("Mocking Jay");
Book book4 = new Book("The Da Vinci Code");
Book book5 = new Book("Harry Potter and The Sorcerer's Stone");
Book book6 = new Book("Harry Potter and The Chamber of Secrets");
Book book7 = new Book("Harry Potter and The Prisoner of Azkaban");
Book book8 = new Book("Harry Potter and The Goblet of Fire");
Book book9 = new Book("Harry Potter and The Order of The Phoenix");
Book book10 = new Book("Harry Potter and The Half-blood Prince");
Book book11 = new Book("Harry Potter and The Deathly Hallows");
String[] bookName = {"Hunger Games", "Catching Fire", "Mocking Jay", "The Da Vinci Code", "Harry Potter and The Sorcerer's Stone",
"Harry Potter and The Chamber of Secrets", "Harry Potter and The Prisoner of Azkaban", "Harry Potter and The Goblet of Fire",
"Harry Potter and The Order of The Phoenix", "Harry Potter and The Half-blood Prince", "Harry Potter and The Deathly Hallows"};
String[] bookAuthor = {"Suzanne Collins", "Suzanne Collins", "Suzanne Collins", "Dan Brown", "J.K. Rowling", "J.K. Rowling",
"J.K. Rowling", "J.K. Rowling", "J.K. Rowling", "J.K. Rowling", "J.K. Rowling"};
String[] bookPublisher = {"Scholastic Press", "Scholastic Press", "Scholastic Press", "Doubleday Group", "Arthur A. Levine Books",
"Arthur A. Levine Books", "Arthur A. Levine Books", "Arthur A. Levine Books", "Arthur A. Levine Books", "Arthur A. Levine Books",
"Arthur A. Levine Books" };
int[] bookID = {1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011};
public Library()
{
myFrame.setBounds(485,425, 305,200);
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
myFrame.setVisible(true);
myFrame.setLayout(layout);
JPanel jPanel = new JPanel();
jButton1.addActionListener(new searchButton());
jButton2.addActionListener(new rentButton());
jButton3.addActionListener(new returnButton());
jButton4.addActionListener(new aboutButton());
jButton1.setToolTipText("Search Book");
jButton2.setToolTipText("Rent Book");
jButton3.setToolTipText("Return Book");
jButton4.setToolTipText("About Our Program");
myFrame.add(jLabel1);
myFrame.add(jLabel2);
myFrame.add(jLabel3);
myFrame.add(jButton1);
myFrame.add(jButton2);
myFrame.add(jButton3);
myFrame.add(jButton4);
jLabel1.setFont(font);
myFrame.getContentPane().setBackground(Color.LIGHT_GRAY);
}
public void searchBook()
{
String searchInput = JOptionPane.showInputDialog(null, "Enter Search Query: ", "Book Search", JOptionPane.INFORMATION_MESSAGE);
int x;
boolean found = false;
try
{
for(x=0 ; x<bookName.length ; x++)
{
if(searchInput.equalsIgnoreCase(bookName[x]))
{
JOptionPane.showMessageDialog(null, "Book Found !" + "\nTitle: " + bookName[x] + "\nAuthor: " + bookAuthor[x] +
"\nPublisher: " + bookPublisher[x] + "\nBook ISBN: " + bookID[x] , "Book Search", JOptionPane.INFORMATION_MESSAGE);
found = true;
}
}
if(!found)
{
JOptionPane.showMessageDialog(null, "BOOK NOT FOUND !" , "Book Search", JOptionPane.ERROR_MESSAGE);
}
}
catch(Exception e)
{
}
}
public void rentBook()
{
try
{
int rentEntry;
String a = JOptionPane.showInputDialog(null, "Enter Book ID: ", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
rentEntry = Integer.parseInt(a);
if(rentEntry == bookID[0] && book1.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Available!" + "\nTitle: " + bookName[0] + "\nAuthor: " + bookAuthor[0] +
"\nPublisher: " + bookPublisher[0] + "\nISBN: " + bookID[0] + "\nRent?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Rented ! Thank You ! ", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
book1.borrowed();
}
}
else if(rentEntry == bookID[0] && book1.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Unavailable !" + "\nTry Again?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
rentBook();
}
}
else if(rentEntry == bookID[1] && book2.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Available!" + "\nTitle: " + bookName[1] + "\nAuthor: " + bookAuthor[1] +
"\nPublisher: " + bookPublisher[1] + "\nISBN: " + bookID[1] + "\nRent?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Rented ! Thank You ! ", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
book2.borrowed();
}
}
else if(rentEntry == bookID[1] && book2.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Unavailable !" + "\nTry Again?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
rentBook();
}
}
else if(rentEntry == bookID[2] && book3.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Available!" + "\nTitle: " + bookName[2] + "\nAuthor: " + bookAuthor[2] +
"\nPublisher: " + bookPublisher[2] + "\nISBN: " + bookID[2] + "\nRent?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Rented ! Thank You ! ", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
book3.borrowed();
}
}
else if(rentEntry == bookID[2] && book3.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Unavailable !" + "\nTry Again?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
rentBook();
}
}
else if(rentEntry == bookID[3] && book4.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Available!" + "\nTitle: " + bookName[3] + "\nAuthor: " + bookAuthor[3] +
"\nPublisher: " + bookPublisher[3] + "\nISBN: " + bookID[3] + "\nRent?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Rented ! Thank You ! ", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
book4.borrowed();
}
}
else if(rentEntry == bookID[3] && book4.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Unavailable !" + "\nTry Again?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
rentBook();
}
}
else if(rentEntry == bookID[4] && book5.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Available!" + "\nTitle: " + bookName[4] + "\nAuthor: " + bookAuthor[4] +
"\nPublisher: " + bookPublisher[4] + "\nISBN: " + bookID[4] + "\nRent?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Rented ! Thank You ! ", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
book5.borrowed();
}
}
else if(rentEntry == bookID[4] && book5.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Unavailable !" + "\nTry Again?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
rentBook();
}
}
else if(rentEntry == bookID[5] && book6.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Available!" + "\nTitle: " + bookName[5] + "\nAuthor: " + bookAuthor[5] +
"\nPublisher: " + bookPublisher[5] + "\nISBN: " + bookID[5] + "\nRent?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Rented ! Thank You ! ", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
book6.borrowed();
}
}
else if(rentEntry == bookID[5] && book6.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Unavailable !" + "\nTry Again?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
rentBook();
}
}
else if(rentEntry == bookID[6] && book7.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Available!" + "\nTitle: " + bookName[6] + "\nAuthor: " + bookAuthor[6] +
"\nPublisher: " + bookPublisher[6] + "\nISBN: " + bookID[6] + "\nRent?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Rented ! Thank You ! ", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
book7.borrowed();
}
}
else if(rentEntry == bookID[6] && book7.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Unavailable !" + "\nTry Again?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
rentBook();
}
}
else if(rentEntry == bookID[7] && book8.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Available!" + "\nTitle: " + bookName[7] + "\nAuthor: " + bookAuthor[7] +
"\nPublisher: " + bookPublisher[7] + "\nISBN: " + bookID[7] + "\nRent?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Rented ! Thank You ! ", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
book8.borrowed();
}
}
else if(rentEntry == bookID[7] && book8.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Unavailable !" + "\nTry Again?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
rentBook();
}
}
else if(rentEntry == bookID[8] && book9.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Available!" + "\nTitle: " + bookName[8] + "\nAuthor: " + bookAuthor[8] +
"\nPublisher: " + bookPublisher[8] + "\nISBN: " + bookID[8] + "\nRent?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Rented ! Thank You ! ", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
book9.borrowed();
}
}
else if(rentEntry == bookID[8] && book9.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Unavailable !" + "\nTry Again?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
rentBook();
}
}
else if(rentEntry == bookID[9] && book10.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Available!" + "\nTitle: " + bookName[9] + "\nAuthor: " + bookAuthor[9] +
"\nPublisher: " + bookPublisher[9] + "\nISBN: " + bookID[9] + "\nRent?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Rented ! Thank You ! ", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
book10.borrowed();
}
}
else if(rentEntry == bookID[9] && book10.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Unavailable !" + "\nTry Again?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
rentBook();
}
}
else if(rentEntry == bookID[10] && book11.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Available!" + "\nTitle: " + bookName[10] + "\nAuthor: " + bookAuthor[10] +
"\nPublisher: " + bookPublisher[10] + "\nISBN: " + bookID[10] + "\nRent?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Rented ! Thank You ! ", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
book11.borrowed();
}
}
else if(rentEntry == bookID[10] && book11.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Book Unavailable !" + "\nTry Again?", "Rent Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
rentBook();
}
}
else
{
pressed = JOptionPane.showConfirmDialog(null, "BOOK NOT FOUND IN OUR CATALOGUE !" + "\nTry Again?");
if(pressed == JOptionPane.YES_OPTION)
{
rentBook();
}
}
}
catch(Exception e)
{
}
}
public void returnBook()
{
try
{
int returnEntry;
String a = JOptionPane.showInputDialog(null, "Enter Book ID: ", "Return Book", JOptionPane.INFORMATION_MESSAGE);
returnEntry = Integer.parseInt(a);
if(returnEntry == bookID[0] && book1.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Return Book?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Returned ! Thank You !");
book1.returned();
}
}
else if(returnEntry == bookID[0] && book1.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "You cannot Return a Book that is not Borrowed !" + "\nTry Again?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
returnBook();
}
}
else if(returnEntry == bookID[1] && book2.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Return Book?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Returned ! Thank You !");
book2.returned();
}
}
else if(returnEntry == bookID[1] && book2.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "You cannot Return a Book that is not Borrowed !" + "\nTry Again?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
returnBook();
}
}
else if(returnEntry == bookID[2] && book3.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Return Book?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Returned ! Thank You !");
book3.returned();
}
}
else if(returnEntry == bookID[2] && book3.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "You cannot Return a Book that is not Borrowed !" + "\nTry Again?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
returnBook();
}
}
else if(returnEntry == bookID[3] && book4.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Return Book?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Returned ! Thank You !");
book4.returned();
}
}
else if(returnEntry == bookID[3] && book4.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "You cannot Return a Book that is not Borrowed !" + "\nTry Again?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
returnBook();
}
}
else if(returnEntry == bookID[4] && book5.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Return Book?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Returned ! Thank You !");
book5.returned();
}
}
else if(returnEntry == bookID[4] && book5.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "You cannot Return a Book that is not Borrowed !" + "\nTry Again?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
returnBook();
}
}
else if(returnEntry == bookID[5] && book6.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Return Book?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Returned ! Thank You !");
book6.returned();
}
}
else if(returnEntry == bookID[5] && book6.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "You cannot Return a Book that is not Borrowed !" + "\nTry Again?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
returnBook();
}
}
else if(returnEntry == bookID[6] && book7.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Return Book?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Returned ! Thank You !");
book7.returned();
}
}
else if(returnEntry == bookID[6] && book7.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "You cannot Return a Book that is not Borrowed !" + "\nTry Again?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
returnBook();
}
}
else if(returnEntry == bookID[7] && book8.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Return Book?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Returned ! Thank You !");
book8.returned();
}
}
else if(returnEntry == bookID[7] && book8.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "You cannot Return a Book that is not Borrowed !" + "\nTry Again?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
returnBook();
}
}
else if(returnEntry == bookID[8] && book9.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Return Book?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Returned ! Thank You !");
book9.returned();
}
}
else if(returnEntry == bookID[8] && book9.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "You cannot Return a Book that is not Borrowed !" + "\nTry Again?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
returnBook();
}
}
else if(returnEntry == bookID[9] && book10.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Return Book?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Returned ! Thank You !");
book10.returned();
}
}
else if(returnEntry == bookID[9] && book10.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "You cannot Return a Book that is not Borrowed !" + "\nTry Again?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
returnBook();
}
}
else if(returnEntry == bookID[10] && book11.isBorrowed() == true)
{
pressed = JOptionPane.showConfirmDialog(null, "Return Book?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "Book Returned ! Thank You !");
book11.returned();
}
}
else if(returnEntry == bookID[10] && book11.isBorrowed() == false)
{
pressed = JOptionPane.showConfirmDialog(null, "You cannot Return a Book that is not Borrowed !" + "\nTry Again?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
returnBook();
}
}
else
{
pressed = JOptionPane.showConfirmDialog(null, "BOOK NOT IN OUR CATALOGUE !" + "\n Try Again?", "Return Book", JOptionPane.INFORMATION_MESSAGE);
if(pressed == JOptionPane.YES_OPTION)
{
returnBook();
}
}
}
catch(Exception e)
{
}
}
public void aboutBook()
{
try
{
JOptionPane.showMessageDialog(null, "Authors: " + "\nJeli Quides" + "\nEmmanuel Bulawan" + "\nJaymark Dacpano" +
"\n" + "\nWe made this program for our final requirement in our Java Programming 2, " +
"\nThis code is written in JCreator Pro from scratch, " +
"\nIf you have any questions please approach the authors mentioned above. " + "\nThank You!");
}
catch(Exception e)
{
}
}
class searchButton implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
searchBook();
}
}
class rentButton implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
rentBook();
}
}
class returnButton implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
returnBook();
}
}
class aboutButton implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
aboutBook();
}
}
}
class MainSystem
{
public static void main(String[] args)
{
new Library();
}
}