Java Code for Library Management System

Only available on StudyMode
  • Topic: C++, Control flow
  • Pages : 26 (3009 words )
  • Download(s) : 110
  • Published : December 12, 2012
Open Document
Text Preview
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
import javax.swing.JPopupMenu;
import com.sun.java.swing.plaf.motif.MotifLookAndFeel;

public class ProjectLibrary extends JFrame implements ActionListener {
JTextField id,phno,name,add,city,padd,eadd,class1,shift,progress,date;
JTextField bookTF,authorTF,priceTF,bcodeTF;
JTextField cdcodeTF,cdtitleTF,cdisbnTF,cdeditionTF,cdpubTF;
Container c;
JButton search,save,delete,exit,update;
JButton searBook,saveNow,update1;
JButton cdsearch,cdsave,cddelete,cdexit,cdupdate;
JLabel cdlogo,cdcode,cdtitle,cdisbn,cdedit,cdpub;
JOptionPane jp = new JOptionPane();
JMenuBar menuBar,menuBar1;
JMenu menu1,menu2;
JMenuItem menuItemN,menuItemB,menuItemC,menuItemH,menuItemA,menuItemE;
Cursor cur;

public ProjectLibrary()
{
super("Library Record System");
c = getContentPane(); c.setBackground(new Color(14,58,119));
c.setLayout(null);
setBounds(0,0,850,590);
setFont(new Font("verdana",3,14));
cur = new Cursor(Cursor.CROSSHAIR_CURSOR);
setCursor(cur);
ImageIcon coll = new ImageIcon("collicon.gif");
JLabel LogoColl = new JLabel(coll);
menuBar = new JMenuBar();
menu1 = new JMenu("Library");menu1.setBackground(Color.white);
menu1.setMnemonic('L');
menu2 = new JMenu("Help");
menu2.setMnemonic('H');menu2.setBackground(Color.white);

menuItemN = new JMenuItem("New",new ImageIcon("NEW.GIF")); menuItemN.setBackground(Color.white);
menuItemN.setMnemonic('N');
menuItemB = new JMenuItem("Books",new ImageIcon("b.gif")); menuItemB.setBackground(Color.white); menuItemB.setMnemonic('B');
menuItemC = new JMenuItem("CD's",new ImageIcon("c.gif"));menuItemC.setBackground(Color.white);
menuItemC.setMnemonic('C');
menuItemE = new JMenuItem("Exit",new ImageIcon("Exit.PNG")); menuItemE.setBackground(Color.white);
menuItemE.setMnemonic('E');
menuItemH = new JMenuItem("Help library",new ImageIcon("help.gif")); menuItemH.setBackground(Color.white);
menuItemH.setMnemonic('E');
menuItemA = new JMenuItem("About Library Record System");
setJMenuBar(menuBar);

JLabel lDate = new JLabel("Issue Of Date :"); lDate.setForeground(Color.white); JLabel ph = new JLabel("Enter Phone Number :"); ph.setForeground(Color.white); JLabel lname = new JLabel("Student's Name :"); lname.setForeground(Color.white);

JLabel address = new JLabel("Student's Address :");address.setForeground(Color.white);
JLabel lid = new JLabel("Book Code"); lid.setForeground(Color.white);
JLabel lcity = new JLabel("City"); lcity.setForeground(Color.white);
JLabel pad = new JLabel("Permenent Address"); pad.setForeground(Color.white);

JLabel leadd = new JLabel("Email Address"); leadd.setForeground(Color.white);
JLabel lclass = new JLabel("Class"); lclass.setForeground(Color.white);
JLabel lshift = new JLabel("Shift"); lshift.setForeground(Color.white); JLabel lprogress = new JLabel("Progress"); lprogress.setForeground(Color.white);
ImageIcon next = new ImageIcon("next.gif");
JLabel next1 = new JLabel(next);
ImageIcon previous = new ImageIcon("Back.gif");
JLabel previous1 = new JLabel(previous);

ImageIcon background = new ImageIcon("backg.jpg");
JLabel img = new JLabel(background);

ImageIcon college = new ImageIcon("Movie1.PNG");
JLabel colLogo = new JLabel(college);

ImageIcon LineStraight = new ImageIcon("lineh.gif");
JLabel Line = new JLabel(LineStraight);

date = new JTextField(); date.setForeground(Color.black); date.setBackground(Color.white); phno = new JTextField(); phno.setForeground(Color.black); phno.setBackground(Color.white); name = new JTextField(); name.setForeground(Color.black); name.setBackground(Color.white); add =...
tracking img