0% found this document useful (0 votes)
4 views

Digital Library Netbeans project

The document contains Java source code for a digital library application that includes user authentication and book borrowing functionalities. It features a graphical user interface with various buttons and checkboxes for selecting book categories and titles, along with password protection for access. The application provides feedback to users through dialog messages and displays images related to selected books.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Digital Library Netbeans project

The document contains Java source code for a digital library application that includes user authentication and book borrowing functionalities. It features a graphical user interface with various buttons and checkboxes for selecting book categories and titles, along with password protection for access. The application provides feedback to users through dialog messages and displays images related to selected books.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

SOURCE CODE

public class digital_library extends javax.swing.JFrame {


private static final long serialVersionUID = 1L;

/**
* Creates new form digital_library
*/
public digital_library() {
initComponents();
}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
String pwd;
pwd="god";

if (!jpwd.getText().equals(pwd))
{JOptionPane.showMessageDialog(null,"try again with correct
password");
System.exit(0);}
else
{JOptionPane.showMessageDialog(null,"you are logged in");
jFrame1.setVisible(true);
}
}

private void jcbengActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
if (jcbcomic.isSelected())
{jfcomic.setVisible(true);}
else if(jcbeng.isSelected())
{jfeng.setVisible(true);}
else if(jcbsci.isSelected())
{jfsci.setVisible(true);}
else if(jcbtamil.isSelected())
{jflang.setVisible(true);}
else if(jcbmusic.isSelected())
{jfmusic.setVisible(true);}
else

{JOptionPane.showMessageDialog(null,"select one category");}


}

private void jcbcomicActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
jfinalframe.setVisible(true);
jtbook.setText(""+jctitles.getSelectedItem());
jtbook.setEditable(false);
}

private void jctitlesActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
// jimage.setText(""+jctitles.getSelectedItem());
jctitles.setEditable(false);
ImageIcon iconLogo = new ImageIcon("C:\\Users\\sys6\\Pictures\\
comic\\"+jctitles.getSelectedItem()+".jpg");

jimage.setIcon(iconLogo);

private void jcbsciActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

private void jcbmusicActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

private void jcbtamilActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
JOptionPane.showMessageDialog(null,"your booking has been
confirmed");

jfresult.setVisible(true);
jtarea.setText("Name:\t"+jtinput.getText()+"\nClass:\
t"+jcbclass.getSelectedItem()+"\nSection:\t"+jcbsection.getSelectedItem()
+"\nBook Borrowed:\t"+jtbook.getText()+"\n-PLEASE NOTE-"+"\nTHE
BOOK SHOULD BE RETURNED WITHIN 15 DAYS!!"
+"\nTHE BOOK CAN BE COLLECTED FROM LIBRARY IN 4 HOURS");

private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
jfinalframe.setVisible(true);
jtbook.setText(""+jcscititles.getSelectedItem());
jtbook.setEditable(false);
}

private void jcscititlesActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
jcscititles.setEditable(false);
ImageIcon iconLogo = new ImageIcon("C:\\Users\\sys6\\Pictures\\
science\\"+jcscititles.getSelectedItem()
+".jpg");

jsciimage.setIcon(iconLogo);

private void jcmtitlesActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
jcmtitles.setEditable(false);
ImageIcon iconLogo = new ImageIcon("C:\\Users\\sys6\\Pictures\\
music\\"+jcmtitles.getSelectedItem()+
".jpg");

jmimage.setIcon(iconLogo);

private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
jfinalframe.setVisible(true);
jtbook.setText(""+jcmtitles.getSelectedItem());
jtbook.setEditable(false);
}

private void jcltitlesActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
jcltitles.setEditable(false);
ImageIcon iconLogo = new ImageIcon("C:\\Users\\sys6\\Pictures\\
lang\\"+jcltitles.getSelectedItem()+".jpg");

jlimage.setIcon(iconLogo);

private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
jfinalframe.setVisible(true);
jtbook.setText(""+jcltitles.getSelectedItem());
jtbook.setEditable(false);
}

private void jtnameActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:

private void jcengtitlesActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
jcengtitles.setEditable(false);
ImageIcon iconLogo = new ImageIcon("C:\\Users\\sys6\\Pictures\\
eng\\"+jcengtitles.getSelectedItem()+".jpg");

jengimage.setIcon(iconLogo);

private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
jfinalframe.setVisible(true);
jtbook.setText(""+jcengtitles.getSelectedItem());
jtbook.setEditable(false);
}

private void jtinputActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:

private void jpwdActionPerformed(java.awt.event.ActionEvent evt) {


// TODO add your handling code here:
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new digital_library().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.ButtonGroup buttonGroup2;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JButton jButton6;
private javax.swing.JButton jButton7;
private javax.swing.JButton jButton8;
private javax.swing.JFrame jFrame1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel18;
private javax.swing.JLabel jLabel19;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel20;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JPanel jPanel6;
private javax.swing.JPanel jPanel7;
private javax.swing.JPanel jPanel8;
private javax.swing.JPanel jPanel9;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JComboBox jcbclass;
private javax.swing.JCheckBox jcbcomic;
private javax.swing.JCheckBox jcbeng;
private javax.swing.JCheckBox jcbmusic;
private javax.swing.JCheckBox jcbsci;
private javax.swing.JComboBox jcbsection;
private javax.swing.JCheckBox jcbtamil;
private javax.swing.JComboBox jcengtitles;
private javax.swing.JComboBox jcltitles;
private javax.swing.JComboBox jcmtitles;
private javax.swing.JComboBox jcscititles;
private javax.swing.JComboBox jctitles;
private javax.swing.JLabel jengimage;
private javax.swing.JFrame jfcomic;
private javax.swing.JFrame jfeng;
private javax.swing.JFrame jfinalframe;
private javax.swing.JFrame jflang;
private javax.swing.JFrame jfmusic;
private javax.swing.JFrame jfresult;
private javax.swing.JFrame jfsci;
private javax.swing.JLabel jimage;
private javax.swing.JLabel jlimage;
private javax.swing.JLabel jmimage;
private javax.swing.JPasswordField jpwd;
private javax.swing.JLabel jsciimage;
private javax.swing.JTextArea jtarea;
private javax.swing.JTextField jtbook;
private javax.swing.JTextField jtinput;
private javax.swing.JTextField jtname;
private org.jdesktop.beansbinding.BindingGroup bindingGroup;
// End of variables declaration
}
OUT PUT SCREEN

You might also like