Sie sind auf Seite 1von 7

import javax.swing.

*;

import javax.swing.JFrame ;

import javax.swing.JLabel ;

import javax.swing.JTextField ;

import javax.swing.JButton ;

import javax.swing.JOptionPane ;

import java.awt.*;

import java.awt.event.*;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.sql.*;

//You implement an action listener to define what should be done when an user performs certain
operation.

public class Chestionar extends JFrame implements ActionListener

JLabel q1 = new JLabel ("1) Numele si Prenume: ");

JLabel q2 = new JLabel ("2) Adresa de e-mail :");

JLabel q3 = new JLabel ("3 )Numar de telefon: ");

JLabel q4 = new JLabel ("4) Facultatea la care suneti student: ");

JLabel q5 = new JLabel ("5) Specializarea dumneavoastra este: ");

JLabel q6 = new JLabel ("6) Situatia dumneavoastra pe piata de munca:");

JLabel q7 = new JLabel ("7) Denumirea postului ocupat:");

JLabel q8 = new JLabel ("8) Tipul postului ocupat :");

JLabel q9 = new JLabel ("9) Numele companiei unde lucrati:");

JLabel q10 = new JLabel ("10) Orasul in care lucrati: ");

JLabel q11 = new JLabel ("11) Situatia scoala actuala:");

JLabel q12 = new JLabel ("12) Unde doriti sa lucrati:");


JButton b1 = new JButton ("Trimite datele!");

JButton b2 = new JButton (" Iesire!");

JTextField a1 = new JTextField ();

JTextField a2 = new JTextField ();

JTextField a3 = new JTextField ();

JTextField a7 = new JTextField();

JTextField a9 = new JTextField();

JTextField a10 = new JTextField();

JComboBox jc = new JComboBox();

JPanel panel = new JPanel();

Connection con;

Statement st;

ResultSet rs;

private Chestionar c;

public static void main(String[] args)

Chestionar c = new Chestionar ();

c.setVisible(true); // pot vedea metoda; imi arata framul din chestionar


}

public Chestionar () { // constructor

setVisible(true);

setSize(1000 ,1000 );

setLocationRelativeTo(null);

//de fiecare data cand se deschde fereastra- sa fie in centru

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

setTitle ("Chestionar");

setLayout(null);

setResizable(false);

q1.setBounds (10 , 10, 300, 30);

a1.setBounds (400, 10, 300, 30);

q2.setBounds (10 , 45, 300, 30);

a2.setBounds (400, 45, 300, 30);

q3.setBounds (10 , 80, 300, 30);

a3.setBounds (400, 80, 300, 30);

q4.setBounds (10 , 115, 300, 30);

q5.setBounds (10 , 150, 300, 30);

q6.setBounds (10 , 185, 300, 30);

q7.setBounds (10 , 220, 300, 30);

a7.setBounds (400, 220, 300, 30);


q8.setBounds (10 , 255, 300, 30);

q9.setBounds (10 , 290, 300, 30);

a9.setBounds (400, 290, 300, 30);

q10.setBounds (10 , 325, 300, 30);

a10.setBounds (400, 325, 300, 30);

q11.setBounds (10 , 360, 300, 30);

q12.setBounds (10 , 395, 300, 30);

b1.setBounds(70, 900, 120, 30);

b2.setBounds(200, 900, 120, 30);

add(q1);

add(a1);

add(q2);

add(a2);

add(q3);

add(a3);

add(q4);

add(q5);
add(q6);

add(q7);

add(a7);

add(q8);

add(q9);

add(a9);

add(q10);

add(a10);

add(q11);

add(q12);

add(b1);

add(b2);

b1.addActionListener(this);

b2.addActionListener(this);

@Override

public void actionPerformed(ActionEvent e) {

if (e.getSource() == b1) {
int input = JOptionPane.showConfirmDialog(null,"Datele sunt corecte?", "Confirma",
JOptionPane.YES_NO_OPTION);

if (input == 0)

System.exit(0); //daca este corecta iese

else{

JOptionPane.showMessageDialog(null, "Va rugam introduceti datele


corecte");

while (input == 0)

c.Chestionar();

c.setVisible(true);

else

if (e.getSource () == b2){}

System.exit(0);

private void Chestionar() {

// TODO Auto-generated method stub

Das könnte Ihnen auch gefallen