1.Develop a simple OPAC system for library using even-driven and concurrent programming paradigms of Java. Use JDBC to connect to a back-end database. 2.Develop multi-threaded echo server and a corresponding GUI client in Java.reply me sir
View Answers
September 12, 2010 at 10:25 PM
// OPAC system for Library program by WHITMAN KUMARESH for my sister DHANA
// And dedicated to my java Professor. Bhuvaneshwari mam
NewMem = new JButton("New Member"); NewMem.addActionListener(this); butmainp.add(NewMem);
NewBook = new JButton("New Book Entry"); NewBook.addActionListener(this); butmainp.add(NewBook);
Member = new JButton("Member Details"); Member.addActionListener(this); butmainp.add(Member);
Books = new JButton("Book Details"); Books.addActionListener(this); butmainp.add(Books);
cont.add("Center", butmainp);
}
public void actionPerformed(ActionEvent e) { String s = e.getActionCommand(); if (s.equals("Exit")) { System.exit(0); } else if (s.equalsIgnoreCase("Help")) { JOptionPane.showMessageDialog(null, "This is a application for OPAC.\nFor more information:\n\tContact cse Innovators", "Help...!", JOptionPane.PLAIN_MESSAGE); } else if (s.equalsIgnoreCase("About")) { JOptionPane.showMessageDialog(null, "By Whitman Kumaresh - NPSB CSE Innovators.\nUnder the guidence of BHUVANESHWARI Mam.", "About", JOptionPane.PLAIN_MESSAGE); } if (s.equals("New Member")) { NewMem nm1 = new NewMem(); nm1.setTitle("New Member"); nm1.setSize(370, 240); nm1.setVisible(true); } if (s.equals("Member Details")) { Member m1 = new Member(); m1.setTitle("Member Details"); m1.setSize(330, 280); m1.setVisible(true); } if (s.equals("New Book Entry")) { NewBook nb1 = new NewBook(); nb1.setTitle("New Book Entry"); nb1.setSize(370, 240); nb1.setVisible(true); } if (s.equals("Book Details")) { Book b1 = new Book(); b1.setTitle("Book Details"); b1.setSize(800, 420); b1.setVisible(true); } }
public static void main(String args[]) { Library main = new Library(); main.setTitle("Library"); main.setSize(640, 480); main.setResizable(false); main.setVisible(true); main.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } }
Book() { cont = getContentPane(); membp = new JPanel(); membp.setLayout(new FlowLayout(FlowLayout.LEFT)); this.setDefaultCloseOperation(DISPOSE_ON_CLOSE); desp.setToolTipText("Books available in library.\nShort description on every book."); disp(); cont.add(membp); }
l1 = new JLabel("Enter Member ID:"); t1 = new JTextField(10);
b1 = new JButton("View"); b1.addActionListener(this); b2 = new JButton("Save"); b2.addActionListener(this);
m1 = new JTextField(20); m2 = new JTextField(20); m3 = new JTextField(20); m4 = new JTextField(20); m5 = new JTextField(20); m6 = new JTextField(20); m7 = new JTextField(20);
mb1 = new JLabel("Name: "); mb2 = new JLabel("Address: "); mb3 = new JLabel("Designation: "); mb4 = new JLabel("Member ID: "); mb5 = new JLabel("Book 1: "); mb6 = new JLabel("Book 2: "); mb7 = new JLabel("Book 3: "); membp.add(l1); membp.add(t1); membp.add(b1);
NewBook() { cont = getContentPane(); memp = new JPanel(); this.setDefaultCloseOperation(DISPOSE_ON_CLOSE); memp.setLayout(new FlowLayout(FlowLayout.RIGHT)); JLabel nm1 = new JLabel("Name:", JLabel.RIGHT); bName = new JTextField(25); JLabel nm2 = new JLabel("Book No:", JLabel.RIGHT); bNo = new JTextField(25); JLabel nm3 = new JLabel("Author:", JLabel.RIGHT); bAuth = new JTextField(25); JLabel nm4 = new JLabel("Publisher:", JLabel.RIGHT); bPub = new JTextField(10); JLabel nm5 = new JLabel("Year:", JLabel.RIGHT); bYr = new JTextField(10);
bName.setToolTipText("Enter book name"); bNo.setToolTipText("Enter book no"); bAuth.setToolTipText("Enter author name"); bPub.setToolTipText("Enter publisher name"); bYr.setToolTipText("Enter year of the book being published");
public void actionPerformed(ActionEvent e) { String a = e.getActionCommand(); if (a.equals("Add Book")) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con = DriverManager.getConnection("jdbc:odbc:Lib"); String table = "Book"; PreparedStatement ps = con.prepareStatement("insert into " + table + " values(?,?,?,?,?)"); ps.setString(1, bName.getText()); ps.setString(2, bNo.getText()); ps.setString(3, bAuth.getText()); ps.setString(4, bPub.getText()); ps.setString(5, bYr.getText()); ps.executeUpdate(); ps.close(); JOptionPane.showMessageDialog(null, bName.getText() + " has been added to Book list", "Member Notification", JOptionPane.PLAIN_MESSAGE); } catch (Exception q) { }
} else { JOptionPane.showMessageDialog(null, bName.getText() + "is not added to book list, sorry for inconvenience.\nServer busy.\nTry after some time. ", "Member Notification", JOptionPane.PLAIN_MESSAGE); } } }
NewMem() { cont = getContentPane(); memp = new JPanel(); this.setDefaultCloseOperation(DISPOSE_ON_CLOSE); memp.setLayout(new FlowLayout(FlowLayout.RIGHT)); JLabel nm1 = new JLabel("Name:", JLabel.RIGHT); mName = new JTextField(25); JLabel nm2 = new JLabel("Address:", JLabel.RIGHT); mAdd = new JTextField(25); JLabel nm3 = new JLabel("Designation:", JLabel.RIGHT); mDesig = new JTextField(20); JLabel nm4 = new JLabel("Member ID:", JLabel.RIGHT); mId = new JTextField(10);
mName.setToolTipText("Enter your name. "); mAdd.setToolTipText("Enter your address."); mDesig.setToolTipText("Enter your Designation."); mId.setToolTipText("Enter your Mem ID.\nTo be provided while borrowing books.");
java
java hi im new to java plz suggest me how to master java....saifjunaid@gmail.com
java
java dear,
i want a field for date picker using java/java script
java
java create java program for delete and update the details,without using database, just a normal java program
java java online telephone directory i need coding for online telephone directory..by using java....pls help me
java
java how to edit text document by using java
then how to edit starting and ending of text document by using java
java
java different between java & core java
print("code sample
java java pattern code for a given words java pattern code for a given words pattern
java
java how can use sleep in java
which book learn of java language
java java How to set java Policy for applet using jdk 6
java
java why methods in java raise exceptions
Have a look at the following link:
Java Exceptions
java java code to search the nodes how to write the java code to search the nodes using routers
java
java different between java & core java
print("code sample
java
java how to prepare the java
Hi Friend,
If you want to learn how to install java, creating and running a java program then go through the following links:
http://www.roseindia.net/java/beginners/index.shtml
http
java
java java swing
Swing is a principal GUI toolkit for the Java programming language. It is a part of the JFC (Java Foundation Classes), which is an API for providing a graphical user interface for Java programs
java
java what is the need of java if java is not there what will happen... work unless you have Java installed, and more are created every day. Java... to scientific supercomputers, cell phones to the Internet, Java is everywhere!
http
java
java 1.what type of inheritance supported in java.
2.what is the advantage of java over C++.
Hi Friend,
Java supports following... inheritance
Advantages of Java over C++:
1)Java is pure object oriented
java
java how to run applets in java
Hi,
In Java you can use Applet viewer to run the applet. Read more at Java Applet Viewer tutorial page.
Thanks
java
java what is javaJava is a programming language..., and business applications.
Advantages of Java:
* Java is simple, easy to design... programming languages.
* Java is object-oriented, that is used to build modular
Java Java What is the immediate superclass of the Dialog class