Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

import java.awt.

HeadlessException;
import java.io.File;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
import java.util.HashMap;
import javax.swing.JFileChooser;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.view.JasperViewer;

/*
* To change this license header, choose License Headers in Project
Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author Mayank
*/
public class Award_CV extends javax.swing.JFrame {

/**
* Creates new form Award_CV
*/
private Connection conn,con1;
private Statement stmt;
int userid=14;
int cnt=0;

public Award_CV() throws HeadlessException {


initComponents();
}

public Award_CV(int id) {


initComponents();
this.userid=id;
}

/**
* This method is called from within the constructor to initialize
the form.
* WARNING: Do NOT modify this code. The content of this method is
always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-
BEGIN:initComponents
private void initComponents() {

jLabel12 = new javax.swing.JLabel();


jTextField5 = new javax.swing.JTextField();
jLabel15 = new javax.swing.JLabel();
jTextField8 = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jButton10 = new javax.swing.JButton();
jButton14 = new javax.swing.JButton();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
Menu = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jSeparator2 = new javax.swing.JSeparator();
jSeparator3 = new javax.swing.JSeparator();
jButton1 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jButton5 = new javax.swing.JButton();
jButton6 = new javax.swing.JButton();
jButton7 = new javax.swing.JButton();
jButton8 = new javax.swing.JButton();
jButton9 = new javax.swing.JButton();
jButton11 = new javax.swing.JButton();
jButton12 = new javax.swing.JButton();
jButton13 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jButton15 = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

jLabel12.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N


jLabel12.setText("Orginization");

jTextField5.setFont(new java.awt.Font("Calibri", 0, 28)); //


NOI18N

jLabel15.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N


jLabel15.setText("Year");

jTextField8.setFont(new java.awt.Font("Calibri", 0, 28)); //


NOI18N
jTextField8.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField8ActionPerformed(evt);
}
});
jLabel3.setFont(new java.awt.Font("Calibri", 0, 18)); // NOI18N
jLabel3.setText("Discription");

jTextArea1.setColumns(20);
jTextArea1.setFont(new java.awt.Font("Calibri", 0, 24)); //
NOI18N
jTextArea1.setRows(6);
jTextArea1.setText("Enter Your Award Achivement and it's field
discription.");
jScrollPane1.setViewportView(jTextArea1);

jButton10.setFont(new java.awt.Font("Calibri", 0, 32)); // NOI18N


jButton10.setText("Add Award");

jButton10.setBorder(javax.swing.BorderFactory.createCompoundBorder(null,
javax.swing.BorderFactory.createCompoundBorder()));
jButton10.setCursor(new
java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jButton10.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton10ActionPerformed(evt);
}
});

jButton14.setFont(new java.awt.Font("Calibri", 0, 28)); // NOI18N


jButton14.setText("View CV");
jButton14.setBorderPainted(false);
jButton14.setCursor(new
java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jButton14.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
jButton14MouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
jButton14MouseExited(evt);
}
});
jButton14.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton14ActionPerformed(evt);
}
});

jLabel4.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/award.png"))); //
NOI18N

jLabel5.setFont(new java.awt.Font("Calibri", 0, 36)); // NOI18N

jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel5.setText("Award");

jLabel2.setFont(new java.awt.Font("Calibri", 0, 24)); // NOI18N


jButton1.setFont(new java.awt.Font("Calibri", 0, 24)); // NOI18N
jButton1.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/report.png"))); //
NOI18N
jButton1.setText(" Summary
");
jButton1.setBorderPainted(false);
jButton1.setCursor(new
java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jButton1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

jButton3.setFont(new java.awt.Font("Calibri", 0, 24)); // NOI18N


jButton3.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/portfolio.png")));
// NOI18N
jButton3.setText(" Experience
");
jButton3.setBorderPainted(false);
jButton3.setCursor(new
java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jButton3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});

jButton4.setFont(new java.awt.Font("Calibri", 0, 24)); // NOI18N


jButton4.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/scholarship.png")))
; // NOI18N
jButton4.setText(" Education
");
jButton4.setBorderPainted(false);
jButton4.setCursor(new
java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jButton4.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});

jButton5.setFont(new java.awt.Font("Calibri", 0, 24)); // NOI18N


jButton5.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/user (3).png")));
// NOI18N
jButton5.setText(" Personal Info ");
jButton5.setBorderPainted(false);
jButton5.setCursor(new
java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jButton5.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
}
});

jButton6.setFont(new java.awt.Font("Calibri", 0, 24)); // NOI18N


jButton6.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/settings.png")));
// NOI18N
jButton6.setText(" Skills
");
jButton6.setBorderPainted(false);
jButton6.setCursor(new
java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jButton6.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
}
});

jButton7.setFont(new java.awt.Font("Calibri", 0, 24)); // NOI18N


jButton7.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/workshop-icon-
vector-6280433.jpg"))); // NOI18N
jButton7.setText(" Workshop");
jButton7.setCursor(new
java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

jButton7.setHorizontalAlignment(javax.swing.SwingConstants.LEADING);
jButton7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton7ActionPerformed(evt);
}
});

jButton8.setFont(new java.awt.Font("Calibri", 0, 24)); // NOI18N


jButton8.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/jigsaw (1).png")));
// NOI18N
jButton8.setText(" Hobbies");
jButton8.setCursor(new
java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

jButton8.setHorizontalAlignment(javax.swing.SwingConstants.LEADING);
jButton8.setOpaque(false);
jButton8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton8ActionPerformed(evt);
}
});

jButton9.setFont(new java.awt.Font("Calibri", 0, 24)); // NOI18N


jButton9.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/donation
(1).png"))); // NOI18N
jButton9.setText(" Volunteer Experience");
jButton9.setCursor(new
java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

jButton9.setHorizontalAlignment(javax.swing.SwingConstants.LEADING);
jButton9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton9ActionPerformed(evt);
}
});

jButton11.setFont(new java.awt.Font("Calibri", 0, 24)); // NOI18N


jButton11.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/diploma
(1).png"))); // NOI18N
jButton11.setText(" Certification");
jButton11.setCursor(new
java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

jButton11.setHorizontalAlignment(javax.swing.SwingConstants.LEADING);
jButton11.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton11ActionPerformed(evt);
}
});

jButton12.setFont(new java.awt.Font("Calibri", 0, 24)); // NOI18N


jButton12.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/project-management
(1).png"))); // NOI18N
jButton12.setText(" Projects");
jButton12.setCursor(new
java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

jButton12.setHorizontalAlignment(javax.swing.SwingConstants.LEADING);
jButton12.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton12ActionPerformed(evt);
}
});

jButton13.setFont(new java.awt.Font("Calibri", 0, 24)); // NOI18N


jButton13.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/award (1).png")));
// NOI18N
jButton13.setText(" Awards");
jButton13.setCursor(new
java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jButton13.setHorizontalAlignment(javax.swing.SwingConstants.LEADING);
jButton13.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton13ActionPerformed(evt);
}
});

jLabel1.setFont(new java.awt.Font("Calibri", 0, 24)); // NOI18N

jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("FILL IN YOUR DOCUMENT ");
jLabel1.setBorder(javax.swing.BorderFactory.createLineBorder(new
java.awt.Color(0, 0, 0), 2));

javax.swing.GroupLayout MenuLayout = new


javax.swing.GroupLayout(Menu);
Menu.setLayout(MenuLayout);
MenuLayout.setHorizontalGroup(

MenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jSeparator2)
.addGroup(MenuLayout.createSequentialGroup()
.addContainerGap()

.addGroup(MenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignmen
t.LEADING)
.addComponent(jButton1,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton3,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton4,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton5,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton6,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
MenuLayout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jLabel2)
.addGap(348, 348, 348))
.addComponent(jButton7,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton8,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton9,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton11,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton12,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton13,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel1,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))

.addGroup(MenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignmen
t.LEADING)
.addComponent(jSeparator3,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE, 358, Short.MAX_VALUE))
);
MenuLayout.setVerticalGroup(

MenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(MenuLayout.createSequentialGroup()
.addGap(68, 68, 68)
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addComponent(jSeparator2,
javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(81, 81, 81)
.addComponent(jLabel2)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton5)
.addGap(18, 18, 18)
.addComponent(jButton1)
.addGap(18, 18, 18)
.addComponent(jButton3)
.addGap(18, 18, 18)
.addComponent(jButton4)
.addGap(18, 18, 18)
.addComponent(jButton6)
.addGap(18, 18, 18)
.addComponent(jButton8)
.addGap(18, 18, 18)
.addComponent(jButton7)
.addGap(18, 18, 18)
.addComponent(jButton11)
.addGap(18, 18, 18)
.addComponent(jButton9)
.addGap(18, 18, 18)
.addComponent(jButton12)
.addGap(18, 18, 18)
.addComponent(jButton13)
.addContainerGap(338, Short.MAX_VALUE))

.addGroup(MenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignmen
t.LEADING)
.addGroup(MenuLayout.createSequentialGroup()
.addGap(130, 130, 130)
.addComponent(jSeparator3,
javax.swing.GroupLayout.PREFERRED_SIZE, 10,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(1059, Short.MAX_VALUE)))
);

jButton15.setFont(new java.awt.Font("Calibri", 0, 28)); // NOI18N


jButton15.setText("Save to PC");
jButton15.setBorderPainted(false);
jButton15.setCursor(new
java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jButton15.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
jButton15MouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
jButton15MouseExited(evt);
}
});
jButton15.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton15ActionPerformed(evt);
}
});

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(Menu,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(113, 113, 113)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
.addComponent(jLabel12)
.addComponent(jTextField5)
.addComponent(jTextField8,
javax.swing.GroupLayout.PREFERRED_SIZE, 301,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel15)
.addComponent(jLabel3)
.addComponent(jButton10,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE, 844,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addComponent(jButton15)
.addGap(92, 92, 92)
.addComponent(jButton14)))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 243,
Short.MAX_VALUE)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addComponent(jLabel4)
.addComponent(jLabel5,
javax.swing.GroupLayout.PREFERRED_SIZE, 255,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(81, 81, 81))
);
layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(layout.createSequentialGroup()
.addGap(188, 188, 188)
.addComponent(jLabel4)
.addGap(18, 18, 18)
.addComponent(jLabel5))
.addGroup(layout.createSequentialGroup()
.addGap(171, 171, 171)
.addComponent(jLabel12)
.addGap(18, 18, 18)
.addComponent(jTextField5,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel15)
.addGap(18, 18, 18)
.addComponent(jTextField8,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel3)
.addGap(18, 18, 18)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE, 220,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(64, 64, 64)
.addComponent(jButton10)
.addGap(63, 63, 63)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BA
SELINE)
.addComponent(jButton14)
.addComponent(jButton15))
.addGap(0, 368, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(Menu,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addContainerGap())
);

pack();
}// </editor-fold>//GEN-END:initComponents

private void jTextField8ActionPerformed(java.awt.event.ActionEvent


evt) {//GEN-FIRST:event_jTextField8ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField8ActionPerformed

private void jButton10ActionPerformed(java.awt.event.ActionEvent evt)


{//GEN-FIRST:event_jButton10ActionPerformed
// TODO add your handling code here:
try{
Class.forName("com.mysql.jdbc.Driver");

conn =
DriverManager.getConnection("jdbc:mysql://localhost:3306/cv_resume_builde
r", "root", "mayank");

stmt = conn.createStatement();

stmt.executeUpdate("INSERT INTO `award`(`UserId`, `aYear`,


`Achivement`, `aOrganization`) VALUES
('"+userid+"','"+Integer.parseInt(jTextField8.getText())+"','"+jTextArea1
.getText()+"','"+jTextField5.getText()+"');");
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
Award_CV a1=new Award_CV(userid);
this.setVisible(false);
a1.setVisible(true);
}//GEN-LAST:event_jButton10ActionPerformed

private void jButton14MouseEntered(java.awt.event.MouseEvent evt)


{//GEN-FIRST:event_jButton14MouseEntered
// TODO add your handling code here:
//jButton2.setBackground(Color.BLACK);
//jButton2.setForeground(Color.WHITE);
}//GEN-LAST:event_jButton14MouseEntered

private void jButton14MouseExited(java.awt.event.MouseEvent evt)


{//GEN-FIRST:event_jButton14MouseExited
// TODO add your handling code here:
//jButton2.setBackground(Color.WHITE);
//jButton2.setForeground(Color.BLACK);
}//GEN-LAST:event_jButton14MouseExited

private void jButton14ActionPerformed(java.awt.event.ActionEvent evt)


{//GEN-FIRST:event_jButton14ActionPerformed
// TODO add your handling code here:
//Menu.setVisible(true);
try{
if(cnt ==0){
// Class.forName("com.mysql.jdbc.Driver");
//
// conn =
DriverManager.getConnection("jdbc:mysql://localhost:3306/cv_resume_builde
r", "root", "mayank");
//
// stmt = conn.createStatement();
//
// stmt.executeUpdate("INSERT INTO `award`(`UserId`, `aYear`,
`Achivement`, `aOrganization`) VALUES
('"+userid+"','"+Integer.parseInt(jTextField8.getText())+"','"+jTextArea1
.getText()+"','"+jTextField5.getText()+"');");
cnt++;}
HashMap param=new HashMap();
param.put("user", userid);
try{
Class.forName("com.mysql.jdbc.Driver");
con1 =
DriverManager.getConnection("jdbc:mysql://localhost:3306/cv_resume_builde
r", "root", "mayank");
String reportpath="src\\report\\CV.jrxml";
JasperReport jr =
JasperCompileManager.compileReport(reportpath);
JasperPrint jp = JasperFillManager.fillReport(jr, param,
con1);
JasperViewer.viewReport(jp);

//JasperExportManager.exportReportToPdfFile(jp,"E:\\oop_lab\\Netbeans_wor
kspace\\mayank.pdf");
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}//GEN-LAST:event_jButton14ActionPerformed

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


{//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
Summary_CV s=new Summary_CV();
this.setVisible(false);
s.setVisible(true);
}//GEN-LAST:event_jButton1ActionPerformed

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


{//GEN-FIRST:event_jButton3ActionPerformed
// TODO add your handling code here:
Experience_CV e=new Experience_CV();
this.setVisible(false);
e.setVisible(true);
}//GEN-LAST:event_jButton3ActionPerformed

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


{//GEN-FIRST:event_jButton4ActionPerformed
// TODO add your handling code here:
Education_CV e=new Education_CV();
this.setVisible(false);
e.setVisible(true);
}//GEN-LAST:event_jButton4ActionPerformed

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


{//GEN-FIRST:event_jButton5ActionPerformed
// TODO add your handling code here:
Personal_Information_CV pe1=new Personal_Information_CV();
this.setVisible(false);
pe1.setVisible(true);
}//GEN-LAST:event_jButton5ActionPerformed

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


{//GEN-FIRST:event_jButton6ActionPerformed
// TODO add your handling code here:
Skills_CV sk1=new Skills_CV();
this.setVisible(false);
sk1.setVisible(true);
}//GEN-LAST:event_jButton6ActionPerformed

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


{//GEN-FIRST:event_jButton7ActionPerformed
// TODO add your handling code here:
Workshop_CV w1=new Workshop_CV();
this.setVisible(false);
w1.setVisible(true);
}//GEN-LAST:event_jButton7ActionPerformed

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


{//GEN-FIRST:event_jButton8ActionPerformed
// TODO add your handling code here:
Hobbies_CV h1=new Hobbies_CV();
this.setVisible(false);
h1.setVisible(true);
}//GEN-LAST:event_jButton8ActionPerformed

private void jButton9ActionPerformed(java.awt.event.ActionEvent evt)


{//GEN-FIRST:event_jButton9ActionPerformed
// TODO add your handling code here:
VolunteerExperience_CV v1=new VolunteerExperience_CV();
this.setVisible(false);
v1.setVisible(true);
}//GEN-LAST:event_jButton9ActionPerformed

private void jButton11ActionPerformed(java.awt.event.ActionEvent evt)


{//GEN-FIRST:event_jButton11ActionPerformed
// TODO add your handling code here:
Certification_CV c1=new Certification_CV();
this.setVisible(true);
c1.setVisible(true);
}//GEN-LAST:event_jButton11ActionPerformed

private void jButton12ActionPerformed(java.awt.event.ActionEvent evt)


{//GEN-FIRST:event_jButton12ActionPerformed
// TODO add your handling code here:
Project_CV p1=new Project_CV();
this.setVisible(false);
p1.setVisible(true);
}//GEN-LAST:event_jButton12ActionPerformed

private void jButton13ActionPerformed(java.awt.event.ActionEvent evt)


{//GEN-FIRST:event_jButton13ActionPerformed
// TODO add your handling code here:
//Award_CV a1=new Award_CV();
//this.setVisible(false);
//a1.setVisible(true);
}//GEN-LAST:event_jButton13ActionPerformed

private void jButton15MouseEntered(java.awt.event.MouseEvent evt)


{//GEN-FIRST:event_jButton15MouseEntered
// TODO add your handling code here:
//jButton2.setBackground(Color.BLACK);
//jButton2.setForeground(Color.WHITE);
}//GEN-LAST:event_jButton15MouseEntered

private void jButton15MouseExited(java.awt.event.MouseEvent evt)


{//GEN-FIRST:event_jButton15MouseExited
// TODO add your handling code here:
//jButton2.setBackground(Color.WHITE);
//jButton2.setForeground(Color.BLACK);
}//GEN-LAST:event_jButton15MouseExited

private void jButton15ActionPerformed(java.awt.event.ActionEvent evt)


{//GEN-FIRST:event_jButton15ActionPerformed
// TODO add your handling code here:
//Menu.setVisible(true);
try{
if(cnt==0){
// Class.forName("com.mysql.jdbc.Driver");
//
// conn =
DriverManager.getConnection("jdbc:mysql://localhost:3306/cv_resume_builde
r", "root", "mayank");
//
// stmt = conn.createStatement();
//
// stmt.executeUpdate("INSERT INTO `award`(`UserId`,
`aYear`, `Achivement`, `aOrganization`) VALUES
('"+userid+"','"+Integer.parseInt(jTextField8.getText())+"','"+jTextArea1
.getText()+"','"+jTextField5.getText()+"');");
cnt++;}
HashMap param=new HashMap();
param.put("user", userid);
try{
Class.forName("com.mysql.jdbc.Driver");
con1 =
DriverManager.getConnection("jdbc:mysql://localhost:3306/cv_resume_builde
r", "root", "mayank");
String reportpath="src\\report\\CV.jrxml";
JasperReport jr =
JasperCompileManager.compileReport(reportpath);
JasperPrint jp = JasperFillManager.fillReport(jr, param,
con1);
//JasperViewer.viewReport(jp);
JFileChooser filechooser = new JFileChooser();
//filechooser.setDialogTitle();
int status = filechooser.showSaveDialog(this);
if(status == JFileChooser.APPROVE_OPTION)
{
File outpath=filechooser.getSelectedFile();

JasperExportManager.exportReportToPdfFile(jp,outpath.getAbsolutePath());
}
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}//GEN-LAST:event_jButton15ActionPerformed

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel
setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay
with the default look and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Windows".equals(info.getName())) {

javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(Award_CV.class.getName()).log(java.uti
l.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(Award_CV.class.getName()).log(java.uti
l.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(Award_CV.class.getName()).log(java.uti
l.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(Award_CV.class.getName()).log(java.uti
l.logging.Level.SEVERE, null, ex);
}
//</editor-fold>

/* Create and display the form */


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Award_CV().setVisible(true);
}
});
}

// Variables declaration - do not modify//GEN-BEGIN:variables


private javax.swing.JPanel Menu;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton10;
private javax.swing.JButton jButton11;
private javax.swing.JButton jButton12;
private javax.swing.JButton jButton13;
private javax.swing.JButton jButton14;
private javax.swing.JButton jButton15;
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.JButton jButton9;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JSeparator jSeparator2;
private javax.swing.JSeparator jSeparator3;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JTextField jTextField5;
private javax.swing.JTextField jTextField8;
// End of variables declaration//GEN-END:variables
}

You might also like