diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..9a874b5 Binary files /dev/null and b/.DS_Store differ diff --git a/bancoAgenda.db b/bancoAgenda.db new file mode 100644 index 0000000..83bcbdd Binary files /dev/null and b/bancoAgenda.db differ diff --git a/pom.xml b/pom.xml index 7a79b2c..e127f0c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,6 +4,13 @@ ifb1 javaInterface 1.0-SNAPSHOT + + + org.xerial + sqlite-jdbc + 3.44.0.0 + + jar UTF-8 diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/main/java/br/edu/ifb/DAO/ContatoDAO.java b/src/main/java/br/edu/ifb/DAO/ContatoDAO.java new file mode 100644 index 0000000..f3cdccd --- /dev/null +++ b/src/main/java/br/edu/ifb/DAO/ContatoDAO.java @@ -0,0 +1,111 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package br.edu.ifb.DAO; + +import br.edu.ifb.classes.Contato; +import br.edu.ifb.conexao.Conexao; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * + * @author dariopintor CRUD pequeno teste + */ +public class ContatoDAO { + + public ArrayList lerBanco() { + + Connection con = Conexao.getConnection(); + PreparedStatement stmt = null; + ResultSet rs = null; + ArrayList contatos = new ArrayList<>(); +//teste + try { + stmt = con.prepareStatement("SELECT * FROM Contato"); + rs = stmt.executeQuery(); + + while (rs.next()) { + Contato contato = new Contato(); + contato.setId(rs.getInt("id")); + contato.setIdUsuario(rs.getInt("usuarioId")); + contato.setNome(rs.getString("nome")); + contato.setTelefone(rs.getString("telefone")); + contato.setEmail(rs.getString("email")); + contato.setDataAniversario(rs.getString("aniversario")); + contatos.add(contato); + } + } catch (SQLException ex) { + System.out.println("Não foi possível ler a tabela Contato"); + } finally { + Conexao.closeConnection(con, stmt, rs); + } + return contatos; + } + + public void inserirBanco(Contato c) { + Connection con = Conexao.getConnection(); + PreparedStatement stmt = null; + try { + stmt = con.prepareStatement("INSERT INTO Contato (usuarioId, nome, telefone, email, aniversario) VALUES (?, ?, ?, ?, ?)"); + stmt.setInt(1, c.getIdUsuario()); + stmt.setString(2, c.getNome()); + stmt.setString(3, c.getTelefone()); + stmt.setString(4, c.getEmail()); + stmt.setString(5, c.getDataAniversario()); + stmt.executeUpdate(); + + } catch (SQLException ex) { + System.out.println("Erro ao inserir na tabela Contato"); + } finally { + Conexao.closeConnection(con, stmt); + } + + } + + public void atualizarBanco(Contato c) { + Connection con = Conexao.getConnection(); + PreparedStatement stmt = null; + try { + stmt = con.prepareStatement("UPDATE Contato SET nome = ?, telefone = ?, email = ? , aniversario = ? WHERE id = ?"); + + stmt.setString(1, c.getNome()); + stmt.setString(2, c.getTelefone()); + stmt.setString(3, c.getEmail()); + stmt.setString(4, c.getDataAniversario()); + stmt.setInt(5, c.getId()); + stmt.executeUpdate(); + + } catch (SQLException ex) { + System.out.println("Erro ao atualizar na tabela Contato"); + } finally { + Conexao.closeConnection(con, stmt); + } + + + + +} + public void deletarNoBanco(Contato c) { + Connection con = Conexao.getConnection(); + PreparedStatement stmt = null; + try { + stmt = con.prepareStatement(" DELETE FROM Contato WHERE id = ? AND usuarioID = ?"); + stmt.setInt(1,c.getId()); + stmt.setInt(2,c.getIdUsuario()); + stmt.executeUpdate(); + + } catch (SQLException ex) { + System.out.println("Erro ao deletar na tabela Contato"); + } finally { + Conexao.closeConnection(con, stmt); + } + + } +} diff --git a/src/main/java/br/edu/ifb/DAO/LoginDAO.java b/src/main/java/br/edu/ifb/DAO/LoginDAO.java new file mode 100644 index 0000000..d98a71a --- /dev/null +++ b/src/main/java/br/edu/ifb/DAO/LoginDAO.java @@ -0,0 +1,13 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package br.edu.ifb.DAO; + +/** + * + * @author dariopintor + */ +public class LoginDAO { + +} diff --git a/src/main/java/br/edu/ifb/DAO/RegistrarDAO.java b/src/main/java/br/edu/ifb/DAO/RegistrarDAO.java new file mode 100644 index 0000000..9683733 --- /dev/null +++ b/src/main/java/br/edu/ifb/DAO/RegistrarDAO.java @@ -0,0 +1,13 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package br.edu.ifb.DAO; + +/** + * + * @author dariopintor + */ +public class RegistrarDAO { + +} diff --git a/src/main/java/br/edu/ifb/DAO/UsuarioDAO.java b/src/main/java/br/edu/ifb/DAO/UsuarioDAO.java new file mode 100644 index 0000000..2bd8cbf --- /dev/null +++ b/src/main/java/br/edu/ifb/DAO/UsuarioDAO.java @@ -0,0 +1,13 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package br.edu.ifb.DAO; + +/** + * + * @author dariopintor + */ +public class UsuarioDAO { + +} diff --git a/src/main/java/br/edu/ifb/classes/Contato.java b/src/main/java/br/edu/ifb/classes/Contato.java new file mode 100644 index 0000000..1a1327e --- /dev/null +++ b/src/main/java/br/edu/ifb/classes/Contato.java @@ -0,0 +1,85 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package br.edu.ifb.classes; + +/** + * + * @author dariopintor + */ +public class Contato { + + private int id; + private int idUsuario; + private String nome; + private String telefone; + private String email; + private String dataAniversario; + + public Contato(){ + + } + public Contato(int id, int idUsuario, String nome, String telefone, String email, String dataAniversario) { + this.id = id; + this.idUsuario = idUsuario; + this.nome = nome; + this.telefone = telefone; + this.email = email; + this.dataAniversario = dataAniversario; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getIdUsuario() { + return idUsuario; + } + + public void setIdUsuario(int idUsuario) { + this.idUsuario = idUsuario; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public String getTelefone() { + return telefone; + } + + public void setTelefone(String telefone) { + this.telefone = telefone; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getDataAniversario() { + return dataAniversario; + } + + public void setDataAniversario(String dataAniversario) { + this.dataAniversario = dataAniversario; + } + + @Override + public String toString() { + return "Contato{" + "id=" + id + ", idUsuario=" + idUsuario + ", nome=" + nome + ", telefone=" + telefone + ", email=" + email + ", dataAniversario=" + dataAniversario + '}'; + } + +} diff --git a/src/main/java/br/edu/ifb/classes/Login.java b/src/main/java/br/edu/ifb/classes/Login.java new file mode 100644 index 0000000..6fd3e6d --- /dev/null +++ b/src/main/java/br/edu/ifb/classes/Login.java @@ -0,0 +1,13 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package br.edu.ifb.classes; + +/** + * + * @author dariopintor + */ +public class Login { + +} diff --git a/src/main/java/br/edu/ifb/classes/Registrar.java b/src/main/java/br/edu/ifb/classes/Registrar.java new file mode 100644 index 0000000..8e721bc --- /dev/null +++ b/src/main/java/br/edu/ifb/classes/Registrar.java @@ -0,0 +1,13 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package br.edu.ifb.classes; + +/** + * + * @author dariopintor + */ +public class Registrar { + +} diff --git a/src/main/java/br/edu/ifb/classes/Usuario.java b/src/main/java/br/edu/ifb/classes/Usuario.java new file mode 100644 index 0000000..bb8f047 --- /dev/null +++ b/src/main/java/br/edu/ifb/classes/Usuario.java @@ -0,0 +1,13 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package br.edu.ifb.classes; + +/** + * + * @author dariopintor + */ +public class Usuario { + +} diff --git a/src/main/java/br/edu/ifb/conexao/Conexao.java b/src/main/java/br/edu/ifb/conexao/Conexao.java new file mode 100644 index 0000000..4015b54 --- /dev/null +++ b/src/main/java/br/edu/ifb/conexao/Conexao.java @@ -0,0 +1,61 @@ +package br.edu.ifb.conexao; + + +import br.edu.ifb.DAO.ContatoDAO; +import java.sql.Connection; +import java.sql.Driver; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class Conexao { + + private static final String URL = "jdbc:sqlite:bancoAgenda.db"; + public static Connection getConnection() { + + try { + return DriverManager.getConnection(URL); + } catch (SQLException ex) { + System.out.println("Banco não conectado!"); + Logger.getLogger(Conexao.class.getName()).log(Level.SEVERE, null, ex); + } + return null; + } + + public static void closeConnection(Connection con){ + try { + con.close(); + } catch (SQLException ex) { + Logger.getLogger(Conexao.class.getName()).log(Level.SEVERE, null, ex); + } + } + + public static void closeConnection(Connection con, PreparedStatement stmt){ + closeConnection(con); + try { + + stmt.close(); + } catch (SQLException ex) { + Logger.getLogger(Conexao.class.getName()).log(Level.SEVERE, null, ex); + } + } + + public static void closeConnection(Connection con, PreparedStatement stmt, ResultSet rs){ + closeConnection(con, stmt); + try { + rs.close(); + } catch (SQLException ex) { + Logger.getLogger(Conexao.class.getName()).log(Level.SEVERE, null, ex); + } + + } + + + public static void main(String[] args) { + ContatoDAO ver = new ContatoDAO(); + ver.lerBanco(); + } +} diff --git a/src/main/java/br/edu/ifb/telas/Home.form b/src/main/java/br/edu/ifb/telas/Home.form new file mode 100644 index 0000000..822c654 --- /dev/null +++ b/src/main/java/br/edu/ifb/telas/Home.form @@ -0,0 +1,383 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + </TableColumnModel> + </Property> + <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> + <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tbTabelaMouseClicked"/> + </Events> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanel4"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="cc" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace pref="292" max="32767" attributes="0"/> + <Component id="tbSalvar" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="57" max="-2" attributes="0"/> + <Component id="btAtualizar" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="66" max="-2" attributes="0"/> + <Component id="btExcluir" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="187" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace pref="52" max="32767" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btExcluir" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btAtualizar" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="tbSalvar" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="24" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JButton" name="btExcluir"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Lucida Grande" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Excluir"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btExcluirActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="tbSalvar"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Lucida Grande" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Salvar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tbSalvarActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btAtualizar"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Lucida Grande" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Atualizar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btAtualizarActionPerformed"/> + </Events> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/src/main/java/br/edu/ifb/telas/Home.java b/src/main/java/br/edu/ifb/telas/Home.java new file mode 100644 index 0000000..82a8d97 --- /dev/null +++ b/src/main/java/br/edu/ifb/telas/Home.java @@ -0,0 +1,424 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template + */ +package br.edu.ifb.telas; + +import br.edu.ifb.DAO.ContatoDAO; +import br.edu.ifb.classes.Contato; +import javax.swing.JOptionPane; +import javax.swing.table.DefaultTableModel; + +/** + * + * @author dariopintor + */ +public class Home extends javax.swing.JFrame { + + /** + * Creates new form Home + */ + private int idUsuario=1; + public Home() { + initComponents(); + preencheTabela(); + } + + /** + * 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() { + + jPanel1 = new javax.swing.JPanel(); + jPanel2 = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + txtTelefone = new javax.swing.JTextField(); + txtNascimento = new javax.swing.JTextField(); + txtNome = new javax.swing.JTextField(); + jLabel4 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + txtEmail = new javax.swing.JTextField(); + jPanel3 = new javax.swing.JPanel(); + jScrollPane1 = new javax.swing.JScrollPane(); + tbTabela = new javax.swing.JTable(); + jPanel4 = new javax.swing.JPanel(); + btExcluir = new javax.swing.JButton(); + tbSalvar = new javax.swing.JButton(); + btAtualizar = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + setTitle("Tela inicial"); + + jPanel2.setBackground(new java.awt.Color(204, 255, 255)); + + jLabel1.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + jLabel1.setText("Telefone"); + + jLabel2.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + jLabel2.setText("Nome"); + + jLabel3.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + jLabel3.setText("Email"); + + txtTelefone.setBackground(new java.awt.Color(204, 204, 204)); + txtTelefone.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + + txtNascimento.setBackground(new java.awt.Color(204, 204, 204)); + txtNascimento.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + + txtNome.setBackground(new java.awt.Color(204, 204, 204)); + txtNome.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + + jLabel4.setText("Minha Agenda "); + + jLabel5.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + jLabel5.setText("Nascimento"); + + txtEmail.setBackground(new java.awt.Color(204, 204, 204)); + txtEmail.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1) + .addComponent(jLabel2) + .addComponent(jLabel3)) + .addGap(42, 42, 42) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(txtNome, javax.swing.GroupLayout.DEFAULT_SIZE, 281, Short.MAX_VALUE) + .addComponent(txtEmail) + .addComponent(txtTelefone)) + .addGap(259, 259, 259)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel5) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtNascimento, javax.swing.GroupLayout.PREFERRED_SIZE, 281, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(198, 198, 198) + .addComponent(jLabel4))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel4) + .addGap(58, 58, 58) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel2)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(txtTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel3) + .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel5) + .addComponent(txtNascimento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(129, Short.MAX_VALUE)) + ); + + jPanel3.setBackground(new java.awt.Color(204, 255, 255)); + + tbTabela.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "ID", "Nome", "Telefone", "Email", "Nascimento" + } + ) { + boolean[] canEdit = new boolean [] { + false, true, true, true, true + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + tbTabela.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tbTabelaMouseClicked(evt); + } + }); + jScrollPane1.setViewportView(tbTabela); + if (tbTabela.getColumnModel().getColumnCount() > 0) { + tbTabela.getColumnModel().getColumn(0).setResizable(false); + } + + javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); + jPanel3.setLayout(jPanel3Layout); + jPanel3Layout.setHorizontalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 505, Short.MAX_VALUE)) + ); + jPanel3Layout.setVerticalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) + .addContainerGap()) + ); + + jPanel4.setBackground(new java.awt.Color(204, 255, 255)); + + btExcluir.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + btExcluir.setText("Excluir"); + btExcluir.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btExcluirActionPerformed(evt); + } + }); + + tbSalvar.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + tbSalvar.setText("Salvar"); + tbSalvar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + tbSalvarActionPerformed(evt); + } + }); + + btAtualizar.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + btAtualizar.setText("Atualizar"); + btAtualizar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btAtualizarActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); + jPanel4.setLayout(jPanel4Layout); + jPanel4Layout.setHorizontalGroup( + jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() + .addContainerGap(292, Short.MAX_VALUE) + .addComponent(tbSalvar) + .addGap(57, 57, 57) + .addComponent(btAtualizar) + .addGap(66, 66, 66) + .addComponent(btExcluir) + .addGap(187, 187, 187)) + ); + jPanel4Layout.setVerticalGroup( + jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() + .addContainerGap(52, Short.MAX_VALUE) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btExcluir) + .addComponent(btAtualizar) + .addComponent(tbSalvar)) + .addGap(24, 24, 24)) + ); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE)) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + public void preencheTabela(){ + DefaultTableModel modelo = (DefaultTableModel) tbTabela.getModel(); + modelo.setNumRows(0); + ContatoDAO cdao = new ContatoDAO(); + + for (Contato c: cdao.lerBanco()) { + + modelo.addRow(new Object[]{ + c.getId(), + c.getNome(), + c.getTelefone(), + c.getEmail(), + c.getDataAniversario()}); + + } + } + + private void btExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btExcluirActionPerformed + // TODO add your handling code here: + DefaultTableModel tbModel = (DefaultTableModel) tbTabela.getModel(); + Contato c = new Contato(); + ContatoDAO cdao= new ContatoDAO(); + + if(tbTabela.getSelectedRow() != -1){ + c.setId((int)tbTabela.getValueAt(tbTabela.getSelectedRow(), 0)); + c.setIdUsuario(idUsuario); + cdao.deletarNoBanco(c); + preencheTabela(); + + }else{ + JOptionPane.showMessageDialog(null,"Selecione uma alinha para excluir"); + } + + + +// Cliente cliente = new Cliente(0, Integer.parseInt(this.txtIdade.getText()), this.txtNome.getText(), this.txtCep.getText(), this.txtLogradouro.getText(), this.txtNumero.getText(), this.txtBairro.getText(), this.txtCidade.getText(), "SP"); +// ClienteDAO insert = new ClienteDAO(); +// insert.inseri r(cliente); +// MetodosGerais.limparCampos(this); +// this.preencherTabela(); + }//GEN-LAST:event_btExcluirActionPerformed + + private void tbSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbSalvarActionPerformed + // TODO add your handling code here: + //pequeno teste + Contato c = new Contato(); + ContatoDAO cdao= new ContatoDAO(); + c.setIdUsuario(idUsuario); + c.setNome(txtNome.getText()); + c.setTelefone(txtTelefone.getText()); + c.setEmail(txtEmail.getText()); + c.setDataAniversario(txtNascimento.getText()); + cdao.inserirBanco(c); + preencheTabela(); + txtNome.setText(""); + txtTelefone.setText(""); + txtEmail.setText(""); + txtNascimento.setText(""); + + + +// DefaultTableModel tbModel = (DefaultTableModel) tbTabela.getModel(); +// tbModel.addRow( new Object[] {txtNome.getText(), +// txtTelefone.getText(),txtEmail.getText(), +// txtNascimento.getText() }); + + }//GEN-LAST:event_tbSalvarActionPerformed + + private void btAtualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btAtualizarActionPerformed + // TODO add your handling code here: + if(tbTabela.getSelectedRow() != -1){ + Contato c = new Contato(); + ContatoDAO cdao= new ContatoDAO(); + c.setId((int)tbTabela.getValueAt(tbTabela.getSelectedRow(), 0)); + c.setNome(txtNome.getText()); + c.setTelefone(txtTelefone.getText()); + c.setEmail(txtEmail.getText()); + c.setDataAniversario(txtNascimento.getText()); + cdao.atualizarBanco(c); + preencheTabela(); + txtNome.setText(""); + txtTelefone.setText(""); + txtEmail.setText(""); + txtNascimento.setText(""); + }else { + JOptionPane.showMessageDialog(null,"Selecione uma alinha para atualizar"); + } + }//GEN-LAST:event_btAtualizarActionPerformed + + private void tbTabelaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tbTabelaMouseClicked + // TODO add your handling code here: + txtNome.setText(tbTabela.getValueAt(tbTabela.getSelectedRow(), 1).toString()); + txtTelefone.setText(tbTabela.getValueAt(tbTabela.getSelectedRow(), 2).toString()); + txtEmail.setText(tbTabela.getValueAt(tbTabela.getSelectedRow(), 3).toString()); + txtNascimento.setText(tbTabela.getValueAt(tbTabela.getSelectedRow(), 4).toString()); + + + }//GEN-LAST:event_tbTabelaMouseClicked + + /** + * @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 ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new Home().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton btAtualizar; + private javax.swing.JButton btExcluir; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel3; + private javax.swing.JPanel jPanel4; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JButton tbSalvar; + private javax.swing.JTable tbTabela; + private javax.swing.JTextField txtEmail; + private javax.swing.JTextField txtNascimento; + private javax.swing.JTextField txtNome; + private javax.swing.JTextField txtTelefone; + // End of variables declaration//GEN-END:variables +} diff --git a/src/main/java/br/edu/ifb/telas/Login.form b/src/main/java/br/edu/ifb/telas/Login.form new file mode 100644 index 0000000..15e2320 --- /dev/null +++ b/src/main/java/br/edu/ifb/telas/Login.form @@ -0,0 +1,130 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="170" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jBEntrar" min="-2" max="-2" attributes="0"/> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="18" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="33" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="jTNome" pref="198" max="32767" attributes="0"/> + <Component id="jPSenha" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace pref="126" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="-2" pref="39" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jTNome" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jPSenha" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="50" max="32767" attributes="0"/> + <Component id="jBEntrar" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="65" max="-2" attributes="0"/> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Lucida Grande" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Usuário"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTNome"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="cc" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Lucida Grande" size="24" style="0"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Lucida Grande" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Senha"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jBEntrar"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Lucida Grande" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Entrar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jBEntrarActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="text" type="java.lang.String" value="Primeiro acesso?"/> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jLabel3MouseClicked"/> + </Events> + </Component> + <Component class="javax.swing.JPasswordField" name="jPSenha"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="cc" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Lucida Grande" size="24" style="0"/> + </Property> + </Properties> + </Component> + </SubComponents> +</Form> diff --git a/src/main/java/br/edu/ifb/telas/Login.java b/src/main/java/br/edu/ifb/telas/Login.java new file mode 100644 index 0000000..00b1d7e --- /dev/null +++ b/src/main/java/br/edu/ifb/telas/Login.java @@ -0,0 +1,180 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template + */ +package br.edu.ifb.telas; + +import javax.swing.JOptionPane; + +/** + * + * @author dariopintor + */ +public class Login extends javax.swing.JFrame { + + /** + * Creates new form Login + */ + public Login() { + initComponents(); + } + + /** + * 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() { + + jLabel2 = new javax.swing.JLabel(); + jTNome = new javax.swing.JTextField(); + jLabel1 = new javax.swing.JLabel(); + jBEntrar = new javax.swing.JButton(); + jLabel3 = new javax.swing.JLabel(); + jPSenha = new javax.swing.JPasswordField(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + + jLabel2.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + jLabel2.setText("Usuário"); + + jTNome.setBackground(new java.awt.Color(204, 204, 204)); + jTNome.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + + jLabel1.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + jLabel1.setText("Senha"); + + jBEntrar.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + jBEntrar.setText("Entrar"); + jBEntrar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jBEntrarActionPerformed(evt); + } + }); + + jLabel3.setText("Primeiro acesso?"); + jLabel3.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jLabel3MouseClicked(evt); + } + }); + + jPSenha.setBackground(new java.awt.Color(204, 204, 204)); + jPSenha.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(170, 170, 170) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jBEntrar) + .addComponent(jLabel3))) + .addGroup(layout.createSequentialGroup() + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1) + .addComponent(jLabel2)) + .addGap(33, 33, 33) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jTNome, javax.swing.GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE) + .addComponent(jPSenha)))) + .addContainerGap(126, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGap(39, 39, 39) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jTNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel2)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(jPSenha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 50, Short.MAX_VALUE) + .addComponent(jBEntrar) + .addGap(65, 65, 65) + .addComponent(jLabel3)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void jBEntrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBEntrarActionPerformed + // TODO add your handling code here: + String nome; + String senha; + String email; + + nome = jTNome.getText(); + senha = jPSenha.getText(); + if(nome.equals("a")&&senha.equals("1")){ + Home frameHome = new Home(); + frameHome.setVisible(true); + dispose(); + } else{ + JOptionPane.showMessageDialog(null, "Usuário ou senha incorretos"); + + } + + + + }//GEN-LAST:event_jBEntrarActionPerformed + + private void jLabel3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel3MouseClicked + // TODO add your handling code here: + Registrar frameRegistrar = new Registrar (Login.this); + setVisible(false); + frameRegistrar.setVisible(true); + }//GEN-LAST:event_jLabel3MouseClicked + + /** + * @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 ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new Login().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jBEntrar; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JPasswordField jPSenha; + private javax.swing.JTextField jTNome; + // End of variables declaration//GEN-END:variables +} diff --git a/src/main/java/br/edu/ifb/telas/Registrar.form b/src/main/java/br/edu/ifb/telas/Registrar.form new file mode 100644 index 0000000..3d83956 --- /dev/null +++ b/src/main/java/br/edu/ifb/telas/Registrar.form @@ -0,0 +1,186 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jPanel1" alignment="0" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jPanel1" alignment="0" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel1"> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jPanel2" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jPanel2" alignment="0" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel2"> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="26" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="33" max="-2" attributes="0"/> + <Component id="jTTelefone1" min="-2" pref="198" max="-2" attributes="0"/> + </Group> + <Group type="103" alignment="1" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="jTNome" min="-2" pref="198" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="33" max="-2" attributes="0"/> + <Component id="jTTelefone" min="-2" pref="198" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace pref="37" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="172" max="-2" attributes="0"/> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="58" pref="195" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="-2" pref="67" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jTNome" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jTTelefone" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTTelefone1" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="55" max="32767" attributes="0"/> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="38" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Lucida Grande" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="OK"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Lucida Grande" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Email"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTNome"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="cc" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Lucida Grande" size="24" style="0"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Lucida Grande" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Senha"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTTelefone"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="cc" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Lucida Grande" size="24" style="0"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Lucida Grande" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Repitir senha"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTTelefone1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="cc" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Lucida Grande" size="24" style="0"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/src/main/java/br/edu/ifb/telas/Registrar.java b/src/main/java/br/edu/ifb/telas/Registrar.java new file mode 100644 index 0000000..161ff57 --- /dev/null +++ b/src/main/java/br/edu/ifb/telas/Registrar.java @@ -0,0 +1,199 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template + */ +package br.edu.ifb.telas; + +/** + * + * @author dariopintor + */ +public class Registrar extends javax.swing.JFrame { + private Login login; + /** + * Creates new form Registrar + */ + public Registrar(Login login) { + this.login = login; + initComponents(); + } + + public Registrar() { + initComponents(); + } + + /** + * 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() { + + jPanel1 = new javax.swing.JPanel(); + jPanel2 = new javax.swing.JPanel(); + jButton1 = new javax.swing.JButton(); + jLabel2 = new javax.swing.JLabel(); + jTNome = new javax.swing.JTextField(); + jLabel1 = new javax.swing.JLabel(); + jTTelefone = new javax.swing.JTextField(); + jLabel3 = new javax.swing.JLabel(); + jTTelefone1 = new javax.swing.JTextField(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + + jButton1.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + jButton1.setText("OK"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + jLabel2.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + jLabel2.setText("Email"); + + jTNome.setBackground(new java.awt.Color(204, 204, 204)); + jTNome.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + + jLabel1.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + jLabel1.setText("Senha"); + + jTTelefone.setBackground(new java.awt.Color(204, 204, 204)); + jTTelefone.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + + jLabel3.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + jLabel3.setText("Repitir senha"); + + jTTelefone1.setBackground(new java.awt.Color(204, 204, 204)); + jTTelefone1.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N + + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(26, 26, 26) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(jLabel3) + .addGap(33, 33, 33) + .addComponent(jTTelefone1, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(jLabel2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jTNome, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(jLabel1) + .addGap(33, 33, 33) + .addComponent(jTTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addContainerGap(37, Short.MAX_VALUE)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(172, 172, 172) + .addComponent(jButton1) + .addGap(58, 195, Short.MAX_VALUE)) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() + .addGap(67, 67, 67) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jTNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel2)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jTTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel1)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel3) + .addComponent(jTTelefone1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 55, Short.MAX_VALUE) + .addComponent(jButton1) + .addGap(38, 38, 38)) + ); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + // TODO add your handling code here: + + setVisible(false); + login.setVisible(true); + }//GEN-LAST:event_jButton1ActionPerformed + + /** + * @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 ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(Registrar.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(Registrar.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(Registrar.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(Registrar.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new Registrar().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JTextField jTNome; + private javax.swing.JTextField jTTelefone; + private javax.swing.JTextField jTTelefone1; + // End of variables declaration//GEN-END:variables +} diff --git a/target/classes/.netbeans_automatic_build b/target/classes/.netbeans_automatic_build new file mode 100644 index 0000000..e69de29 diff --git a/target/classes/br/edu/ifb/DAO/ContatoDAO.class b/target/classes/br/edu/ifb/DAO/ContatoDAO.class new file mode 100644 index 0000000..3ba6e17 Binary files /dev/null and b/target/classes/br/edu/ifb/DAO/ContatoDAO.class differ diff --git a/target/classes/br/edu/ifb/DAO/LoginDAO.class b/target/classes/br/edu/ifb/DAO/LoginDAO.class new file mode 100644 index 0000000..c3b358d Binary files /dev/null and b/target/classes/br/edu/ifb/DAO/LoginDAO.class differ diff --git a/target/classes/br/edu/ifb/DAO/RegistrarDAO.class b/target/classes/br/edu/ifb/DAO/RegistrarDAO.class new file mode 100644 index 0000000..400bb71 Binary files /dev/null and b/target/classes/br/edu/ifb/DAO/RegistrarDAO.class differ diff --git a/target/classes/br/edu/ifb/DAO/UsuarioDAO.class b/target/classes/br/edu/ifb/DAO/UsuarioDAO.class new file mode 100644 index 0000000..1590bb2 Binary files /dev/null and b/target/classes/br/edu/ifb/DAO/UsuarioDAO.class differ diff --git a/target/classes/br/edu/ifb/classes/Contato.class b/target/classes/br/edu/ifb/classes/Contato.class new file mode 100644 index 0000000..974436e Binary files /dev/null and b/target/classes/br/edu/ifb/classes/Contato.class differ diff --git a/target/classes/br/edu/ifb/classes/Login.class b/target/classes/br/edu/ifb/classes/Login.class new file mode 100644 index 0000000..7273a19 Binary files /dev/null and b/target/classes/br/edu/ifb/classes/Login.class differ diff --git a/target/classes/br/edu/ifb/classes/Registrar.class b/target/classes/br/edu/ifb/classes/Registrar.class new file mode 100644 index 0000000..d23b1ab Binary files /dev/null and b/target/classes/br/edu/ifb/classes/Registrar.class differ diff --git a/target/classes/br/edu/ifb/classes/Usuario.class b/target/classes/br/edu/ifb/classes/Usuario.class new file mode 100644 index 0000000..e710e5b Binary files /dev/null and b/target/classes/br/edu/ifb/classes/Usuario.class differ diff --git a/target/classes/br/edu/ifb/conexao/Conexao.class b/target/classes/br/edu/ifb/conexao/Conexao.class new file mode 100644 index 0000000..bb42fbf Binary files /dev/null and b/target/classes/br/edu/ifb/conexao/Conexao.class differ diff --git a/target/classes/br/edu/ifb/telas/Home$1.class b/target/classes/br/edu/ifb/telas/Home$1.class new file mode 100644 index 0000000..af1bb61 Binary files /dev/null and b/target/classes/br/edu/ifb/telas/Home$1.class differ diff --git a/target/classes/br/edu/ifb/telas/Home$2.class b/target/classes/br/edu/ifb/telas/Home$2.class new file mode 100644 index 0000000..11d2461 Binary files /dev/null and b/target/classes/br/edu/ifb/telas/Home$2.class differ diff --git a/target/classes/br/edu/ifb/telas/Home$3.class b/target/classes/br/edu/ifb/telas/Home$3.class new file mode 100644 index 0000000..15bed26 Binary files /dev/null and b/target/classes/br/edu/ifb/telas/Home$3.class differ diff --git a/target/classes/br/edu/ifb/telas/Home$4.class b/target/classes/br/edu/ifb/telas/Home$4.class new file mode 100644 index 0000000..b0302b3 Binary files /dev/null and b/target/classes/br/edu/ifb/telas/Home$4.class differ diff --git a/target/classes/br/edu/ifb/telas/Home$5.class b/target/classes/br/edu/ifb/telas/Home$5.class new file mode 100644 index 0000000..07250fb Binary files /dev/null and b/target/classes/br/edu/ifb/telas/Home$5.class differ diff --git a/target/classes/br/edu/ifb/telas/Home$6.class b/target/classes/br/edu/ifb/telas/Home$6.class new file mode 100644 index 0000000..581daf9 Binary files /dev/null and b/target/classes/br/edu/ifb/telas/Home$6.class differ diff --git a/target/classes/br/edu/ifb/telas/Home.class b/target/classes/br/edu/ifb/telas/Home.class new file mode 100644 index 0000000..dd4c197 Binary files /dev/null and b/target/classes/br/edu/ifb/telas/Home.class differ diff --git a/target/classes/br/edu/ifb/telas/Login$1.class b/target/classes/br/edu/ifb/telas/Login$1.class new file mode 100644 index 0000000..de57ed7 Binary files /dev/null and b/target/classes/br/edu/ifb/telas/Login$1.class differ diff --git a/target/classes/br/edu/ifb/telas/Login$2.class b/target/classes/br/edu/ifb/telas/Login$2.class new file mode 100644 index 0000000..e555ae2 Binary files /dev/null and b/target/classes/br/edu/ifb/telas/Login$2.class differ diff --git a/target/classes/br/edu/ifb/telas/Login$3.class b/target/classes/br/edu/ifb/telas/Login$3.class new file mode 100644 index 0000000..0948d95 Binary files /dev/null and b/target/classes/br/edu/ifb/telas/Login$3.class differ diff --git a/target/classes/br/edu/ifb/telas/Login.class b/target/classes/br/edu/ifb/telas/Login.class new file mode 100644 index 0000000..9f294ae Binary files /dev/null and b/target/classes/br/edu/ifb/telas/Login.class differ diff --git a/target/classes/br/edu/ifb/telas/Registrar$1.class b/target/classes/br/edu/ifb/telas/Registrar$1.class new file mode 100644 index 0000000..766625c Binary files /dev/null and b/target/classes/br/edu/ifb/telas/Registrar$1.class differ diff --git a/target/classes/br/edu/ifb/telas/Registrar$2.class b/target/classes/br/edu/ifb/telas/Registrar$2.class new file mode 100644 index 0000000..27f762f Binary files /dev/null and b/target/classes/br/edu/ifb/telas/Registrar$2.class differ diff --git a/target/classes/br/edu/ifb/telas/Registrar.class b/target/classes/br/edu/ifb/telas/Registrar.class new file mode 100644 index 0000000..8dd2a18 Binary files /dev/null and b/target/classes/br/edu/ifb/telas/Registrar.class differ diff --git a/target/classes/ifb1/javainterface/Home$1.class b/target/classes/ifb1/javainterface/Home$1.class index 1892e5c..182be56 100644 Binary files a/target/classes/ifb1/javainterface/Home$1.class and b/target/classes/ifb1/javainterface/Home$1.class differ diff --git a/target/classes/ifb1/javainterface/Home.class b/target/classes/ifb1/javainterface/Home.class index 5174c36..47bd334 100644 Binary files a/target/classes/ifb1/javainterface/Home.class and b/target/classes/ifb1/javainterface/Home.class differ diff --git a/target/classes/ifb1/javainterface/Login$1.class b/target/classes/ifb1/javainterface/Login$1.class index 7279ea1..897f1bb 100644 Binary files a/target/classes/ifb1/javainterface/Login$1.class and b/target/classes/ifb1/javainterface/Login$1.class differ diff --git a/target/classes/ifb1/javainterface/Login$2.class b/target/classes/ifb1/javainterface/Login$2.class index 3103c5c..4d2e1b6 100644 Binary files a/target/classes/ifb1/javainterface/Login$2.class and b/target/classes/ifb1/javainterface/Login$2.class differ diff --git a/target/classes/ifb1/javainterface/Login.class b/target/classes/ifb1/javainterface/Login.class index 6ef928d..243df22 100644 Binary files a/target/classes/ifb1/javainterface/Login.class and b/target/classes/ifb1/javainterface/Login.class differ diff --git a/target/classes/ifb1/javainterface/Registrar$1.class b/target/classes/ifb1/javainterface/Registrar$1.class index fe35fed..ed9e452 100644 Binary files a/target/classes/ifb1/javainterface/Registrar$1.class and b/target/classes/ifb1/javainterface/Registrar$1.class differ diff --git a/target/classes/ifb1/javainterface/Registrar.class b/target/classes/ifb1/javainterface/Registrar.class index 5902933..a289100 100644 Binary files a/target/classes/ifb1/javainterface/Registrar.class and b/target/classes/ifb1/javainterface/Registrar.class differ diff --git a/target/javaInterface-1.0-SNAPSHOT.jar b/target/javaInterface-1.0-SNAPSHOT.jar new file mode 100644 index 0000000..e608395 Binary files /dev/null and b/target/javaInterface-1.0-SNAPSHOT.jar differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties new file mode 100644 index 0000000..e42fc5d --- /dev/null +++ b/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Mon Jun 24 16:50:19 BRT 2024 +artifactId=javaInterface +groupId=ifb1 +version=1.0-SNAPSHOT diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst index 646e23a..78cf189 100644 --- a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -1,2 +1,33 @@ +br/edu/ifb/DAO/ContatoDAO.class +br/edu/ifb/DAO/UsuarioDAO.class +br/edu/ifb/classes/Registrar.class +br/edu/ifb/telas/Home$5.class +br/edu/ifb/classes/Contato.class +br/edu/ifb/telas/Home.class +ifb1/javainterface/Login$2.class +br/edu/ifb/telas/Home$3.class +br/edu/ifb/telas/Login$3.class ifb1/javainterface/Home$1.class +ifb1/javainterface/Login.class +br/edu/ifb/classes/Login.class +br/edu/ifb/telas/Home$1.class +ifb1/javainterface/Registrar$1.class +br/edu/ifb/telas/Login$1.class +ifb1/javainterface/Registrar.class +br/edu/ifb/telas/Home$6.class +br/edu/ifb/telas/Login.class +br/edu/ifb/DAO/LoginDAO.class +br/edu/ifb/DAO/RegistrarDAO.class +br/edu/ifb/telas/Registrar$2.class ifb1/javainterface/Home.class +br/edu/ifb/classes/Usuario.class +br/edu/ifb/telas/Home$4.class +br/edu/ifb/conexao/Conexao.class +ifb1/javainterface/Registrar$2.class +br/edu/ifb/telas/Home$2.class +ifb1/javainterface/Login$1.class +br/edu/ifb/telas/Registrar.class +ifb1/javainterface/Login$3.class +br/edu/ifb/telas/Login$2.class +ifb1/javainterface/Home$2.class +br/edu/ifb/telas/Registrar$1.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst index 286c003..f4a525c 100644 --- a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -1 +1,15 @@ -/Users/dariopintor/NetBeansProjects/javaInterface/src/main/java/ifb1/javainterface/Home.java +/Users/dariopintor/Desktop/javaInterface-master 2/src/main/java/br/edu/ifb/classes/Login.java +/Users/dariopintor/Desktop/javaInterface-master 2/src/main/java/ifb1/javainterface/Home.java +/Users/dariopintor/Desktop/javaInterface-master 2/src/main/java/br/edu/ifb/telas/Home.java +/Users/dariopintor/Desktop/javaInterface-master 2/src/main/java/br/edu/ifb/classes/Registrar.java +/Users/dariopintor/Desktop/javaInterface-master 2/src/main/java/br/edu/ifb/DAO/RegistrarDAO.java +/Users/dariopintor/Desktop/javaInterface-master 2/src/main/java/ifb1/javainterface/Registrar.java +/Users/dariopintor/Desktop/javaInterface-master 2/src/main/java/br/edu/ifb/classes/Usuario.java +/Users/dariopintor/Desktop/javaInterface-master 2/src/main/java/br/edu/ifb/DAO/ContatoDAO.java +/Users/dariopintor/Desktop/javaInterface-master 2/src/main/java/br/edu/ifb/telas/Registrar.java +/Users/dariopintor/Desktop/javaInterface-master 2/src/main/java/br/edu/ifb/DAO/UsuarioDAO.java +/Users/dariopintor/Desktop/javaInterface-master 2/src/main/java/br/edu/ifb/DAO/LoginDAO.java +/Users/dariopintor/Desktop/javaInterface-master 2/src/main/java/ifb1/javainterface/Login.java +/Users/dariopintor/Desktop/javaInterface-master 2/src/main/java/br/edu/ifb/classes/Contato.java +/Users/dariopintor/Desktop/javaInterface-master 2/src/main/java/br/edu/ifb/telas/Login.java +/Users/dariopintor/Desktop/javaInterface-master 2/src/main/java/br/edu/ifb/conexao/Conexao.java diff --git a/target/test-classes/.netbeans_automatic_build b/target/test-classes/.netbeans_automatic_build new file mode 100644 index 0000000..e69de29