copiado do note - diretorio de projeto desktop do netbenas

This commit is contained in:
2021-10-24 01:13:25 -03:00
commit 677cec6fed
508 changed files with 30644 additions and 0 deletions
+70
View File
@@ -0,0 +1,70 @@
/*
* PARG Desenvolvimento de Sistemas
* Pablo Alexander - pablo@parg.com.br
*
* Obtem um CEP no ViaCEP
*/
package br.com.parg.viacep;
/**
* Define um CEP
* @author PABLO
*/
public class CEP {
// pripriedades do CEP
public String CEP;
public String Logradouro;
public String Complemento;
public String Bairro;
public String Localidade;
public String Uf;
public String Ibge;
public String Gia;
/**
* Cria um novo CEP vazio
*/
public CEP() {
this.Logradouro = null;
this.Complemento = null;
this.Bairro = null;
this.Localidade = null;
this.Uf = null;
this.Ibge = null;
this.Gia = null;
}
/**
* Cria um novo CEP completo
* @param CEP
* @param Logradouro
* @param Complemento
* @param Bairro
* @param Localidade
* @param Uf
* @param Ibge
* @param Gia
*/
public CEP(String CEP, String Logradouro, String Complemento, String Bairro, String Localidade, String Uf, String Ibge, String Gia) {
this.CEP = CEP;
this.Logradouro = Logradouro;
this.Complemento = Complemento;
this.Bairro = Bairro;
this.Localidade = Localidade;
this.Uf = Uf;
this.Ibge = Ibge;
this.Gia = Gia;
}
/**
* Cria um novo CEP parcial
* @param Logradouro
* @param Localidade
* @param Uf
*/
public CEP(String Logradouro, String Localidade, String Uf) {
this.Logradouro = Logradouro;
this.Localidade = Localidade;
this.Uf = Uf;
}
}
+188
View File
@@ -0,0 +1,188 @@
/*
* PARG Desenvolvimento de Sistemas
* Pablo Alexander - pablo@parg.com.br
*
* Obtem um CEP no ViaCEP
*/
package br.com.parg.viacep;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/**
* Classe java para obter um CEP no ViaCEP
*
* @author Pablo Alexander da Rocha Gonçalves
*/
public class ViaCEP extends ViaCEPBase {
// constantes
public static final double VIACEP_VERSAO = 0.33;
/**
* Constrói uma nova classe
*/
public ViaCEP() {
super();
}
/**
* Constrói uma nova classe
*
* @param events eventos para a classe
*/
public ViaCEP(ViaCEPEvents events) {
super();
this.Events = events;
}
/**
* Constrói uma nova classe e busca um CEP no ViaCEP
*
* @param events eventos para a classe
* @param cep
* @throws br.com.parg.viacep.ViaCEPException caso ocorra algum erro
*/
public ViaCEP(String cep, ViaCEPEvents events) throws ViaCEPException {
super();
this.Events = events;
this.buscar(cep);
}
/**
* Constrói uma nova classe e busca um CEP no ViaCEP
*
* @param cep
* @throws br.com.parg.viacep.ViaCEPException caso ocorra algum erro
*/
public ViaCEP(String cep) throws ViaCEPException {
super();
this.buscar(cep);
}
/**
* Busca um CEP no ViaCEP
*
* @param cep
* @throws br.com.parg.viacep.ViaCEPException caso ocorra algum erro
*/
@Override
public final void buscar(String cep) throws ViaCEPException {
try {
// define o cep atual
currentCEP = cep;
// define a url
String url = "http://viacep.com.br/ws/" + cep + "/json/";
// define os dados
JSONObject obj = new JSONObject(getHttpGET(url));
if (!obj.has("erro")) {
CEP novoCEP = new CEP(obj.getString("cep"),
obj.getString("logradouro"),
obj.getString("complemento"),
obj.getString("bairro"),
obj.getString("localidade"),
obj.getString("uf"),
obj.getString("ibge"),
obj.getString("gia"));
// insere o novo CEP
CEPs.add(novoCEP);
// atualiza o index
index = CEPs.size() - 1;
// verifica os Eventos
if (Events instanceof ViaCEPEvents) {
Events.onCEPSuccess(this);
}
} else {
// verifica os Eventos
if (Events instanceof ViaCEPEvents) {
Events.onCEPError(currentCEP);
}
throw new ViaCEPException("Não foi possível encontrar o CEP", cep, ViaCEPException.class.getName());
}
} catch (JSONException ex) {
Logger.getLogger(ViaCEP.class.getName()).log(Level.SEVERE, null, ex);
}
}
/**
* Busca um CEP usando um endereço
*
* @param cep classe CEP com uf, localidade, logradouro
* @throws ViaCEPException
*/
@Override
public void buscarCEP(CEP cep) throws ViaCEPException {
buscarCEP(cep.Uf, cep.Localidade, cep.Logradouro);
}
/**
* Busca um CEP usando um endereço
*
* @param Uf Estado
* @param Localidade Municipio
* @param Logradouro Rua, Avenidade, Viela...
* @throws ViaCEPException
*/
@Override
public void buscarCEP(String Uf, String Localidade, String Logradouro) throws ViaCEPException {
try {
// define o cep atual
currentCEP = "?????-???";
// define a url
String url = "http://viacep.com.br/ws/" + Uf.toUpperCase() + "/" + Localidade + "/" + Logradouro + "/json/";
// obtem a lista de CEP's
JSONArray ceps = new JSONArray(getHttpGET(url));
if (ceps.length() > 0) {
for (int i = 0; i < ceps.length(); i++) {
JSONObject obj = ceps.getJSONObject(i);
if (!obj.has("erro")) {
CEP novoCEP = new CEP(obj.getString("cep"),
obj.getString("logradouro"),
obj.getString("complemento"),
obj.getString("bairro"),
obj.getString("localidade"),
obj.getString("uf"),
obj.getString("ibge"),
obj.getString("gia"));
// insere o novo CEP
CEPs.add(novoCEP);
// atualiza o index
index = CEPs.size() - 1;
// verifica os Eventos
if (Events instanceof ViaCEPEvents) {
Events.onCEPSuccess(this);
}
} else {
// verifica os Eventos
if (Events instanceof ViaCEPEvents) {
Events.onCEPError(currentCEP);
}
throw new ViaCEPException("Não foi possível validar o CEP", currentCEP, ViaCEPException.class.getName());
}
}
} else {
throw new ViaCEPException("Nenhum CEP encontrado", currentCEP, getClass().getName());
}
} catch (JSONException ex) {
Logger.getLogger(ViaCEP.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
+286
View File
@@ -0,0 +1,286 @@
/*
* PARG Desenvolvimento de Sistemas
* Pablo Alexander - pablo@parg.com.br
*
* Obtem um CEP no ViaCEP
*/
package br.com.parg.viacep;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* Serve como base para a classe ViaCEP
* @author PABLO
*/
public abstract class ViaCEPBase {
// pripriedades do CEP
protected List<CEP> CEPs;
protected int index;
protected String currentCEP;
// váriaveis internas
protected ViaCEPEvents Events;
public ViaCEPBase () {
CEPs = new ArrayList<>();
index = -1;
currentCEP = "00000-000";
this.Events = null;
}
// métodos abstratos
public abstract void buscar(String cep) throws ViaCEPException;
public abstract void buscarCEP(CEP cep) throws ViaCEPException;
/**
* Busca um CEP usando um endereço
* @param Uf estado
* @param Localidade cidade
* @param Logradouro nome ou parte do nome da rua, av, viela...
* @throws br.com.parg.viacep.ViaCEPException
*/
public void buscarCEP(String Uf, String Localidade, String Logradouro) throws ViaCEPException {
buscarCEP(new CEP(Logradouro, Localidade, Uf));
}
/**
* Retona o index atual;
* @return
*/
public int getIndex() {
return index;
}
/**
* Retorna o total de CEP's
* @return
*/
public int getSize() {
return CEPs.size();
}
/**
* Retonar o CEP
*
* @return
*/
public String getCep() {
return CEPs.get(index).CEP;
}
/**
* Retorna o nome da rua, avenida, travessa, ...
*
* @return
*/
public String getLogradouro() {
return CEPs.get(index).Logradouro;
}
/**
* Retorna se tem algum complemento Ex: lado impar
*
* @return
*/
public String getComplemento() {
return CEPs.get(index).Complemento;
}
/**
* Retorna o Bairro
*
* @return
*/
public String getBairro() {
return CEPs.get(index).Bairro;
}
/**
* Retorna a Cidade
*
* @return
*/
public String getLocalidade() {
return CEPs.get(index).Localidade;
}
/**
* Retorna o UF
*
* @return
*/
public String getUf() {
return CEPs.get(index).Uf;
}
/**
* Retorna o Ibge
*
* @return
*/
public String getIbge() {
return CEPs.get(index).Ibge;
}
/**
* Retorna a Gia
*
* @return
*/
public String getGia() {
return CEPs.get(index).Gia;
}
/**
* Procedimento para obtem dados via GET
*
* @param urlToRead endereço
* @return conteúdo remoto
* @throws br.com.parg.viacep.ViaCEPException caso ocorra algum erro
*/
public final String getHttpGET(String urlToRead) throws ViaCEPException {
StringBuilder result = new StringBuilder();
try {
URL url = new URL(urlToRead);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
while ((line = rd.readLine()) != null) {
result.append(line);
}
} catch (MalformedURLException | ProtocolException ex) {
// verifica os Eventos
if (Events instanceof ViaCEPEvents) {
Events.onCEPError(currentCEP);
}
throw new ViaCEPException(ex.getMessage(), ex.getClass().getName());
} catch (IOException ex) {
// verifica os Eventos
if (Events instanceof ViaCEPEvents) {
Events.onCEPError(currentCEP);
}
throw new ViaCEPException(ex.getMessage(), ex.getClass().getName());
}
return result.toString();
}
/**
* Move para um registro específico
* @param index
* @return
*/
public boolean move(int index) {
if (CEPs.size() > 0 && index >= 0 && index < CEPs.size()) {
this.index = index;
return true;
}
this.index = -1;
return false;
}
/**
* Move para o primeiro registro
* @return
*/
public boolean moveFirst() {
if (CEPs.size() > 0) {
index = 0;
return true;
}
index = -1;
return false;
}
/**
* Move para o próximo registro
* @return
*/
public boolean moveNext() {
if (CEPs.size() > 0 && (index + 1) < CEPs.size()) {
index += 1;
return true;
}
index = -1;
return false;
}
/**
* Move para o registro anterior
* @return
*/
public boolean movePrevious() {
if (CEPs.size() > 0 && (index - 1) >= 0) {
index -= 1;
return true;
}
index = -1;
return false;
}
/**
* Move para o último registro
* @return
*/
public boolean moveLast() {
if (CEPs.size() > 0) {
index = CEPs.size() - 1;
return true;
}
index = -1;
return false;
}
/**
* Retorna a lista de CEP's
* @return
*/
public List<CEP> getList() {
return CEPs;
}
/**
* Procedimento para formatar uma string para usar em urls
* @param string texto que vai ser formatado
* @return texto formatado
* @throws ViaCEPException em caso de erro
*/
protected String formatStringToUri(String string) throws ViaCEPException {
String out = null;
// verifica está válido
if (string != null && !string.isEmpty()) {
try {
out = URLEncoder.encode(string, "utf-8");
out = out.replace("+", "%20"); // força espaço como %20
} catch (UnsupportedEncodingException e) {
throw new ViaCEPException("Não foi possível codificar o valor solicitado!", UnsupportedEncodingException.class.getName());
}
} else {
throw new ViaCEPException("Valor nulo ou vazio informado!", String.class.getName());
}
return out;
}
}
+26
View File
@@ -0,0 +1,26 @@
/*
* PARG Desenvolvimento de Sistemas
* Pablo Alexander - pablo@parg.com.br
*
* Obtem um CEP no ViaCEP
*/
package br.com.parg.viacep;
/**
* Interface para os eventos
*
* @author Pablo Alexander da Rocha Gonçalves
*/
public interface ViaCEPEvents {
/**
* Quando o CEP for encontrado com sucesso
* @param cep retorna o objeto ViaCEP
*/
public void onCEPSuccess(ViaCEP cep);
/**
* Quando ocorrer qualquer erro ao encontrar o CEP
* @param cep retorna o CEP que foi requisitado
*/
public void onCEPError(String cep);
}
@@ -0,0 +1,78 @@
/*
* PARG Desenvolvimento de Sistemas
* Pablo Alexander - pablo@parg.com.br
*
* Obtem um CEP no ViaCEP
*/
package br.com.parg.viacep;
/**
* Classe para registrar uma exceção de CEP
* @author Pablo Alexander da Rocha Gonçalves
*/
public class ViaCEPException extends Exception {
private String CEP;
private String Classe;
/**
* Gera uma nova exceção
*
* @param message descrição do erro
* @param classe classe da excessão original
*/
public ViaCEPException(String message, String classe) {
super(message);
this.CEP = "";
this.Classe = classe;
}
/**
* Gera uma nova exceção e define o CEP que foi solicitado
*
* @param message descrição do erro
* @param cep CEP que foi usado durante o processo
* @param classe classe da excessão original
*/
public ViaCEPException(String message, String cep, String classe) {
super(message);
this.CEP = cep;
this.Classe = classe;
}
/**
* Define o CEP da exceção
*
* @param cep
*/
public void setCEP(String cep) {
this.CEP = cep;
}
/**
* Retorna o CEP da exceção
*
* @return String CEP
*/
public String getCEP() {
return this.CEP;
}
/**
* Retorna se tem algum CEP
*
* @return boolean
*/
public boolean hasCEP() {
return !this.CEP.isEmpty();
}
/**
* Retorna a classe da excessão original
* @return
*/
public String getClasse() {
return Classe;
}
}
+462
View File
@@ -0,0 +1,462 @@
/*
* 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.
*/
package br.com.projeto.dao;
import br.com.projeto.jdbc.ConexaoBanco;
import br.com.projeto.model.Emprestimo;
import br.com.projeto.model.Funcionario;
import br.com.projeto.model.Livro;
import br.com.projeto.model.Usuario;
import com.mysql.jdbc.Connection;
import com.mysql.jdbc.PreparedStatement;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import javax.swing.JOptionPane;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class EmprestimoDao {
private Connection conexao;
//conexao
public EmprestimoDao(Connection conexao) {
this.conexao = new ConexaoBanco().pegarConexao();
}
//construtor
public EmprestimoDao() throws Exception {
this.conexao = new ConexaoBanco().pegarConexao(); //To change body of generated methods, choose Tools | Templates.
}
public void cadastrarEmprestimo(Emprestimo obj) throws SQLException {
try {
String sql = "INSERT INTO tb_emprestimos (data_emprestimo, data_entrega_agendada, "
+ "observacoes, tb_funcionarios_id, tb_livros_id, tb_leitores_id ) "
+ "VALUES (?,?,?,?,?,?)";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql, PreparedStatement.RETURN_GENERATED_KEYS);
stmt.setTimestamp(1, obj.getData_emprestimo());
stmt.setTimestamp(2, obj.getData_entrega_agendada()); //calculo de dada aqui
stmt.setString(3, obj.getObservacoes());
System.out.println("obj.getTb_funcionarios_id().getId()" + obj.getTb_funcionarios_id().getId());
System.out.println("obj.getTb_funcionarios_id()" + obj.getTb_funcionarios_id());
stmt.setInt(4, obj.getTb_funcionarios_id().getId());
stmt.setInt(5, obj.getTb_livros_id().getId());
stmt.setInt(6, obj.getTb_leitores_id().getId());// aqui extende
stmt.execute();
ResultSet rs = stmt.getGeneratedKeys();
int key = rs.next() ? rs.getInt(1) : 0;
if (key != 0) {
System.out.println("Generated key=" + key);
}
//stmt.execute();
stmt.close();
String sql2 = "update tb_emprestimos set static_id_emprestimo = ? where data_emprestimo = ? and tb_livros_id = ?";
java.sql.PreparedStatement stmt2 = conexao.prepareStatement(sql2);
stmt2.setInt(1, key);
stmt2.setTimestamp(2, obj.getData_emprestimo());
stmt2.setInt(3, obj.getTb_livros_id().getId());
stmt2.execute();
stmt2.close();
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Erro ao cadastrar emprestimo: " + e);
System.out.println(e);
}
JOptionPane.showMessageDialog(null, "Emprestimo realizado com sucesso");
}
//retorna o cvalor de quaquer campo passando a id de usuaraio)
public String getUserData(String table, int id) throws SQLException {
String value = null;
String sql = "select " + table + " from tb_leitores where id = " + id; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq
try {
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);//createStatment nao suporta placeholders
ResultSet rs = stmt.executeQuery(sql);
if (rs.next()) {
value = rs.getString(table);
}
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
return value;
}
public void SomaEmprestimo(int value, int id) throws SQLException {
String sql = "update tb_leitores set qtd_emprestimos = ? where id = ? ";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setInt(1, value + 1);
stmt.setInt(2, id);
stmt.execute();
stmt.close();
}
public void DiminuiEmprestimo(int value, int id) throws SQLException {
String sql = "update tb_leitores set qtd_emprestimos = ? where id = ? ";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setInt(1, value);
stmt.setInt(2, id);
stmt.execute();
stmt.close();
}
//lixeira : excluir
public void AddEmprestimoToUser(int data) throws SQLException {
String sql = "select emprestmax, qtd_emprestimos from tb_leitores where id = ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setInt(1, data);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
Usuario obj = new Usuario();
obj.setEmprestmax(rs.getInt("emprestmax"));
obj.setQtd_emprestimos(rs.getInt("qtd_emprestimos"));
int limite = obj.getEmprestmax();
int emprestados = obj.getQtd_emprestimos();
int restantes = limite - emprestados;
if (restantes > 0) {
int newEmprestados = emprestados + 1;
String sql2 = "UPDATE tb_leitores set QTD_EMPRESTIMOS = ? where ID= ?";
java.sql.PreparedStatement prepstmt = conexao.prepareStatement(sql2);
prepstmt.setInt(1, newEmprestados);
prepstmt.setInt(2, data);
System.out.println("newemprestados = " + newEmprestados);
prepstmt.executeUpdate();
prepstmt.close();
} else {
}
}
rs.close();
stmt.close();
}
public List<Emprestimo> buscarDevolucoes() throws SQLException {
List<Emprestimo> lista = new ArrayList<>();
String sql = "select e.id, u.nome, l.titulo, f.nome, e.data_emprestimo, e.data_entrega_agendada, l.disponibilidade, e.observacoes, e.data_devolucao "
+ "from tb_emprestimos as e "
+ "inner join tb_leitores as u on(e.tb_leitores_id = u.id) "
+ "inner join tb_livros as l on(e.tb_livros_id = l.id) "
+ "inner join tb_funcionarios as f on(e.tb_funcionarios_id = f.id)";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
Emprestimo e = new Emprestimo();
Usuario u = new Usuario();
Livro l = new Livro();
Funcionario f = new Funcionario();
int idEmprest = rs.getInt("e.id");
e.setId(idEmprest);//----------------------------------------------------------id
u.setNome(rs.getString("u.nome"));
e.setTb_leitores_id(u); //-----------------------------------------------------nome do leitor
l.setTitulo(rs.getString("l.titulo"));
e.setTb_livros_id(l);//--------------------------------------------------------titulo livro
f.setNome(rs.getString("f.nome"));
e.setTb_funcionarios_id(f);// -------------------------------------------------nome do funcionario
e.setData_emprestimo(rs.getTimestamp("e.data_emprestimo")); // ----------------data emrpestimo
e.setData_entrega_agendada(rs.getTimestamp("e.data_entrega_agendada"));// -----data entraga
e.setAtraso(this.calculaAtraso(idEmprest));//----------------------------------atraso
e.setObservacoes(rs.getString("e.observacoes"));//-----------------------------observacoes
e.setData_devolucao(rs.getTimestamp("e.data_devolucao"));//--------------------data devolucao
lista.add(e);
}
return lista;
}
public int calculaAtraso(int id) throws SQLException {
int i = 0;
String sql = "select data_entrega_agendada, data_devolucao from tb_emprestimos where id = ?";
try {
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);//createStatment nao suporta placeholders
stmt.setInt(1, id);
ResultSet rs = stmt.executeQuery();
if (rs.next()) { //add daata entrega para fazer 0 se for null (ja entregue)
Timestamp tmstEnt = rs.getTimestamp("data_devolucao");
if (tmstEnt == null) {
Timestamp tmsp = rs.getTimestamp("data_entrega_agendada");
Timestamp now = new Timestamp(System.currentTimeMillis());//tempo agora
long _timeGap = now.getTime() - tmsp.getTime();
long tempo = _timeGap / 1000 / 60 / 60 / 24;
Long l = new Long(tempo);
i = l.intValue();
} else {
i = 0;
}
}
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
return i;
}
public Timestamp addDays(Timestamp date, int days) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.DATE, days);
return new Timestamp(cal.getTime().getTime());
}
public String displayData(Timestamp timestamp) {
String s = new SimpleDateFormat("dd/MM/yyyy HH:mm").format(timestamp);
return s;
}
public double calculaMulta(int dias) {
double taxa = 0;
String sql = "select * from tb_opcoes where parentid = ?";
try {
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);//createStatment nao suporta placeholders
stmt.setInt(1, 25);
ResultSet rs = stmt.executeQuery();
if (rs.next()) {
taxa = rs.getInt("data");
}
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
System.out.println("taxa: " + taxa);
return (taxa / 100) * dias;
}
public void reemsprestaLivro(String disponibilidade, int iddoemprestimo) throws SQLException {
String sql = "update tb_emprestimos set data_entrega_agendada = ? where id = " + iddoemprestimo;
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
//get livro idponibilidade
Timestamp now = new Timestamp(System.currentTimeMillis());//tempo agora
Timestamp newdata = this.addDays(now, Integer.parseInt(disponibilidade));
stmt.setString(1, String.valueOf(newdata));
stmt.execute();
stmt.close();
}
public void devolveLivro(int emprestimoId) throws SQLException, IOException, Exception {// não passa como objeto pois saida dos campos teve pós-formatação dos dados
String sql = "update tb_emprestimos as e "
+ " INNER JOIN tb_leitores AS u ON (e.tb_leitores_id = u.id) "
+ " INNER JOIN tb_livros AS l ON(e.tb_livros_id = l.id) "
+ " set e.data_devolucao = ?, e.tb_funcionarios_iddevol = ?, l.is_emprestado = ? "
+ " where e.id = ? ";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
Timestamp tmsp = new Timestamp(System.currentTimeMillis());
String now = String.valueOf(tmsp);
String contentid;
contentid = new String(Files.readAllBytes(Paths.get("C:\\Librography\\LoggedIn")));
Funcionario fnc = new Funcionario();
fnc.setId(Integer.parseInt(contentid));
stmt.setString(1, now);
stmt.setInt(2, fnc.getId());
stmt.setInt(3, 0);
int leitorId = this.getEmprestimoFKeyData("tb_leitores_id", emprestimoId);//pega o id do usor
int qtdEmprestimos = Integer.parseInt(this.getUserData("qtd_emprestimos", leitorId));//pega qtd emrpestimos
int valorsubtraido = qtdEmprestimos - 1;
this.DiminuiEmprestimo(valorsubtraido, leitorId);//coloca o valor subtraido valor no db
stmt.setInt(4, emprestimoId);
System.out.println("now =" + now + "/ valorsubtraido=" + valorsubtraido + "/ contentid=" + contentid);
stmt.execute();
stmt.close();
Emprestimo emprestimo = new Emprestimo();
Usuario user = new Usuario();
user.setId(leitorId);
Livro livro = new Livro();
livro.setId(this.getEmprestimoFKeyData("tb_livros_id", emprestimoId));
emprestimo.setData_devolucao(tmsp);
emprestimo.setId(emprestimoId);
emprestimo.setTb_funcionarios_id(fnc);
emprestimo.setTb_leitores_id(user);
emprestimo.setData_emprestimo(this.getEmprestData(emprestimo.getId()));
emprestimo.setTb_livros_id(livro);
ReciboDao recibodao = new ReciboDao();
recibodao.imprimirDevolucao58(emprestimo);
if (contentid != null) {
JOptionPane.showMessageDialog(null, "Devolução realizada com sucesso");
}
//checkbox gravar options
}
public String campoStatusColor(Timestamp data_devolucao, int atraso) throws Exception {
if (atraso < -15) {
String d = "+ de 15 dias atrasado";
return d;
} else if (data_devolucao == null && atraso == 0) {
String d = "Vence Hoje";
return d;
} else if (data_devolucao != null && atraso == 0) {
String d = "Devolvido";
return d;
} else if (atraso > 0 && atraso < 15) {
String d = String.valueOf(atraso) + " dias de atraso";
return d;
} else if (atraso > 15) {
String d = "+de 15 dias restantes ou ilimitado";
return d;
} else {
int x = Math.abs(atraso);
String d = String.valueOf(x) + " dias restantes";
return d;
}
}
public String campoStatus(Timestamp data_devolucao, int atraso) {
if (atraso > 0) {
String d = String.valueOf(atraso) + " dias de atraso";
return d;
} else if (data_devolucao == null && atraso == 0) {
String d = "Vence Hoje";
return d;
} else if (data_devolucao != null && atraso == 0) {
String d = "Devolvido";
return d;
} else {
int x = Math.abs(atraso);
String d = String.valueOf(x) + " dias restantes";
return d;
}
}
public Timestamp getEmprestData(int id_do_emprestimo) throws SQLException {
Timestamp timestamp = null;
String value = "";
String sql = "select * from tb_emprestimos where id = " + id_do_emprestimo; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq
try (java.sql.PreparedStatement stmt = conexao.prepareStatement(sql)) {
ResultSet rs = stmt.executeQuery(sql);
if (rs.next()) {
value = rs.getString("data_devolucao");
if (value == null) {
timestamp = null;
} else {
timestamp = Timestamp.valueOf(value);
}
}
}
return timestamp;
}
public int getEmprestimoFKeyData(String tabelaInt, int id_do_emprestimo) throws SQLException {
int value = 0;
String sql = "select * from tb_emprestimos where id = " + id_do_emprestimo; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq
try (java.sql.PreparedStatement stmt = conexao.prepareStatement(sql)) {
ResultSet rs = stmt.executeQuery(sql);
if (rs.next()) {
value = Integer.parseInt(rs.getString(tabelaInt));
}
}
return value;
}
public int calculaemprestimosrestantes(int userid) throws SQLException {
int emprestimosrestantes = 0;
String sql = "select * from tb_leitores where id = " + userid; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq
try (java.sql.PreparedStatement stmt = conexao.prepareStatement(sql)) {
ResultSet rs = stmt.executeQuery(sql);
while (rs.next()) {
int limitedeemprestimos = Integer.parseInt(rs.getString("emprestmax"));
int livrosemprestados = Integer.parseInt(rs.getString("qtd_emprestimos"));
emprestimosrestantes = limitedeemprestimos - livrosemprestados;
}
}
return emprestimosrestantes;
}
public Timestamp livroStatusEmprestimo(int idDoLivro) throws SQLException { //pode restoornar varios valores por ex: ja edevolvidos
Timestamp ts = null;
String value = null;
String sql = "select * from tb_emprestimos where tb_livros_id = " + idDoLivro + " and data_devolucao IS NULL"; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq
System.out.println("iddolivro=" + idDoLivro);
try (java.sql.PreparedStatement stmt = conexao.prepareStatement(sql)) {
ResultSet rs = stmt.executeQuery(sql);
while (rs.next()) {
value = rs.getString("data_entrega_agendada");
if (value == null) {
ts = null;
} else {
ts = Timestamp.valueOf(value);
}
}
}
System.out.println("saida de livroStatusEmprestimo:" + ts);
return ts;
}
public String campoStatusLista(int livroid) throws Exception {
String d = "";
LivroDao livro = new LivroDao();
Timestamp dataentregaagendada = this.livroStatusEmprestimo(livroid);
String emprestimo = livro.getLivroData("disponibilidade", livroid);
String estaemprestado = livro.getLivroData("is_emprestado", livroid);
Timestamp now = new Timestamp(System.currentTimeMillis());//tempo agora
System.out.println("now= " + now.getTime() + "dataentregaagendada.getTime() = " + dataentregaagendada);
int i;
String emprestimoFormat = "";
if (emprestimo.equals("1")) {
emprestimoFormat = "1 dia";
} else {
emprestimoFormat = emprestimo + " dias";
}
if (dataentregaagendada != null) {
long _timeGap = now.getTime() - dataentregaagendada.getTime();
long tempo = _timeGap / 1000 / 60 / 60 / 24;
Long l = new Long(tempo);
i = l.intValue();
System.out.println("i = diferenca de dias = " + i + "/estaemprestado = " + estaemprestado);
if (estaemprestado.equals("1") && i <= 0) {
d = "emprestado até " + this.displayData(dataentregaagendada) + ". empréstimo é de " + emprestimoFormat;
}
if (estaemprestado.equals("1") && i > 0) {
d = "emprestimo atrasado " + i + " dias ! empréstimo é de até " + emprestimoFormat;
}
} else {
if (!emprestimo.equals("0")) {
d = "Disponível para empréstimo de até " + emprestimoFormat;
}
if (emprestimo.equals("0")) {
d = "Volume para leitura nas dependências apenas";
}
}
{
return d;
}
}
public int getEmprestimoId(Timestamp data_emprestimo, int idDoLivro) throws SQLException {
int value = 0;
String sql = "select * from tb_emprestimos where data_emprestimo = ? and tb_livros_id = ?"; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setTimestamp(1, data_emprestimo);
stmt.setInt(2, idDoLivro);
ResultSet rs = stmt.executeQuery();
if (rs.next()) {
value = rs.getInt("static_id_emprestimo");
System.out.println("value dentro- " + value);
}
stmt.close();
System.out.println("value " + value);
return value;
// System.out.println("value fora- " + value);
// stmt.setString(1, nome);
// ResultSet rs = stmt.executeQuery();
}
}
+258
View File
@@ -0,0 +1,258 @@
/*
* 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.
*/
package br.com.projeto.dao;
import br.com.projeto.jdbc.ConexaoBanco;
import br.com.projeto.model.Fornecedor;
import com.mysql.jdbc.Connection;
import com.mysql.jdbc.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JOptionPane;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class FornecedorDao {
private Connection conexao;
//conexao
public FornecedorDao(Connection conexao) {
this.conexao = new ConexaoBanco().pegarConexao();
}
//construtor
public FornecedorDao() {
this.conexao = new ConexaoBanco().pegarConexao(); //To change body of generated methods, choose Tools | Templates.
}
//metodo cadastrar Fornecedor
public void cadastrarFornecedor(Fornecedor obj){
try {
//criar instrução SQL
String sql = "insert into tb_fornecedores (nome, cnpj, email, telefone, celular, cep, endereco, numero, complemento, bairro, cidade, estado )"
+ "values(?,?,?,?,?,?,?,?,?,?,?,?)";
//prepare o sql
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setString(1, obj.getNome());
stmt.setString(2, obj.getCnpj());
stmt.setString(3, obj.getEmail());
stmt.setString(4, obj.getTelefone());
stmt.setString(5, obj.getCelular());
stmt.setString(6, obj.getCep());
stmt.setString(7, obj.getEndereco());
stmt.setString(8, obj.getNumero());
stmt.setString(9, obj.getComplemento());
stmt.setString(10, obj.getBairro());
stmt.setString(11, obj.getCidade());
stmt.setString(12, obj.getUf());
//execute
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Funcionário cadastrado com sucesso");
} catch (Exception erro) {
JOptionPane.showMessageDialog(null,"erro!" + erro);
}
}
//método editar
public void alterarFornecedor(Fornecedor obj) {
try {
// 1 - instrucoes sql
String sql = "update tb_fornecedores set nome = ?, cnpj = ?, email = ?,telefone = ?, celular = ?, cep = ?, endereco = ?, numero = ?, complemento = ?, bairro = ?, cidade = ?, estado = ? where id = ? ";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setString(1, obj.getNome());
stmt.setString(2, obj.getCnpj());
stmt.setString(3, obj.getEmail());
stmt.setString(4, obj.getTelefone());
stmt.setString(5, obj.getCelular());
stmt.setString(6, obj.getCep());
stmt.setString(7, obj.getEndereco());
stmt.setString(8, obj.getNumero());
stmt.setString(9, obj.getComplemento());
stmt.setString(10, obj.getBairro());
stmt.setString(11, obj.getCidade());
stmt.setString(12, obj.getUf());
stmt.setInt(13, obj.getId());
// 3 - executar
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Funcionário alterado com sucesso! ");
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro!" + e);
}
}
//método excluir
// TODO: implementar caixa de confirmação
public void excluirFornecedor(Fornecedor obj) {
try {
String sql = "delete from tb_fornecedores where id = ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setInt(1, obj.getId());
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Funcionário excluido com sucesso! ");
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
}
// função para unir botoes salvar e atualizar no mesmo botao, já detectando
// TODO
public void checkIdFornecedorExist(Fornecedor obj) {
try {
String sql = "SELECT 1 FROM tb_fornecedores WHERE id = ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setInt(1, obj.getId());
try (ResultSet rs = stmt.executeQuery()){
if (rs.next()) {
// por funcao "editar" aqui
JOptionPane.showMessageDialog(null, "Id já existe" + rs);
} else {
// por funcao "novo" e "salvar" aqui
// implemetar um função para campos obrigatorios
JOptionPane.showMessageDialog(null, "Id não existe" + rs);
}
}catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
}
//buscar Fornecedores com botao
public Fornecedor buscarFornecedor(String nome) {
try {
String sql = "select * from tb_fornecedores where nome = ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setString(1, nome);
ResultSet rs = stmt.executeQuery();
Fornecedor obj = new Fornecedor();
while(rs.next()){
//obj.setId(rs.getInt("id"));
obj.setId(rs.getInt("id"));
obj.setNome(rs.getString("nome"));
obj.setCnpj(rs.getString("cnpj"));
obj.setEmail(rs.getString("email"));
obj.setTelefone(rs.getString("telefone"));
obj.setCelular(rs.getString("celular"));
obj.setCep(rs.getString("cep"));
obj.setEndereco(rs.getString("endereco"));
obj.setNumero(rs.getString("numero"));
obj.setComplemento(rs.getString("complemento"));
obj.setBairro(rs.getString("bairro"));
obj.setCidade(rs.getString("cidade"));
obj.setUf(rs.getString("estado"));
}
return obj;
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
return null;
}
//filtrar usuarios
public List<Fornecedor>pesquisarNomeFornecedores(String nome) {
try {
List<Fornecedor> lista = new ArrayList<>();
String sql = "select * from tb_fornecedores where nome like ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setString(1, nome);
ResultSet rs = stmt.executeQuery();
while(rs.next()){
Fornecedor obj = new Fornecedor();
obj.setId(rs.getInt("id"));
obj.setNome(rs.getString("nome"));
obj.setCnpj(rs.getString("cnpj"));
obj.setEmail(rs.getString("email"));
obj.setTelefone(rs.getString("telefone"));
obj.setCelular(rs.getString("celular"));
obj.setCep(rs.getString("cep"));
obj.setEndereco(rs.getString("endereco"));
obj.setNumero(rs.getString("numero"));
obj.setComplemento(rs.getString("complemento"));
obj.setBairro(rs.getString("bairro"));
obj.setCidade(rs.getString("cidade"));
obj.setUf(rs.getString("estado"));
lista.add(obj);
}
return lista;
} catch (SQLException e) {
JOptionPane.showMessageDialog(null,"Erro! " + e);
}
return null;
}
// tabela listando usuarios
public List<Fornecedor> listarFornecedores() {
try {
//criar uma lista para armazenar
List<Fornecedor> lista = new ArrayList<>();
//instrucao sql
String sql = "select * from tb_fornecedores";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
// resultSet representa um conjunto de dados do BD
ResultSet rs = stmt.executeQuery();
while(rs.next()) {
Fornecedor obj = new Fornecedor();
obj.setId(rs.getInt("id"));
obj.setNome(rs.getString("nome"));
obj.setCnpj(rs.getString("cnpj"));
obj.setEmail(rs.getString("email"));
obj.setTelefone(rs.getString("telefone"));
obj.setCelular(rs.getString("celular"));
obj.setCep(rs.getString("cep"));
obj.setEndereco(rs.getString("endereco"));
obj.setNumero(rs.getString("numero"));
obj.setComplemento(rs.getString("complemento"));
obj.setBairro(rs.getString("bairro"));
obj.setCidade(rs.getString("cidade"));
obj.setUf(rs.getString("estado"));
lista.add(obj);
}
return lista;
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
return null;
}
public int getFornecedorId(String nome) throws SQLException {
int id = 0;
String sql = "select * from tb_fornecedores where nome = ?";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setString(1, nome);
ResultSet rs = stmt.executeQuery();
if (rs.next()) {
id = rs.getInt("id");
}
stmt.close();
return id;
}
}
+321
View File
@@ -0,0 +1,321 @@
/*
* 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.
*/
package br.com.projeto.dao;
import br.com.projeto.jdbc.ConexaoBanco;
import br.com.projeto.model.Funcionario;
import br.com.projeto.view.FormMenu;
import br.com.projeto.view.FormLogin;
import br.com.projeto.view.FormMenuAtendente;
import br.com.projeto.view.FormMenuUsuario;
import com.mysql.jdbc.Connection;
import com.mysql.jdbc.PreparedStatement;
import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JOptionPane;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class FuncionarioDao {
private Connection conexao;
//conexao
public FuncionarioDao(Connection conexao) {
this.conexao = new ConexaoBanco().pegarConexao();
}
//construtor
public FuncionarioDao() {
this.conexao = new ConexaoBanco().pegarConexao(); //To change body of generated methods, choose Tools | Templates.
}
//metodo cadastrar Funcionario
public void cadastrarFuncionario(Funcionario obj){
try {
String sql = "insert into tb_funcionarios (nome, rg, cpf, email, senha, cargo, nivel_acesso, telefone, celular, cep, endereco, numero, complemento, bairro, cidade, estado )"
+ "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setString(1, obj.getNome());
stmt.setString(2, obj.getRg());
stmt.setString(3, obj.getCpf());
stmt.setString(4, obj.getEmail());
stmt.setString(5, obj.getSenha());
stmt.setString(6, obj.getCargo());
stmt.setString(7, obj.getNivel_acesso());
stmt.setString(8, obj.getTelefone());
stmt.setString(9, obj.getCelular());
stmt.setString(10, obj.getCep());
stmt.setString(11, obj.getEndereco());
stmt.setString(12, obj.getNumero());
stmt.setString(13, obj.getComplemento());
stmt.setString(14, obj.getBairro());
stmt.setString(15, obj.getCidade());
stmt.setString(16, obj.getUf());
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Funcionário cadastrado com sucesso");
} catch (Exception erro) {
JOptionPane.showMessageDialog(null,"erro!" + erro);
}
}
//método editar
public void alterarFuncionario(Funcionario obj) {
try {
// 1 - instrucoes sql
String sql = "update tb_funcionarios set nome = ?, rg = ?, cpf = ?, email = ?, senha = ?, cargo = ?, nivel_acesso = ?,telefone = ?, celular = ?, cep = ?, endereco = ?, numero = ?, complemento = ?, bairro = ?, cidade = ?, estado = ? where id = ? ";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setString(1, obj.getNome());
stmt.setString(2, obj.getRg());
stmt.setString(3, obj.getCpf());
stmt.setString(4, obj.getEmail());
stmt.setString(5, obj.getSenha());
stmt.setString(6, obj.getCargo());
stmt.setString(7, obj.getNivel_acesso());
stmt.setString(8, obj.getTelefone());
stmt.setString(9, obj.getCelular());
stmt.setString(10, obj.getCep());
stmt.setString(11, obj.getEndereco());
stmt.setString(12, obj.getNumero());
stmt.setString(13, obj.getComplemento());
stmt.setString(14, obj.getBairro());
stmt.setString(15, obj.getCidade());
stmt.setString(16, obj.getUf());
stmt.setInt(17, obj.getId());
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Funcionário alterado com sucesso! ");
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro!" + e);
}
}
// TODO: implementar caixa de confirmação
public void excluirFuncionario(Funcionario obj) {
try {
String sql = "delete from tb_funcionarios where id = ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setInt(1, obj.getId());
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Funcionário excluido com sucesso! ");
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
}
// TODO: função para unir botoes salvar e atualizar no mesmo botao, já detectando
public void checkIdFuncionarioExist(Funcionario obj) {
try {
String sql = "SELECT 1 FROM tb_funcionarios WHERE id = ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setInt(1, obj.getId());
try (ResultSet rs = stmt.executeQuery()){
if (rs.next()) {
// por funcao "editar" aqui
JOptionPane.showMessageDialog(null, "Id já existe" + rs);
} else {
// por funcao "novo" e "salvar" aqui
// implemetar um função para campos obrigatorios
JOptionPane.showMessageDialog(null, "Id não existe" + rs);
}
}catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
}
//buscar Funcionarios com botao
public Funcionario buscarFuncionario(String nome) {
try {
String sql = "select * from tb_funcionarios where nome = ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setString(1, nome);
ResultSet rs = stmt.executeQuery();
Funcionario obj = new Funcionario();
while(rs.next()){
//obj.setId(rs.getInt("id"));
obj.setId(rs.getInt("id"));
obj.setNome(rs.getString("nome"));
obj.setRg(rs.getString("rg"));
obj.setCpf(rs.getString("cpf"));
obj.setEmail(rs.getString("email"));
obj.setSenha(rs.getString("senha"));
obj.setCargo(rs.getString("cargo"));
obj.setNivel_acesso(rs.getString("nivel_acesso"));
obj.setTelefone(rs.getString("telefone"));
obj.setCelular(rs.getString("celular"));
obj.setCep(rs.getString("cep"));
obj.setEndereco(rs.getString("endereco"));
obj.setNumero(rs.getString("numero"));
obj.setComplemento(rs.getString("complemento"));
obj.setBairro(rs.getString("bairro"));
obj.setCidade(rs.getString("cidade"));
obj.setUf(rs.getString("estado"));
}
return obj;
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
return null;
}
//filtrar usuarios
public List<Funcionario>pesquisarNomeFuncionarios(String nome) {
try {
List<Funcionario> lista = new ArrayList<>();
String sql = "select * from tb_funcionarios where nome like ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setString(1, nome);
ResultSet rs = stmt.executeQuery();
while(rs.next()){
Funcionario obj = new Funcionario();
obj.setId(rs.getInt("id"));
obj.setNome(rs.getString("nome"));
obj.setRg(rs.getString("rg"));
obj.setCpf(rs.getString("cpf"));
obj.setEmail(rs.getString("email"));
obj.setSenha(rs.getString("senha"));
obj.setCargo(rs.getString("cargo"));
obj.setNivel_acesso(rs.getString("nivel_acesso"));
obj.setTelefone(rs.getString("telefone"));
obj.setCelular(rs.getString("celular"));
obj.setCep(rs.getString("cep"));
obj.setEndereco(rs.getString("endereco"));
obj.setNumero(rs.getString("numero"));
obj.setComplemento(rs.getString("complemento"));
obj.setBairro(rs.getString("bairro"));
obj.setCidade(rs.getString("cidade"));
obj.setUf(rs.getString("estado"));
lista.add(obj);
}
return lista;
} catch (SQLException e) {
JOptionPane.showMessageDialog(null,"Erro! " + e);
}
return null;
}
// tabela listando usuarios
public List<Funcionario> listarFuncionarios() {
try {
//criar uma lista para armazenar
List<Funcionario> lista = new ArrayList<>();
//instrucao sql
String sql = "select * from tb_funcionarios";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
// resultSet representa um conjunto de dados do BD
ResultSet rs = stmt.executeQuery();
while(rs.next()) {
Funcionario obj = new Funcionario();
obj.setId(rs.getInt("id"));
obj.setNome(rs.getString("nome"));
obj.setRg(rs.getString("rg"));
obj.setCpf(rs.getString("cpf"));
obj.setEmail(rs.getString("email"));
obj.setSenha(rs.getString("senha"));
obj.setCargo(rs.getString("cargo"));
obj.setNivel_acesso(rs.getString("nivel_acesso"));
obj.setTelefone(rs.getString("telefone"));
obj.setCelular(rs.getString("celular"));
obj.setCep(rs.getString("cep"));
obj.setEndereco(rs.getString("endereco"));
obj.setNumero(rs.getString("numero"));
obj.setComplemento(rs.getString("complemento"));
obj.setBairro(rs.getString("bairro"));
obj.setCidade(rs.getString("cidade"));
obj.setUf(rs.getString("estado"));
lista.add(obj);
}
return lista;
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
return null;
}
public void efetuarLogin(String email, String senha) throws IOException {
try {
String sql = "select * from tb_funcionarios where email=? and senha=?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setString(1, email);
stmt.setString(2, senha);
ResultSet rs = stmt.executeQuery();
if(rs.next()) {
if(rs.getString("nivel_acesso").equals("Administrador")) {
FormMenu menu = new FormMenu();
menu.usuarioLogado = rs.getString("nome");
menu.idLogado = rs.getInt("id");
menu.setVisible(true);
JOptionPane.showMessageDialog(null, "Seja Bem Vindo ao Sistema, " + menu.usuarioLogado + "!");
} else if (rs.getString("nivel_acesso").equals("Atendente")) {
FormMenuAtendente menu = new FormMenuAtendente();
menu.usuarioLogado = rs.getString("nome");
menu.idLogado = rs.getInt("id");
menu.setVisible(true);
JOptionPane.showMessageDialog(null, "Seja Bem Vindo ao Sistema, " + menu.usuarioLogado + "!");
} else if(rs.getString("nivel_acesso").equals("Usuario")) {
FormMenuUsuario menu = new FormMenuUsuario();
menu.usuarioLogado = rs.getString("nome");
menu.idLogado = rs.getInt("id");
menu.setVisible(true);
JOptionPane.showMessageDialog(null, "Seja Bem Vindo ao Sistema, " + menu.usuarioLogado + "!");
}
}else {
FormLogin tlogin = new FormLogin();
tlogin.pack();
tlogin.setLocationRelativeTo(null);
JOptionPane.showMessageDialog(null, "Dados Inválidos! Tente Novamente!");
tlogin.setVisible(true);
}
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
public String getFuncionarioData(String table, int id) throws SQLException {
String value = null;
String sql = "select " + table + " from tb_funcionarios where id = " + id; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq
try {
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);//createStatment nao suporta placeholders
ResultSet rs = stmt.executeQuery(sql);
if (rs.next()) {
value = rs.getString(table);
//System.out.println("value dentro- " + value);
}
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
// System.out.println("value fora- " + value);
return value;
}
}
+395
View File
@@ -0,0 +1,395 @@
/*
* 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.
*/
package br.com.projeto.dao;
import br.com.projeto.jdbc.ConexaoBanco;
import br.com.projeto.model.Fornecedor;
import br.com.projeto.model.Livro;
import com.mysql.jdbc.Connection;
import com.mysql.jdbc.PreparedStatement;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JOptionPane;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class LivroDao {
private Connection conexao;
//conexao
public LivroDao(Connection conexao) {
this.conexao = new ConexaoBanco().pegarConexao();
}
//construtor
public LivroDao() throws Exception {
this.conexao = new ConexaoBanco().pegarConexao(); //To change body of generated methods, choose Tools | Templates.
}
//metodo cadastrar Livro
public void cadastrarLivro(Livro obj) {
try {
String sql = "insert into tb_livros (titulo, autor, editora, isbn, ano, serie, "
+ "edicao, idioma, tb_fornecedores_id, piso, corredor,posicao, secao, disponibilidade, observacoes, is_emprestado)"
+ "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
try ( //prepare o sql
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql)) {
stmt.setString(1, obj.getTitulo());
stmt.setString(2, obj.getAutor());
stmt.setString(3, obj.getEditora());
stmt.setString(4, obj.getIsbn());
stmt.setString(5, obj.getAno());
stmt.setString(6, obj.getSerie());
stmt.setString(7, obj.getEdicao());
stmt.setString(8, obj.getIdioma());
stmt.setInt(9, obj.getFornecedor().getId());
System.out.println("obj.getFornecedor().getId()" + obj.getFornecedor().getId());
stmt.setString(10, obj.getPiso());
stmt.setString(11, obj.getCorredor());
stmt.setString(12, obj.getPosicao());
stmt.setString(13, obj.getSecao());
stmt.setInt(14, obj.getDisponibilidade());
stmt.setString(15, obj.getObservacoes());
stmt.setInt(16, 0);//set emprestado to false
stmt.execute(); //????????
stmt.close();
}
JOptionPane.showMessageDialog(null, "Livro cadastrado com sucesso");
} catch (Exception erro) {
JOptionPane.showMessageDialog(null, "erro em cadastrar livro!" + erro);
}
}
//método editar
public void alterarLivro(Livro obj) throws FileNotFoundException, IOException {
try {
// 1 - instrucoes sql
String sql = "update tb_livros set titulo = ?, autor = ?, editora = ?, isbn = ?, ano = ?, serie = ?, edicao = ?, idioma = ?, tb_fornecedores_id =?, piso = ?, corredor = ?, posicao = ?, secao = ?, disponibilidade = ?, observacoes = ? where id = ? ";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setString(1, obj.getTitulo());
stmt.setString(2, obj.getAutor());
stmt.setString(3, obj.getEditora());
stmt.setString(4, obj.getIsbn());
stmt.setString(5, obj.getAno());
stmt.setString(6, obj.getSerie());
stmt.setString(7, obj.getEdicao());
stmt.setString(8, obj.getIdioma());
try {
stmt.setInt(9, obj.getFornecedor().getId());
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Selecione um Fornecedor");
return;
}
stmt.setString(10, obj.getPiso());
stmt.setString(11, obj.getCorredor());
stmt.setString(12, obj.getPosicao());
stmt.setString(13, obj.getSecao());
stmt.setInt(14, obj.getDisponibilidade());
stmt.setString(15, obj.getObservacoes());
stmt.setInt(16, obj.getId());
// 3 - executar
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Livro alterado com sucesso! ");
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro!" + e);
}
}
//método excluir
// TODO: implementar caixa de confirmação
public void excluirLivro(Livro obj) {
try {
String sql = "delete from tb_livros where id = ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setInt(1, obj.getId());
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Livro excluido com sucesso! ");
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
}
// função para unir botoes salvar e atualizar no mesmo botao, já detectando
// TODO
public void checkIdLivroExist(Livro obj) {
try {
String sql = "SELECT 1 FROM tb_livros WHERE id = ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setInt(1, obj.getId());
try (ResultSet rs = stmt.executeQuery()) {
if (rs.next()) {
// por funcao "editar" aqui
JOptionPane.showMessageDialog(null, "Id já existe" + rs);
} else {
// por funcao "novo" e "salvar" aqui
// implemetar um função para campos obrigatorios
JOptionPane.showMessageDialog(null, "Id não existe" + rs);
}
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
}
//buscar Livros com botao
public Livro buscarLivro(String titulo) {
try {
String sql = "select * from tb_livros where titulo = ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setString(1, titulo);
ResultSet rs = stmt.executeQuery();
Livro obj = new Livro();
while (rs.next()) {
obj.setId(rs.getInt("id"));
obj.setTitulo(rs.getString("titulo"));
obj.setAutor(rs.getString("autor"));
obj.setEditora(rs.getString("editora"));
obj.setIsbn(rs.getString("isbn"));
obj.setAno(rs.getString("ano"));
obj.setSerie(rs.getString("serie"));
obj.setEdicao(rs.getString("edicao"));
obj.setIdioma(rs.getString("idioma"));
obj.setPiso(rs.getString("piso"));
obj.setCorredor(rs.getString("corredor"));
obj.setPosicao(rs.getString("posicao"));
obj.setSecao(rs.getString("secao"));
obj.setDisponibilidade(rs.getInt("disponibilidade"));
obj.setObservacoes(rs.getString("observacoes"));
}
return obj;
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
return null;
}
//filtrar usuarios
public List<Livro> pesquisarNomeLivros(String titulo) {
try {
List<Livro> lista = new ArrayList<>();
String sql = "select p.id, p.titulo, p.autor, p.editora, p.isbn, p.ano, p.serie,"
+ " p.edicao, p.idioma, f.nome, p.piso, p.corredor,"
+ " p.posicao, p.secao, p.disponibilidade, p.observacoes from tb_livros as p inner join tb_fornecedores as "
+ "f on(p.tb_fornecedores_id=f.id) where p.titulo like ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setString(1, titulo);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
Livro obj = new Livro();
Fornecedor f = new Fornecedor();
obj.setId(rs.getInt("p.id"));
obj.setTitulo(rs.getString("p.titulo"));
obj.setAutor(rs.getString("p.autor"));
obj.setEditora(rs.getString("p.editora"));
obj.setIsbn(rs.getString("p.isbn"));
obj.setAno(rs.getString("p.ano"));
obj.setSerie(rs.getString("p.serie"));
obj.setEdicao(rs.getString("p.edicao"));
obj.setIdioma(rs.getString("p.idioma"));
f.setNome(rs.getString("nome"));
obj.setFornecedor(f);
obj.setPiso(rs.getString("p.piso"));
obj.setCorredor(rs.getString("p.corredor"));
obj.setPosicao(rs.getString("p.posicao"));
obj.setSecao(rs.getString("p.secao"));
obj.setDisponibilidade(rs.getInt("disponibilidade"));
obj.setObservacoes(rs.getString("observacoes"));
lista.add(obj);
}
return lista;
} catch (SQLException e) {
throw new RuntimeException(e);
//JOptionPane.showMessageDialog(null,"Erro! " + e);
}
//return null;
}
public List<Livro> buscarLivros() {
try {
List<Livro> lista = new ArrayList<>();
String sql = "select p.id, p.titulo, p.autor, p.editora, p.isbn, p.ano, p.serie,"
+ " p.edicao, p.idioma, f.nome, p.piso, p.corredor,"
+ " p.posicao, p.secao, p.disponibilidade, p.observacoes, p.is_emprestado from tb_livros as p inner join tb_fornecedores as "
+ "f on(p.tb_fornecedores_id=f.id)";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
Fornecedor f = new Fornecedor();
Livro obj = new Livro();
obj.setId(rs.getInt("p.id"));
obj.setTitulo(rs.getString("p.titulo"));
obj.setAutor(rs.getString("p.autor"));
obj.setEditora(rs.getString("p.editora"));
obj.setIsbn(rs.getString("p.isbn"));
obj.setAno(rs.getString("p.ano"));
obj.setSerie(rs.getString("p.serie"));
obj.setEdicao(rs.getString("p.edicao"));
obj.setIdioma(rs.getString("p.idioma"));
f.setNome(rs.getString("f.Nome"));
obj.setFornecedor(f);
obj.setPiso(rs.getString("p.piso"));
obj.setCorredor(rs.getString("p.corredor"));
obj.setPosicao(rs.getString("p.posicao"));
obj.setSecao(rs.getString("p.secao"));
obj.setDisponibilidade(rs.getInt("p.disponibilidade")); //adiconado p
obj.setObservacoes(rs.getString("p.observacoes"));//adicionado p
obj.setEmprestado(rs.getBoolean("p.is_emprestado"));
lista.add(obj);
}
return lista;
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
//função seta livro esta emprestado ou nao (boolean)
public void setIsEmprestado(int data) throws SQLException {
String sql = "UPDATE tb_livros SET is_emprestado = 1 where id =" + data;
try {
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.execute();
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
public String getLivroData(String table, int id) throws SQLException {
String value = null;
String sql = "select " + table + " from tb_livros where id = " + id; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq
try {
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);//createStatment nao suporta placeholders
ResultSet rs = stmt.executeQuery(sql);
if (rs.next()) {
value = rs.getString(table);
//System.out.println("value dentro- " + value);
}
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
// System.out.println("value fora- " + value);
return value;
}
public void addObservacoes(String data, int livroid) throws SQLException {
String sql = "UPDATE tb_livros SET observacoes = '" + data + "' where id =" + livroid;
try {
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.execute();
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
public int getFornecedorIndex(String name) throws SQLException {
int value = 0;
String sql = "select * from tb_fornecedores where nome = '" + name + "'";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);//createStatment nao suporta placeholders
ResultSet rs = stmt.executeQuery(sql);
if (rs.next()) {
value = Integer.parseInt(rs.getString("id"));
//System.out.println("value dentro- " + value);
}
stmt.close();
return value;
}
public int getLivroIndex(String name) throws SQLException {
int value = 0;
String sql = "select * from tb_Livros where titulo = '" + name + "'";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);//createStatment nao suporta placeholders
ResultSet rs = stmt.executeQuery(sql);
if (rs.next()) {
value = Integer.parseInt(rs.getString("id"));
//System.out.println("value dentro- " + value);
}
stmt.close();
return value;
}
public void importaLivrosXlsx(String path) throws FileNotFoundException, IOException, SQLException, InvalidFormatException {
conexao.setAutoCommit(false);
FornecedorDao fornecedorDao = new FornecedorDao();
java.sql.PreparedStatement stmt = null;
InputStream pkg = new FileInputStream(path);
XSSFWorkbook wb = new XSSFWorkbook(pkg);
XSSFSheet sheet = wb.getSheetAt(0);
Row row;
for (int i = 0; i <= sheet.getLastRowNum(); i++) {
row = (Row) sheet.getRow(i);
String sql = "insert into tb_livros (titulo, autor, editora, isbn, ano, serie, "
+ "edicao, idioma, tb_fornecedores_id, piso, corredor,posicao, secao,"
+ " disponibilidade, observacoes, is_emprestado)"
+ "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
stmt = conexao.prepareStatement(sql);
String titulo = row.getCell(1).getStringCellValue();
stmt.setString(1, titulo);
//System.out.println("nome = " + nome);
stmt.setString(2, row.getCell(2).getStringCellValue());
stmt.setString(3, row.getCell(3).getStringCellValue());
stmt.setString(4, row.getCell(4).getStringCellValue());
stmt.setString(5, row.getCell(5).getStringCellValue());
stmt.setString(6, row.getCell(6).getStringCellValue());
stmt.setString(7, row.getCell(7).getStringCellValue());
stmt.setString(8, row.getCell(8).getStringCellValue());
String forcedorNome = row.getCell(9).getStringCellValue();
//System.out.println("forcedorNome" + forcedorNome);
String fornec = String.valueOf(fornecedorDao.getFornecedorId(forcedorNome));
// System.out.println("fornec= " + fornec);//erro aqui
stmt.setString(9, fornec);
stmt.setString(10, row.getCell(10).getStringCellValue());
stmt.setString(11, row.getCell(11).getStringCellValue());
stmt.setString(12, row.getCell(12).getStringCellValue());
stmt.setString(13, row.getCell(13).getStringCellValue());
stmt.setString(14, row.getCell(14).getStringCellValue());
stmt.setString(15, row.getCell(15).getStringCellValue());
stmt.setInt(16, 0);//qtd_emprestimos//0
stmt.execute();
}
conexao.commit();
stmt.close();
conexao.close();
JOptionPane.showMessageDialog(null, " planilha de Livros importada com sucesso");
}
}
+108
View File
@@ -0,0 +1,108 @@
/*
* 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.
*/
package br.com.projeto.dao;
import br.com.projeto.jdbc.ConexaoBanco;
import br.com.projeto.model.Multa;
import br.com.projeto.model.Usuario;
import com.mysql.jdbc.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class MultaDao {
private Connection conexao;
//conexao
public MultaDao(Connection conexao) {
this.conexao = new ConexaoBanco().pegarConexao();
}
//construtor
public MultaDao() throws Exception {
this.conexao = new ConexaoBanco().pegarConexao(); //To change body of generated methods, choose Tools | Templates.
}
public void cadastrarMulta(Multa obj) throws SQLException {
String sql = "insert into tb_multa (dias_atraso, valor_multa, tb_leitores_id , tb_emprestimos_id, esta_pago) "
+ " values(?,?,?,?,?)";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setInt(1, obj.getDias_atraso());
stmt.setDouble(2, obj.getValor_multa());
stmt.setInt(3, obj.getTb_leitores_id());
stmt.setInt(4, obj.getTb_emprestimos_id());
stmt.setBoolean(5, false);
stmt.execute();
}
public List<Multa> listaMulta(int idDoEmprestimo) throws SQLException {
List<Multa> lista = new ArrayList<>();
String sql = "select * from tb_multa where tb_emprestimos_id = ?";
com.mysql.jdbc.PreparedStatement stmt = (com.mysql.jdbc.PreparedStatement) conexao.prepareStatement(sql);
stmt.setInt(1, idDoEmprestimo);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
Multa obj = new Multa();
obj.setId(rs.getInt("idmulta"));
obj.setDias_atraso(rs.getInt("dias_atraso"));
obj.setValor_multa(rs.getInt("valor_multa"));
obj.setEsta_pago(rs.getBoolean("esta_pago"));
obj.setTb_leitores_id(rs.getInt("tb_leitores_id"));
obj.setTb_emprestimos_id(rs.getInt("tb_emprestimos_id"));
lista.add(obj);
}
return lista;
}
public boolean seJaExiste(int idDoEmprestimo) throws SQLException {
boolean Empduplicado = false; //veirifique se o id do emprestimo ja existe em multas
String sql = "select * from tb_multa where tb_emprestimos_id = " + idDoEmprestimo;
com.mysql.jdbc.PreparedStatement stmt = (com.mysql.jdbc.PreparedStatement) conexao.prepareStatement(sql);
String key = String.valueOf(idDoEmprestimo);
ResultSet rs = stmt.executeQuery(sql);
if (rs.next()) {
String result = rs.getString("tb_emprestimos_id");//comparar pra ver se ja exite em multa
//
if (result == key) {//!result.equals("")) {
System.out.println("result"+ result + " == key" + key);
Empduplicado = false;
} else {
System.out.println("result"+ result + " != key" + key);
Empduplicado = true;
}
}return Empduplicado;
}
public void zeraMulta ( int multaId) throws SQLException {
String sql = "update tb_multa set valor_multa = ? where idmulta = ? ";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setInt(1, 0);// pode mudar funcao a partir daqui para setar valor a ser pago (parcelado)
stmt.setInt(2, multaId);
stmt.execute();
stmt.close();
}
}
+418
View File
@@ -0,0 +1,418 @@
/*
* 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.
*/
package br.com.projeto.dao;
import br.com.projeto.jdbc.ConexaoBanco;
import br.com.projeto.model.Options;
import com.mysql.jdbc.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JOptionPane;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class OptionsDao {
private Connection conexao;
//conexao
public OptionsDao(Connection conexao) throws SQLException {
this.conexao = new ConexaoBanco().pegarConexao();
}
//construtor
public OptionsDao() {
this.conexao = new ConexaoBanco().pegarConexao(); //To change body of generated methods, choose Tools | Templates.
}
//Tabela está usando Adjacency List Model aqui em option
//função retorna qualquer campo unico na tabela de options de acordo com o id na tabela
public String retornaOption(int data) throws SQLException {
String value = null;
String sql = "select data from tb_opcoes where id = " + data; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq
try {
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);//createStatment nao suporta placeholders
ResultSet rs = stmt.executeQuery(sql);
if (rs.next()) {
value = rs.getString("data");
}
System.out.println("data = " + data + "e value = " + value);
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
return value;
}
//metodo cadastrar
public void cadastrarPiso(Options obj) {
try {
String sql = "insert into tb_opcoes (data, parentid)"
+ "values(?,1)";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setString(1, obj.getPiso());
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Piso cadastrado com sucesso");
} catch (Exception erro) {
JOptionPane.showMessageDialog(null, "erro!" + erro);
}
}
//método Listar
public List<Options> listarPiso() {
try {
List<Options> lista = new ArrayList<>();
String sql = "select * from tb_opcoes where parentid = 1";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
Options obj = new Options();
obj.setPiso(rs.getString("data"));
lista.add(obj);
}
return lista;
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
return null;
}
public void excluirPiso(Options obj) { //esta pegando a id da box nao do banco
try {
String sql = "delete from tb_opcoes where data = ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setString(1, obj.getPiso());
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Piso excluido com sucesso! ");
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
}
//############################################################################
//metodo cadastrar
public void cadastrarCorredor(Options obj) {
try {
String sql = "insert into tb_opcoes (data, parentid)"
+ "values(?,2)";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setString(1, obj.getCorredor());
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Corredor cadastrado com sucesso");
} catch (Exception erro) {
JOptionPane.showMessageDialog(null, "erro!" + erro);
}
}
//método Listar
public List<Options> listarCorredor() {
try {
List<Options> lista = new ArrayList<>();
String sql = "select * from tb_opcoes where parentid = 2";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
Options obj = new Options();
obj.setCorredor(rs.getString("data"));
lista.add(obj);
}
return lista;
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
return null;
}
//metodo excluir
public void excluirCorredor(Options obj) {
try {
String sql = "delete from tb_opcoes where data = ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setString(1, obj.getCorredor());
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Corredor excluido com sucesso! ");
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
}
// #########################################################################
//metodo cadastrar
public void cadastrarPosicao(Options obj) {
try {
String sql = "insert into tb_opcoes (data, parentid)"
+ "values(?,3)";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setString(1, obj.getPosicao());
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Posição cadastrado com sucesso");
} catch (Exception erro) {
JOptionPane.showMessageDialog(null, "erro!" + erro);
}
}
//método Listar
public List<Options> listarPosicao() {
try {
List<Options> lista = new ArrayList<>();
String sql = "select * from tb_opcoes where parentid = 3";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
Options obj = new Options();
obj.setPosicao(rs.getString("data"));
lista.add(obj);
}
return lista;
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
return null;
}
//metodo excluir
public void excluirPosicao(Options obj) {
try {
String sql = "delete from tb_opcoes where data = ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setString(1, obj.getPosicao());
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Posicao excluida com sucesso! ");
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
}
//############################################################################
//metodo cadastrar
public void cadastrarSecao(Options obj) {
try {
String sql = "insert into tb_opcoes (data, parentid)"
+ "values(?,4)";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setString(1, obj.getSecao());
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Seção cadastrada com sucesso");
} catch (Exception erro) {
JOptionPane.showMessageDialog(null, "erro!" + erro);
}
}
//método Listar
public List<Options> listarSecao() {
try {
List<Options> lista = new ArrayList<>();
String sql = "select * from tb_opcoes where parentid = 4";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
Options obj = new Options();
obj.setSecao(rs.getString("data"));
lista.add(obj);
}
return lista;
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
return null;
}
//metodo excluir
public void excluirSecao(Options obj) {
try {
String sql = "delete from tb_opcoes where data = ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setString(1, obj.getSecao());
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Seçào excluida com sucesso! ");
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
}
//############################################################################
public void cadastrarDisponibilidade(Options obj) {
try {
String sql = "insert into tb_opcoes (data, parentid)"
+ "values(?,5)";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setString(1, obj.getDisponibilidade());
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Disponibilidade de Livro cadastrada com sucesso");
} catch (Exception erro) {
JOptionPane.showMessageDialog(null, "erro!" + erro);
}
}
//método Listar
public List<Options> listarDisponibilidade() {
try {
List<Options> lista = new ArrayList<>();
String sql = "select * from tb_opcoes where parentid = 5";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
Options obj = new Options();
obj.setDisponibilidade(rs.getString("data"));
lista.add(obj);
}
return lista;
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
return null;
}
//metodo excluir
public void excluirDisponibilidade(Options obj) {
try {
String sql = "delete from tb_opcoes where data = ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setString(1, obj.getDisponibilidade());
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Disponibilidade excluida com sucesso! ");
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
}
//###############################################################################
//Tipos_de_usuarios
public void cadastrarTipos_de_usuarios(Options obj) {
try {
String sql = "insert into tb_opcoes (data, parentid)"
+ "values(?,9)";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setString(1, obj.getTipos_de_usuarios());
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Tipo de Usuário de Livro cadastrado com sucesso");
} catch (Exception erro) {
JOptionPane.showMessageDialog(null, "erro!" + erro);
}
}
//método Listar
public List<Options> listarTipos_de_usuarios() {
try {
List<Options> lista = new ArrayList<>();
String sql = "select * from tb_opcoes where parentid = 9";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
Options obj = new Options();
obj.setTipos_de_usuarios(rs.getString("data"));
lista.add(obj);
}
return lista;
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
return null;
}
//metodo excluir
public void excluirTipos_de_usuarios(Options obj) {
try {
String sql = "delete from tb_opcoes where data = ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setString(1, obj.getTipos_de_usuarios());
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Tipos de Usuário excluida com sucesso! ");
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
}
//################################################################
public void setIp(Options obj) {
String sql = "update tb_opcoes set data = ? , parentid = 12 where id = 23";
java.sql.PreparedStatement stmt;
try {
stmt = conexao.prepareStatement(sql);
stmt.setString(1, obj.getServer_ip());
stmt.execute();
stmt.close();
} catch (SQLException ex) {
JOptionPane.showMessageDialog(null, "erro!" + ex);
}
}
public void setLibraryName(Options obj) {
String sql = "update tb_opcoes set data = ? , parentid = 11 where id = 15";
java.sql.PreparedStatement stmt;
try {
stmt = conexao.prepareStatement(sql);
stmt.setString(1, obj.getLibrary_name());
stmt.execute();
stmt.close();
} catch (SQLException ex) {
JOptionPane.showMessageDialog(null, "erro!" + ex);
}
}
public void setReceiptMsg(Options obj) {
String sql = "update tb_opcoes set data = ? where id = 28 and parentid = 27";
java.sql.PreparedStatement stmt;
try {
stmt = conexao.prepareStatement(sql);
stmt.setString(1, obj.getReceiptMsg());
stmt.execute();
stmt.close();
} catch (SQLException ex) {
JOptionPane.showMessageDialog(null, "erro!" + ex);
}
}
public void setLibraryAddress(Options obj) {
String sql = "update tb_opcoes set data = ? , parentid = 12 where id = 16";
java.sql.PreparedStatement stmt;
try {
stmt = conexao.prepareStatement(sql);
stmt.setString(1, obj.getLibrary_address());
stmt.execute();
stmt.close();
} catch (SQLException ex) {
JOptionPane.showMessageDialog(null, "erro!" + ex);
}
}
public void setTheme(int index) {
String sql = "update tb_opcoes set data = ? where parentid = 29 and id = 30";
java.sql.PreparedStatement stmt;
//index = 0;
String tema = "";
if (index == 0) {
tema = "Tema Claro";
} else if (index == 1) {
tema = "Tema Escuro";
}
try {
stmt = conexao.prepareStatement(sql);
stmt.setString(1, tema);
stmt.execute();
stmt.close();
} catch (SQLException ex) {
JOptionPane.showMessageDialog(null, "erro!" + ex);
}
}
}
+192
View File
@@ -0,0 +1,192 @@
/*
* 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.
*/
package br.com.projeto.dao;
import br.com.projeto.jdbc.ConexaoBanco;
import br.com.projeto.model.Emprestimo;
import br.com.projeto.model.Recibo;
import br.com.projeto.model.Utilitarios;
import com.mysql.jdbc.Connection;
import java.awt.Font;
import java.awt.print.PrinterException;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import javax.print.PrintException;
import javax.print.PrintService;
import javax.print.PrintServiceLookup;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.standard.Copies;
import javax.print.attribute.standard.MediaPrintableArea;
import javax.print.attribute.standard.MediaSizeName;
import javax.print.attribute.standard.MediaTray;
import javax.swing.JEditorPane;
import javax.swing.JOptionPane;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class ReciboDao {
private File ticket;
//contstrutor
public ReciboDao(File f) {
ticket = f;
}
private Connection conexao;
//conexao
public ReciboDao(Connection conexao) {
this.conexao = new ConexaoBanco().pegarConexao();
}
//construtor
public ReciboDao() {
this.conexao = new ConexaoBanco().pegarConexao();
}
//metodo cadastrar Funcionario
public void cadastrarReciboEmprestimo(Recibo obj) {
try {
String sql = "insert into tb_recibos (emprestimo_id, data_emprestimo, data_devolucao_agendada, livro, usuario, tipo, status, funcionario)"
+ "values(?,?,?,?,?,?,?,?)";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setInt(1, obj.getEmprestimoid());
stmt.setString(2, obj.getData_emprestimo());
stmt.setString(3, obj.getData_devolução_agendada());
stmt.setString(4, obj.getLivro());
stmt.setString(5, obj.getUsuario());
stmt.setString(6, obj.getTipo());
stmt.setString(7, obj.getStatus());
stmt.setString(8, obj.getFuncionario());
stmt.execute();
stmt.close();
this.imprimeCupom58Emprestimo(obj);
String filepath = "C:\\Librography\\ticket.txt";
PrintWriter pw = new PrintWriter(filepath);
pw.close();
} catch (Exception erro) {
JOptionPane.showMessageDialog(null, "erro!" + erro);
}
}
public void imprimeCupom58Emprestimo(Recibo obj) throws IOException, PrinterException, PrintException {
int msg = obj.getEmprestimoid();
//String Code = String.format("%08d", msg);
Utilitarios util = new Utilitarios();
util.gerarBarCode("emprestimo", msg);
util.gerarQrCode("emprestimo", msg);
String toCode = String.format("%08d", msg);
String QrImage = "file:C:\\\\Librography\\\\images\\\\Emprestimos\\\\QrCode\\\\" + toCode;
String BarCodeImage = "file:C:\\\\Librography\\\\images\\\\Emprestimos\\\\BarCode\\\\" + toCode;
String filepath = "C:\\Librography\\ticket";
File arquivo = new File(filepath);
if (!arquivo.exists()) {
arquivo.createNewFile();
}
String line = "Obrigado pela Preferencia"; /// options get message
JEditorPane p = new JEditorPane("file:" + filepath);
p.setContentType("text/html");
p.setFont(new Font("Helvetica", 0, 9));
StringBuilder htmlContent = new StringBuilder();
htmlContent.append("<html><head></head><body><p>");
htmlContent.append("<h3><img src='file:C:\\Librography\\images\\libraryLogo.png' width=30 height=30></img>");
htmlContent.append("BIBLIOTECA DE HOGWARTS</h3>");
htmlContent.append("<h3 align=center>RECIBO DE EMPRÉSTIMO</h3><br>");
htmlContent.append("LIVRO:");
htmlContent.append("<h4 align=right>").append(String.format("%26s", obj.getLivro())).append("</h4>");
htmlContent.append(" Data Empréstimo:");
htmlContent.append("<h4 align=right>").append(String.format("%26s", obj.getData_emprestimo().toUpperCase())).append("</h4>");
htmlContent.append(" Data Devolução:");
htmlContent.append("<h4 align=right>").append(String.format("%26s", obj.getData_devolução_agendada().toUpperCase())).append("</h4>");
htmlContent.append(" Usuário: ").append(String.format("%26s", obj.getUsuario().toUpperCase())).append("<br>");
htmlContent.append(" Atendente: ").append(String.format("%26s", obj.getFuncionario().toUpperCase())).append("<br>");
htmlContent.append("<img src='").append(BarCodeImage).append("' width=100 height=40></img>");
htmlContent.append("<img src='").append(QrImage).append("' width=40 height=40></img><br>");
htmlContent.append("<font face=\"monospace\">").append(line).append("</font><br><br><br>");
htmlContent.append("</body>");
htmlContent.append("</html>");
p.setText(htmlContent.toString());
this.imprimirTicket(p, 1);
arquivo.delete();
}
public void imprimirTicket(JEditorPane resultadoTicket, int numeroImpressoes) {
try {
for (int i = 0; i < numeroImpressoes; i++) {
PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
attributes.add(new Copies(1));
attributes.add(MediaTray.TOP);
attributes.add(MediaSizeName.INVOICE);
attributes.add(new MediaPrintableArea(0f, 0f, 58f, 210f, MediaPrintableArea.MM));
PrintService service = PrintServiceLookup.lookupDefaultPrintService();
System.out.println("impressora" + service.getName());
if (!service.getName().equals("Dialogo")) {
resultadoTicket.print(null, null, true, null, attributes, true);
} else {
resultadoTicket.print(null, null, false, service, attributes, false);
}
}
} catch (PrinterException e) {
e.printStackTrace();
}
}
public void imprimirDevolucao58(Emprestimo obj) throws IOException, Exception {
int msg = obj.getId();
Utilitarios util = new Utilitarios();
util.gerarBarCode("devolucao", msg);
util.gerarQrCode("devolucao", msg);
String toCode = String.format("%08d", msg);
String QrImage = "file:C:\\\\Librography\\\\images\\\\Devolucao\\\\QrCode\\\\" + toCode;
String BarCodeImage = "file:C:\\\\Librography\\\\images\\\\Devolucao\\\\BarCode\\\\" + toCode;
String filepath = "C:\\Librography\\ticket";
File arquivo = new File(filepath);
if (!arquivo.exists()) {
arquivo.createNewFile();
}
String line = "Obrigado pela Preferencia"; /// options get message
JEditorPane p = new JEditorPane("file:" + filepath);
p.setContentType("text/html");
p.setFont(new Font("Helvetica", 0, 9));
UsuarioDao usuariodao = new UsuarioDao();
LivroDao livrodao = new LivroDao();
FuncionarioDao funcionarioDao = new FuncionarioDao();
String usuarioNome = usuariodao.getUserData("nome", obj.getTb_leitores_id().getId());
String funcionarioNome = funcionarioDao.getFuncionarioData("nome", obj.getTb_funcionarios_id().getId());
String livroNome = livrodao.getLivroData("titulo", obj.getTb_livros_id().getId());
StringBuilder htmlContent = new StringBuilder();
htmlContent.append("<html><head></head><body><p>");
htmlContent.append("<h3><img src='file:C:\\Librography\\images\\libraryLogo.png' width=30 height=30></img>");
OptionsDao optionsdao = new OptionsDao();
String LivryName = optionsdao.retornaOption(15);
htmlContent.append(LivryName).append("</h3>");
htmlContent.append("<h3 align=center>RECIBO DE DEVOLUÇÃO</h3><br>");
htmlContent.append("LIVRO:");
htmlContent.append("<h4 align=right>").append(String.format("%26s", livroNome)).append("</h4>");
htmlContent.append(" Data Empréstimo:");
htmlContent.append("<h4 align=right>").append(String.format("%26s", util.formatData(obj.getData_emprestimo()))).append("</h4>");
htmlContent.append(" Data Devolução:");
htmlContent.append("<h4 align=right>").append(String.format("%26s", util.formatData(obj.getData_devolucao()))).append("</h4>");
htmlContent.append(" Usuário: ").append(String.format("%26s", usuarioNome.toUpperCase())).append("<br>");
htmlContent.append(" Atendente: ").append(String.format("%26s", funcionarioNome.toUpperCase())).append("<br>");
htmlContent.append("<img src='").append(BarCodeImage).append("' width=100 height=40></img>");
htmlContent.append("<img src='").append(QrImage).append("' width=40 height=40></img><br>");
htmlContent.append("<font face=\"monospace\">").append(line).append("</font><br><br><br>");
htmlContent.append("</body>");
htmlContent.append("</html>");
p.setText(htmlContent.toString());
this.imprimirTicket(p, 1);
arquivo.delete();
}
}
+326
View File
@@ -0,0 +1,326 @@
/*
* 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.
*/
package br.com.projeto.dao;
import br.com.projeto.jdbc.ConexaoBanco;
import br.com.projeto.model.Usuario;
import com.mysql.jdbc.Connection;
import com.mysql.jdbc.PreparedStatement;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JOptionPane;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class UsuarioDao {
private Connection conexao;
//construtor
public UsuarioDao() {
this.conexao = new ConexaoBanco().pegarConexao();
}
//metodo cadastrar usuario
public void cadastrarUsuario(Usuario obj) {
try {
//criar instrução SQL
String sql = "insert into tb_leitores (nome, rg, cpf, email, telefone, celular, cep, endereco, numero, complemento, bairro, cidade, estado, curso, curso_ano, qtd_emprestimos, emprestmax, observacoes, tipo, is_locked )"
+ "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
try (java.sql.PreparedStatement stmt = conexao.prepareStatement(sql)) {
stmt.setString(1, obj.getNome());
stmt.setString(2, obj.getRg());
stmt.setString(3, obj.getCpf());
stmt.setString(4, obj.getEmail());
stmt.setString(5, obj.getTelefone());
stmt.setString(6, obj.getCelular());
stmt.setString(7, obj.getCep());
stmt.setString(8, obj.getEndereco());
stmt.setString(9, obj.getNumero());
stmt.setString(10, obj.getComplemento());
stmt.setString(11, obj.getBairro());
stmt.setString(12, obj.getCidade());
stmt.setString(13, obj.getUf());
stmt.setString(14, obj.getCurso());
stmt.setString(15, obj.getSerie());
stmt.setInt(16, obj.getQtd_emprestimos());//qtd_emprestimos
stmt.setInt(17, obj.getEmprestmax());
stmt.setString(18, obj.getObservacoes());
stmt.setString(19, obj.getTipo());
stmt.setBoolean(20, obj.isIs_locked());
//execute
stmt.execute();
}
JOptionPane.showMessageDialog(null, "Usuário cadastrado com sucesso");
// https://www.guj.com.br/t/exemplo-de-preparedstatement/33609/5
} catch (Exception erro) {
JOptionPane.showMessageDialog(null, "erro!" + erro);
}
}
//método editar
public void alterarUsuario(Usuario obj) {
try {
// 1 - instrucoes sql
String sql = "update tb_leitores set nome = ?, rg = ?, cpf = ?, email = ?, telefone = ?, celular = ?, cep = ?, endereco = ?, numero = ?, complemento = ?, bairro = ?, cidade = ?, estado = ?, curso = ?, curso_ano = ?, emprestmax=?, observacoes=?, tipo = ? where id = ? ";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setString(1, obj.getNome());
stmt.setString(2, obj.getRg());
stmt.setString(3, obj.getCpf());
stmt.setString(4, obj.getEmail());
stmt.setString(5, obj.getTelefone());
stmt.setString(6, obj.getCelular());
stmt.setString(7, obj.getCep());
stmt.setString(8, obj.getEndereco());
stmt.setString(9, obj.getNumero());
stmt.setString(10, obj.getComplemento());
stmt.setString(11, obj.getBairro());
stmt.setString(12, obj.getCidade());
stmt.setString(13, obj.getUf());
stmt.setString(14, obj.getCurso());
stmt.setString(15, obj.getSerie());
stmt.setInt(16, obj.getEmprestmax());
stmt.setString(17, obj.getObservacoes());
stmt.setString(18, obj.getTipo());
stmt.setInt(19, obj.getId());
// 3 - executar
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Cliente alterado com sucesso! ");
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro!" + e);
}
}
//método excluir
// TODO: implementar caixa de confirmação
public void excluirUsuario(Usuario obj) {
try {
String sql = "delete from tb_leitores where id = ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setInt(1, obj.getId());
stmt.execute();
stmt.close();
JOptionPane.showMessageDialog(null, "Usuário excluido com sucesso! ");
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
}
//buscar usuarios com botao
public Usuario buscarUsuario(String nome) {
try {
String sql = "select * from tb_leitores where nome = ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setString(1, nome);
ResultSet rs = stmt.executeQuery();
Usuario obj = new Usuario();
while (rs.next()) {
//obj.setId(rs.getInt("id"));
obj.setId(rs.getInt("id"));
obj.setNome(rs.getString("nome"));
obj.setRg(rs.getString("rg"));
obj.setCpf(rs.getString("cpf"));
obj.setEmail(rs.getString("email"));
obj.setTelefone(rs.getString("telefone"));
obj.setCelular(rs.getString("celular"));
obj.setCep(rs.getString("cep"));
obj.setEndereco(rs.getString("endereco"));
obj.setNumero(rs.getString("numero"));
obj.setComplemento(rs.getString("complemento"));
obj.setBairro(rs.getString("bairro"));
obj.setCidade(rs.getString("cidade"));
obj.setUf(rs.getString("estado"));
obj.setCurso(rs.getString("curso"));
obj.setSerie(rs.getString("curso_ano"));
obj.setEmprestmax(rs.getInt("emprestmax"));
obj.setObservacoes(rs.getString("observacoes"));
obj.setTipo(rs.getString("tipo"));
}
return obj;
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
return null;
}
//filtrar usuarios
public List<Usuario> pesquisarNome(String nome) {
try {
List<Usuario> lista = new ArrayList<>();
String sql = "select * from tb_leitores where nome like ?";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.setString(1, nome);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
Usuario obj = new Usuario();
obj.setId(rs.getInt("id"));
obj.setNome(rs.getString("nome"));
obj.setRg(rs.getString("rg"));
obj.setCpf(rs.getString("cpf"));
obj.setEmail(rs.getString("email"));
obj.setTelefone(rs.getString("telefone"));
obj.setCelular(rs.getString("celular"));
obj.setCep(rs.getString("cep"));
obj.setEndereco(rs.getString("endereco"));
obj.setNumero(rs.getString("numero"));
obj.setComplemento(rs.getString("complemento"));
obj.setBairro(rs.getString("bairro"));
obj.setCidade(rs.getString("cidade"));
obj.setUf(rs.getString("estado"));
obj.setCurso(rs.getString("curso"));
obj.setSerie(rs.getString("curso_ano"));
obj.setEmprestmax(rs.getInt("emprestmax"));
obj.setObservacoes(rs.getString("observacoes"));
obj.setTipo(rs.getString("tipo"));
lista.add(obj);
}
return lista;
} catch (SQLException e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
return null;
}
// tabela listando usuarios
public List<Usuario> listarUsuarios() {
try {
//criar uma lista para armazenar
List<Usuario> lista = new ArrayList<>();
//instrucao sql
String sql = "select * from tb_leitores";
PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql);
// resultSet representa um conjunto de dados do BD
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
Usuario obj = new Usuario();
obj.setId(rs.getInt("id"));
obj.setNome(rs.getString("nome"));
obj.setRg(rs.getString("rg"));
obj.setCpf(rs.getString("cpf"));
obj.setEmail(rs.getString("email"));
obj.setTelefone(rs.getString("telefone"));
obj.setCelular(rs.getString("celular"));
obj.setCep(rs.getString("cep"));
obj.setEndereco(rs.getString("endereco"));
obj.setNumero(rs.getString("numero"));
obj.setComplemento(rs.getString("complemento"));
obj.setBairro(rs.getString("bairro"));
obj.setCidade(rs.getString("cidade"));
obj.setUf(rs.getString("estado"));
obj.setCurso(rs.getString("curso"));
obj.setSerie(rs.getString("curso_ano"));
obj.setEmprestmax(rs.getInt("emprestmax"));
obj.setObservacoes(rs.getString("observacoes"));
obj.setTipo(rs.getString("tipo"));
lista.add(obj);
}
return lista;
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Erro! " + e);
}
return null;
}
public int pegaUserIdpeloNome(String nome) throws SQLException {
int id = 0;
String sql = "select * from tb_leitores where nome = ?";
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);
stmt.setString(1, nome);
ResultSet rs = stmt.executeQuery();
if (rs.next()) {
id = rs.getInt("id");
}
stmt.close();
return id;
}
public String getUserData(String table, int id) throws SQLException {
String value = null;
String sql = "select " + table + " from tb_leitores where id = " + id; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq
try {
java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);//createStatment nao suporta placeholders
ResultSet rs = stmt.executeQuery(sql);
if (rs.next()) {
value = rs.getString(table);
}
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}
return value;
}
public void importaUsuariosXls(String path) throws FileNotFoundException, IOException, SQLException, InvalidFormatException {
conexao.setAutoCommit(false);
java.sql.PreparedStatement stmt = null;
InputStream pkg = new FileInputStream(path);
XSSFWorkbook wb = new XSSFWorkbook(pkg);
XSSFSheet sheet = wb.getSheetAt(0);
Row row;
for (int i = 0; i <= sheet.getLastRowNum(); i++) {
row = (Row) sheet.getRow(i);
String sql = "insert into tb_leitores (nome, rg, cpf, email, telefone, celular, cep, "
+ "endereco, numero, complemento, bairro, cidade, estado, curso, curso_ano, "
+ "qtd_emprestimos, emprestmax, observacoes, tipo, is_locked )"
+ "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
stmt = conexao.prepareStatement(sql);
String nome = row.getCell(1).getStringCellValue();
stmt.setString(1, nome);
System.out.println("nome = " + nome);
stmt.setString(2, row.getCell(2).getStringCellValue());
stmt.setString(3, row.getCell(3).getStringCellValue());
stmt.setString(4, row.getCell(4).getStringCellValue());
stmt.setString(5, row.getCell(5).getStringCellValue());
stmt.setString(6, row.getCell(6).getStringCellValue());
stmt.setString(7, row.getCell(7).getStringCellValue());
stmt.setString(8, row.getCell(8).getStringCellValue());
stmt.setString(9, row.getCell(9).getStringCellValue());
stmt.setString(10, row.getCell(10).getStringCellValue());
stmt.setString(11, row.getCell(11).getStringCellValue());
stmt.setString(12, row.getCell(12).getStringCellValue());
stmt.setString(13, row.getCell(13).getStringCellValue());
stmt.setString(14, row.getCell(14).getStringCellValue());
stmt.setString(15, row.getCell(15).getStringCellValue());
stmt.setInt(16, 0);//qtd_emprestimos//0
//String id = (String) row.getCell(16).getStringCellValue();
String emprestmax = row.getCell(16).getStringCellValue();
// System.out.println("emprestmax = " + emprestmax);
stmt.setString(17, emprestmax);
stmt.setString(18, row.getCell(17).getStringCellValue());
stmt.setString(19, row.getCell(18).getStringCellValue());
stmt.setBoolean(20, false);// false//0
stmt.execute();
}
conexao.commit();
stmt.close();
conexao.close();
JOptionPane.showMessageDialog(null, " planilha de usuarios importada com sucesso");
}
}
+77
View File
@@ -0,0 +1,77 @@
/*
* 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.
*/
package br.com.projeto.jdbc;
import br.com.projeto.model.Utilitarios;
import br.com.projeto.view.FormOptions;
import com.mysql.jdbc.Connection;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.sql.DriverManager;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class ConexaoBanco {
Utilitarios util = new Utilitarios();
public Connection pegarConexao() {
try {
String contentIP = null;
String ipserverPath = "";
String dbuserpPath = "";
String dbpassPath = "";
switch (util.getOS()) {
case WINDOWS:
ipserverPath = "C:\\Librography\\ipserver";
dbuserpPath = "C:\\Librography\\DBUser";
dbpassPath = "C:\\Librography\\DBPass";
break;
case MAC:
ipserverPath = "//Applications//Librography.app//config//ipserver";
dbuserpPath = "//Applications//Librography.app//config//DBUser";
dbpassPath = "//Applications//Librography.app//config//DBPass";
break;
case LINUX:
// some stuff
break;
}
try {
contentIP = new String(Files.readAllBytes(Paths.get(ipserverPath)));
} catch (IOException ex) {
Logger.getLogger(FormOptions.class.getName()).log(Level.SEVERE, null, ex);
}
String contentUser;
contentUser = new String(Files.readAllBytes(Paths.get(dbuserpPath)));
String contentPass;
contentPass = new String(Files.readAllBytes(Paths.get(dbpassPath)));
String url = "jdbc:mysql://" + contentIP + ":3306/applibrography"; //Nome da base de dados
String user = contentUser; //nome do usuário do MySQL
String password = contentPass; //senha do MySQL
Connection conexao = null;
conexao = (Connection) DriverManager.getConnection(url, user, password);
return conexao;
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "erro" + e);
}
return null;
}
}
@@ -0,0 +1,25 @@
/*
* 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.
*/
package br.com.projeto.jdbc;
//classe para testar conexao
import javax.swing.JOptionPane;
import sun.applet.Main;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class TestarConexao {
public static void main(String[] args) {
try {
new ConexaoBanco().pegarConexao();
JOptionPane.showMessageDialog(null,"conectado");
} catch (Exception e) {
JOptionPane.showMessageDialog(null,"erro" + e);
}
}
}
+70
View File
@@ -0,0 +1,70 @@
/*
* 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.
*/
package br.com.projeto.model;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class Biblioteca {
private int id;
private String piso;
private String corredor;
private String posicao;
private String secao;
private String mapa;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getPiso() {
return piso;
}
public void setPiso(String piso) {
this.piso = piso;
}
public String getCorredor() {
return corredor;
}
public void setCorredor(String corredor) {
this.corredor = corredor;
}
public String getPosicao() {
return posicao;
}
public void setPosicao(String posicao) {
this.posicao = posicao;
}
public String getSecao() {
return secao;
}
public void setSecao(String secao) {
this.secao = secao;
}
public String getMapa() {
return mapa;
}
public void setMapa(String mapa) {
this.mapa = mapa;
}
}
@@ -0,0 +1,26 @@
/*
* 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.
*/
package br.com.projeto.model;
import java.text.SimpleDateFormat;
import javax.swing.table.DefaultTableCellRenderer;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class DateRenderer extends DefaultTableCellRenderer {
public DateRenderer() { // This is a contructor
DateFormatter formatter = new DateFormatter("yyyy-MM-dd");
}
public class DateFormatter extends SimpleDateFormat { //This another class within a class
public DateFormatter(String pattern) {
super(pattern);
}
}
}
+109
View File
@@ -0,0 +1,109 @@
/*
* 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.
*/
package br.com.projeto.model;
import java.sql.Timestamp;
import java.sql.Date;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class Emprestimo {
private int id;
private Timestamp data_emprestimo;
private Timestamp data_devolucao;
private String observacoes;
private Funcionario tb_funcionarios_id;
private Livro tb_livros_id;
private Usuario tb_leitores_id;
private Timestamp data_entrega_agendada;
private int atraso;
private long static_id_emprestimo;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Timestamp getData_emprestimo() {
return data_emprestimo;
}
public void setData_emprestimo(Timestamp data_emprestimo) {
this.data_emprestimo = data_emprestimo;
}
public Timestamp getData_devolucao() {
return data_devolucao;
}
public void setData_devolucao(Timestamp data_devolucao) {
this.data_devolucao = data_devolucao;
}
public String getObservacoes() {
return observacoes;
}
public void setObservacoes(String observacoes) {
this.observacoes = observacoes;
}
public Funcionario getTb_funcionarios_id() {
return tb_funcionarios_id;
}
public void setTb_funcionarios_id(Funcionario tb_funcionarios_id) {
this.tb_funcionarios_id = tb_funcionarios_id;
}
public Livro getTb_livros_id() {
return tb_livros_id;
}
public void setTb_livros_id(Livro tb_livros_id) {
this.tb_livros_id = tb_livros_id;
}
public Usuario getTb_leitores_id() {
return tb_leitores_id;
}
public void setTb_leitores_id(Usuario tb_leitores_id) {
this.tb_leitores_id = tb_leitores_id;
}
public Timestamp getData_entrega_agendada() {
return data_entrega_agendada;
}
public void setData_entrega_agendada(Timestamp data_entrega_agendada) {
this.data_entrega_agendada = data_entrega_agendada;
}
public int getAtraso() {
return atraso;
}
public void setAtraso(int atraso) {
this.atraso = atraso;
}
public long getStatic_id_emprestimo() {
return static_id_emprestimo;
}
public void setStatic_id_emprestimo(long static_id_emprestimo) {
this.static_id_emprestimo = static_id_emprestimo;
}
}
+40
View File
@@ -0,0 +1,40 @@
/*
* 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.
*/
package br.com.projeto.model;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class Fornecedor extends GlobalUser{
private String cnpj;
private String nome;
@Override
public String getNome() {
return nome;
}
@Override
public void setNome(String nome) {
this.nome = nome;
}
public String getCnpj() {
return cnpj;
}
public void setCnpj(String cnpj) {
this.cnpj = cnpj;
}
@Override
public String toString () {
return this.getNome();
}
}
+60
View File
@@ -0,0 +1,60 @@
/*
* 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.
*/
package br.com.projeto.model;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class Funcionario extends GlobalUser{
private String cpf;
private String rg;
private String cargo;
private String nivel_acesso;
private String senha;
public String getCpf() {
return cpf;
}
public void setCpf(String cpf) {
this.cpf = cpf;
}
public String getRg() {
return rg;
}
public void setRg(String rg) {
this.rg = rg;
}
public String getCargo() {
return cargo;
}
public void setCargo(String cargo) {
this.cargo = cargo;
}
public String getNivel_acesso() {
return nivel_acesso;
}
public void setNivel_acesso(String nivel_acesso) {
this.nivel_acesso = nivel_acesso;
}
public String getSenha() {
return senha;
}
public void setSenha(String senha) {
this.senha = senha;
}
}
+124
View File
@@ -0,0 +1,124 @@
/*
* 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.
*/
package br.com.projeto.model;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class GlobalUser {
private int id;
private String nome;
private String celular;
private String telefone;
private String email;
private String endereco;
private String numero;
private String complemento;
private String bairro;
private String cidade;
private String uf;
private String cep;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getCelular() {
return celular;
}
public void setCelular(String celular) {
this.celular = celular;
}
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 getEndereco() {
return endereco;
}
public void setEndereco(String endereco) {
this.endereco = endereco;
}
public String getNumero() {
return numero;
}
public void setNumero(String numero) {
this.numero = numero;
}
public String getComplemento() {
return complemento;
}
public void setComplemento(String complemento) {
this.complemento = complemento;
}
public String getBairro() {
return bairro;
}
public void setBairro(String bairro) {
this.bairro = bairro;
}
public String getCidade() {
return cidade;
}
public void setCidade(String cidade) {
this.cidade = cidade;
}
public String getUf() {
return uf;
}
public void setUf(String uf) {
this.uf = uf;
}
public String getCep() {
return cep;
}
public void setCep(String cep) {
this.cep = cep;
}
}
+76
View File
@@ -0,0 +1,76 @@
/*
* 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.
*/
package br.com.projeto.model;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
import java.io.*;
import java.sql.*;
import java.util.*;
import java.util.regex.*;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
public class Insert {
public static void main(String[] args) {
String fileName = "C:\\File.xls";
Vector dataHolder = read(fileName);
saveToDatabase(dataHolder);
}
public static Vector read(String fileName) {
Vector cellVectorHolder = new Vector();
try {
FileInputStream myInput = new FileInputStream(fileName);
POIFSFileSystem myFileSystem = new POIFSFileSystem(myInput);
HSSFWorkbook myWorkBook = new HSSFWorkbook(myFileSystem);
HSSFSheet mySheet = myWorkBook.getSheetAt(0);
Iterator rowIter = mySheet.rowIterator();
while (rowIter.hasNext()) {
HSSFRow myRow = (HSSFRow) rowIter.next();
Iterator cellIter = myRow.cellIterator();
Vector cellStoreVector = new Vector();
while (cellIter.hasNext()) {
HSSFCell myCell = (HSSFCell) cellIter.next();
cellStoreVector.addElement(myCell);
}
cellVectorHolder.addElement(cellStoreVector);
}
} catch (Exception e) {
e.printStackTrace();
}
return cellVectorHolder;
}
private static void saveToDatabase(Vector dataHolder) {
String username = "";
String password = "";
for (int i = 0; i < dataHolder.size(); i++) {
Vector cellStoreVector = (Vector) dataHolder.elementAt(i);
for (int j = 0; j < cellStoreVector.size(); j++) {
HSSFCell myCell = (HSSFCell) cellStoreVector.elementAt(j);
String st = myCell.toString();
username = st.substring(0, 1);
password = st.substring(0);
}
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root");
Statement stat = con.createStatement();
int k = stat.executeUpdate("insert into login(username,password) value('" + username + "','" + password + "')");
System.out.println("Data is inserted");
stat.close();
con.close();
} catch (Exception e) {
}
}
}
}
+192
View File
@@ -0,0 +1,192 @@
/*
* 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.
*/
package br.com.projeto.model;
import java.sql.Blob;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class Livro {
private int id;
private String titulo;
private String autor;
private String editora;
private String isbn;
private String ano;
private String serie;
private String edicao;
private String idioma;
private String piso;
private String corredor;
private String posicao;
private String secao;
private Fornecedor fornecedor;
private int disponibilidade;
private boolean emprestado;
private String observacoes;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTitulo() {
return titulo;
}
public void setTitulo(String titulo) {
this.titulo = titulo;
}
public String getAutor() {
return autor;
}
public void setAutor(String autor) {
this.autor = autor;
}
public String getEditora() {
return editora;
}
public void setEditora(String editora) {
this.editora = editora;
}
public String getIsbn() {
return isbn;
}
public void setIsbn(String isbn) {
this.isbn = isbn;
}
public String getAno() {
return ano;
}
public void setAno(String ano) {
this.ano = ano;
}
public String getSerie() {
return serie;
}
public void setSerie(String serie) {
this.serie = serie;
}
public String getEdicao() {
return edicao;
}
public void setEdicao(String edicao) {
this.edicao = edicao;
}
public String getIdioma() {
return idioma;
}
public void setIdioma(String idioma) {
this.idioma = idioma;
}
public String getPiso() {
return piso;
}
public void setPiso(String piso) {
this.piso = piso;
}
public String getCorredor() {
return corredor;
}
public void setCorredor(String corredor) {
this.corredor = corredor;
}
public String getPosicao() {
return posicao;
}
public void setPosicao(String posicao) {
this.posicao = posicao;
}
public String getSecao() {
return secao;
}
public void setSecao(String secao) {
this.secao = secao;
}
public Fornecedor getFornecedor() {
return fornecedor;
}
public void setFornecedor(Fornecedor fornecedor) {
this.fornecedor = fornecedor;
}
public int getDisponibilidade() {
return disponibilidade;
}
public void setDisponibilidade(int disponibilidade) {
this.disponibilidade = disponibilidade;
}
public boolean isEmprestado() {
return emprestado;
}
public void setEmprestado(boolean emprestado) {
this.emprestado = emprestado;
}
// public String getDisponibilidade() {
// if(!"0".equals(disponibilidade)){
// return disponibilidade + " Dias máx.";
// } else {
// return "Não Disponível/Emprestado";
// }
// //return disponibilidade;
// }
//
// public void setDisponibilidade(String disponibilidade) {
// this.disponibilidade = disponibilidade;
// }
public String getObservacoes() {
return observacoes;
}
public void setObservacoes(String observacoes) {
this.observacoes = observacoes;
}
// public void getDisponibilidade(Object selectedItem) {
// throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
// }
}
+71
View File
@@ -0,0 +1,71 @@
/*
* 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.
*/
package br.com.projeto.model;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class Multa {
private int id;
private int dias_atraso;
private boolean esta_pago;
private int tb_leitores_id;
private int tb_emprestimos_id;
private double valor_multa;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getDias_atraso() {
return dias_atraso;
}
public void setDias_atraso(int dias_atraso) {
this.dias_atraso = dias_atraso;
}
public boolean isEsta_pago() {
return esta_pago;
}
public void setEsta_pago(boolean esta_pago) {
this.esta_pago = esta_pago;
}
public int getTb_leitores_id() {
return tb_leitores_id;
}
public void setTb_leitores_id(int tb_leitores_id) {
this.tb_leitores_id = tb_leitores_id;
}
public int getTb_emprestimos_id() {
return tb_emprestimos_id;
}
public void setTb_emprestimos_id(int tb_emprestimos_id) {
this.tb_emprestimos_id = tb_emprestimos_id;
}
public double getValor_multa() {
return valor_multa;
}
public void setValor_multa(double valor_multa) {
this.valor_multa = valor_multa;
}
}
+140
View File
@@ -0,0 +1,140 @@
/*
* 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.
*/
package br.com.projeto.model;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class Options {
private int id;
private String piso;
private String corredor;
private String posicao;
private String secao;
private String parent_id;
private String Observacoes;
private String disponibilidade;
private String tipos_de_usuarios;
private String server_ip;
private String library_name;
private String library_address;
private String receiptMsg;
public String getPiso() {
return piso;
}
public void setPiso(String piso) {
this.piso = piso;
}
public String getCorredor() {
return corredor;
}
public void setCorredor(String corredor) {
this.corredor = corredor;
}
public String getPosicao() {
return posicao;
}
public void setPosicao(String posicao) {
this.posicao = posicao;
}
public String getSecao() {
return secao;
}
public void setSecao(String secao) {
this.secao = secao;
}
public String getParent_id() {
return parent_id;
}
public void setParent_id(String parent_id) {
this.parent_id = parent_id;
}
// @Override
// public String toString() {
// return this.getPiso();
// }
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getObservacoes() {
return Observacoes;
}
public void setObservacoes(String Observacoes) {
this.Observacoes = Observacoes;
}
public String getDisponibilidade() {
return disponibilidade;
}
public void setDisponibilidade(String disponibilidade) {
this.disponibilidade = disponibilidade;
}
public String getTipos_de_usuarios() {
return tipos_de_usuarios;
}
public void setTipos_de_usuarios(String tipos_de_usuarios) {
this.tipos_de_usuarios = tipos_de_usuarios;
}
public String getServer_ip() {
return server_ip;
}
public void setServer_ip(String server_ip) {
this.server_ip = server_ip;
}
public String getLibrary_name() {
return library_name;
}
public void setLibrary_name(String library_name) {
this.library_name = library_name;
}
public String getLibrary_address() {
return library_address;
}
public void setLibrary_address(String library_address) {
this.library_address = library_address;
}
@Override public String toString( ){ return this.getPiso(); }
public String getReceiptMsg() {
return receiptMsg;
}
public void setReceiptMsg(String receiptMsg) {
this.receiptMsg = receiptMsg;
}
}
@@ -0,0 +1,43 @@
/*
* 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.
*/
package br.com.projeto.model;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
// */
import com.google.zxing.BarcodeFormat;
import com.google.zxing.WriterException;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.oned.EAN8Writer;
import com.google.zxing.qrcode.QRCodeWriter;
import java.io.IOException;
import java.nio.file.FileSystems;
import java.nio.file.Path;
public class QRCodeGenerator {
public void generateQRCodeImage(String text, int width, int height, String filePath)
throws WriterException, IOException {
QRCodeWriter qrCodeWriter = new QRCodeWriter();
BitMatrix bitMatrix = qrCodeWriter.encode(text, BarcodeFormat.QR_CODE, width, height);
Path path = FileSystems.getDefault().getPath(filePath);
MatrixToImageWriter.writeToPath(bitMatrix, "PNG", path);
}
public void generateBarCodeImage(String text, int width, int height, String filePath)
throws WriterException, IOException {
EAN8Writer barCodeWriter = new EAN8Writer();
BitMatrix bitMatrix = barCodeWriter.encode(text, BarcodeFormat.EAN_8, width, height);
Path path = FileSystems.getDefault().getPath(filePath);
MatrixToImageWriter.writeToPath(bitMatrix, "PNG", path);
}
}
+114
View File
@@ -0,0 +1,114 @@
/*
* 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.
*/
package br.com.projeto.model;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class Recibo {
private int id;
private int emprestimoid;
private String data_emprestimo;
private String data_devolução_agendada;
private String data_entrega;
private String livro;
private String usuario;
private String tipo;
private String multa;
private String status;
private String funcionario;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getEmprestimoid() {
return emprestimoid;
}
public void setEmprestimoid(int emprestimoid) {
this.emprestimoid = emprestimoid;
}
public String getData_emprestimo() {
return data_emprestimo;
}
public void setData_emprestimo(String data_emprestimo) {
this.data_emprestimo = data_emprestimo;
}
public String getData_devolução_agendada() {
return data_devolução_agendada;
}
public void setData_devolução_agendada(String data_devolução_agendada) {
this.data_devolução_agendada = data_devolução_agendada;
}
public String getData_entrega() {
return data_entrega;
}
public void setData_entrega(String data_entrega) {
this.data_entrega = data_entrega;
}
public String getLivro() {
return livro;
}
public void setLivro(String livro) {
this.livro = livro;
}
public String getUsuario() {
return usuario;
}
public void setUsuario(String usuario) {
this.usuario = usuario;
}
public String getMulta() {
return multa;
}
public void setMulta(String multa) {
this.multa = multa;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getFuncionario() {
return funcionario;
}
public void setFuncionario(String funcionario) {
this.funcionario = funcionario;
}
public String getTipo() {
return tipo;
}
public void setTipo(String tipo) {
this.tipo = tipo;
}
}
+102
View File
@@ -0,0 +1,102 @@
/*
* 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.
*/
package br.com.projeto.model;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class Usuario extends GlobalUser{
private String cpf;
private String rg;
private String curso;
private String serie;
private int emprestmax;
private String observacoes;
private String tipo;
private int qtd_emprestimos;
private boolean is_locked;
public String getCpf() {
return cpf;
}
public void setCpf(String cpf) {
this.cpf = cpf;
}
public String getRg() {
return rg;
}
public void setRg(String rg) {
this.rg = rg;
}
public String getCurso() {
return curso;
}
public void setCurso(String curso) {
this.curso = curso;
}
public String getSerie() {
return serie;
}
public void setSerie(String serie) {
this.serie = serie;
}
public int getEmprestmax() {
return emprestmax;
}
public void setEmprestmax(int emprestmax) {
this.emprestmax = emprestmax;
}
public String getObservacoes() {
return observacoes;
}
public void setObservacoes(String observacoes) {
this.observacoes = observacoes;
}
public String getTipo() {
return tipo;
}
public void setTipo(String tipo) {
this.tipo = tipo;
}
public int getQtd_emprestimos() {
return qtd_emprestimos;
}
public void setQtd_emprestimos(int qtd_emprestimos) {
this.qtd_emprestimos = qtd_emprestimos;
}
public boolean isIs_locked() {
return is_locked;
}
public void setIs_locked(boolean is_locked) {
this.is_locked = is_locked;
}
}
+297
View File
@@ -0,0 +1,297 @@
/*
* 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.
*/
package br.com.projeto.model;
import br.com.caelum.stella.validation.CNPJValidator;
import br.com.caelum.stella.validation.CPFValidator;
import br.com.projeto.view.FormCartao;
import com.google.zxing.WriterException;
import java.awt.Component;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
import java.util.logging.Level;
import java.util.logging.Logger;
import static javax.management.Query.lt;
import javax.swing.ImageIcon;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.table.TableModel;
import static org.apache.commons.math3.fitting.leastsquares.LeastSquaresFactory.model;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class Utilitarios {
// método limpar tela
public void limpaTela(JPanel container) {
Component components[] = container.getComponents();
for (Component component : components) {
if (component instanceof JTextField || component instanceof JTextArea) {
((JTextField) component).setText(null);
}
if (component instanceof JComboBox) {
((JComboBox) component).setSelectedIndex(-1);
}
if (component instanceof JLabel) {
((JLabel) component).setIcon(null);
}
}
}
public static boolean isNegative(double d) {
return Double.doubleToRawLongBits(d) < 0;
}
public interface DateUtil {
String ISO_DATE_FORMAT_ZERO_OFFSET = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
String UTC_TIMEZONE_NAME = "UTC";
static SimpleDateFormat provideDateFormat() {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(ISO_DATE_FORMAT_ZERO_OFFSET);
simpleDateFormat.setTimeZone(TimeZone.getTimeZone(UTC_TIMEZONE_NAME));
return simpleDateFormat;
}
}
public String campoMulta(double multa) {
NumberFormat formatter = NumberFormat.getCurrencyInstance();
if (multa <= 0) {
String e = "Em dia";
return e;
} else {
String e = formatter.format(multa);
return e;
}
}
public static int okcancel(String theMessage) {
int result = JOptionPane.showConfirmDialog((Component) null, theMessage,
"Atenção!", JOptionPane.OK_CANCEL_OPTION);
return result;
}
/**
*
* @param tipo
* @param id
*/
public void gerarBarCode(String tipo, int id) {
String toCode = String.format("%08d", id);
String BAR_CODE_IMAGE_PATH = "C:\\Librography\\images\\Emprestimos\\BarCode\\";
switch (tipo) {
case "emprestimo":
BAR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\\\Emprestimos\\\\BarCode\\\\";
break;
case "devolucao":
BAR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\\\Devolucao\\\\BarCode\\\\";
break;
case "usuario":
BAR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\\\Usuarios\\\\BarCode\\\\";
break;
case "card":
BAR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\\\Cards\\\\BarCode\\\\";
break;
case "book":
BAR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\Books\\\\BarCode\\\\";
break;
}
System.out.println(BAR_CODE_IMAGE_PATH);
String Finalbpath = BAR_CODE_IMAGE_PATH + toCode;
System.out.println(Finalbpath);
QRCodeGenerator genBarCode = new QRCodeGenerator();
try {
genBarCode.generateBarCodeImage(toCode, 340, 150, Finalbpath);
} catch (WriterException ex) {
Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex);
}
//String BarCodeImage = "C:\\Librography\\images\\Emprestimos\\QrCode\\" + toCode;
}
public void gerarQrCode(String tipo, int id) {
String toCode = String.format("%08d", id);
String QR_CODE_IMAGE_PATH = "C:\\Librography\\images\\Emprestimos\\QrCode\\";
switch (tipo) {
case "emprestimo":
QR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\\\Emprestimos\\\\QrCode\\\\";
break;
case "devolucao":
QR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\\\Devolucao\\\\QrCode\\\\";
break;
case "usuario":
QR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\\\Usuarios\\\\QrCode\\\\";
break;
case "card":
QR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\\\Cards\\\\QrCode\\\\";
break;
case "book":
QR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\\\Books\\\\QrCode\\\\";
break;
}
String Finalbpath = QR_CODE_IMAGE_PATH + toCode;
QRCodeGenerator genCode = new QRCodeGenerator();
try {
genCode.generateQRCodeImage(toCode, 550, 550, Finalbpath);
} catch (WriterException ex) {
Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex);
}
}
public String formatData(Timestamp timestamp) {
SimpleDateFormat dataBR = new SimpleDateFormat("dd/MM/yyyy HH:mm");
String dataFormatada = dataBR.format(timestamp);
return dataFormatada;
}
public boolean valida(String cpf) {
CPFValidator cpfValidator = new CPFValidator();
try {
cpfValidator.assertValid(cpf);
return true;
} catch (Exception e) {
//JOptionPane.showMessageDialog(null, "CPF Inválido! Tente Novamente!");
// e.printStackTrace();
return false;
}
}
public boolean validaCnpj(String cpf) {
CNPJValidator cnpjValidator = new CNPJValidator();
try {
cnpjValidator.assertValid(cpf);
return true;
} catch (Exception e) {
//JOptionPane.showMessageDialog(null, "CNPJ Inválido! Tente Novamente!");
// e.printStackTrace();
return false;
}
}
public void toExcel(JTable table, File file) throws FileNotFoundException, IOException {
FileOutputStream excelFos = null;
XSSFWorkbook excelJTableExport = null;
BufferedOutputStream excelBos = null;
try {
TableModel model = table.getModel();
excelJTableExport = new XSSFWorkbook();
XSSFSheet excelSheet = excelJTableExport.createSheet("Jtable Export");
for (int i = 0; i < model.getRowCount(); i++) {
XSSFRow excelRow = excelSheet.createRow(i);
for (int j = 0; j < model.getColumnCount(); j++) {
XSSFCell excelCell = excelRow.createCell(j);
if (model.getValueAt(i, j) == null) {
excelCell.setCellValue("");
} else {
String ccell = model.getValueAt(i, j).toString();
excelCell.setCellValue(ccell);
}
}
}
excelFos = new FileOutputStream(file);
excelBos = new BufferedOutputStream(excelFos);
excelJTableExport.write(excelBos);
//JOptionPane.showMessageDialog(null, "Exported Successfully");
} catch (FileNotFoundException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
} finally {
try {
if (excelBos != null) {
excelBos.close();
}
if (excelFos != null) {
excelFos.close();
}
if (excelJTableExport != null) {
excelJTableExport.close();
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
public enum OS {
WINDOWS, LINUX, MAC, SOLARIS
};// Operating systems.
private static OS os = null;
public static OS getOS() {
if (os == null) {
String operSys = System.getProperty("os.name").toLowerCase();
if (operSys.contains("win")) {
os = OS.WINDOWS;
} else if (operSys.contains("nix") || operSys.contains("nux")
|| operSys.contains("aix")) {
os = OS.LINUX;
} else if (operSys.contains("mac")) {
os = OS.MAC;
} else if (operSys.contains("sunos")) {
os = OS.SOLARIS;
}
}
return os;
}
// try {
// TableModel model = table.getModel();
// FileWriter excel = new FileWriter(file);
//
// for (int i = 0; i < model.getColumnCount(); i++) {
// excel.write(model.getColumnName(i) + "\t");
// }
//
// excel.write("\n");
//
// for (int i = 0; i < model.getRowCount(); i++) {
// for (int j = 0; j < model.getColumnCount(); j++) {
// excel.write(model.getValueAt(i, j).toString() + "\t");
// }
// excel.write("\n");
// }
//
// excel.close();
//
// }
// catch (IOException e
//
//
// ) {
// System.out.println(e);
// }
//}
}
+90
View File
@@ -0,0 +1,90 @@
/*
* 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.
*/
package br.com.projeto.model;
import br.com.projeto.jdbc.ConexaoBanco;
import com.mysql.jdbc.Connection;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import javax.swing.JFileChooser;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
/**
*
* @author orfeu
*/
public class XlsxProcess {
private Connection conexao;
//construtor
public XlsxProcess() {
this.conexao = new ConexaoBanco().pegarConexao();
}
public void importaUsuariosXls() throws FileNotFoundException, IOException, SQLException {
// java.sql.PreparedStatement stmt = null;
final JFileChooser fc = new JFileChooser();
File file = fc.getSelectedFile(); //if xls only
java.sql.PreparedStatement stmt = null;
FileInputStream input = new FileInputStream(file);
POIFSFileSystem fs = new POIFSFileSystem(input);
Workbook workbook;
workbook = WorkbookFactory.create(fs);
Sheet sheet = workbook.getSheetAt(0);
Row row;
for (int i = 1; i <= sheet.getLastRowNum(); i++) {
row = (Row) sheet.getRow(i);
String nome = row.getCell(0).getStringCellValue();
String rg = row.getCell(1).getStringCellValue();
String cpf = row.getCell(2).getStringCellValue();
String email= row.getCell(3).getStringCellValue();
String telefone= row.getCell(4).getStringCellValue();
String celular= row.getCell(5).getStringCellValue();
String cep= row.getCell(6).getStringCellValue();
String endereco= row.getCell(7).getStringCellValue();
String numero= row.getCell(8).getStringCellValue();
String complemento = row.getCell(9).getStringCellValue();
String bairro= row.getCell(10).getStringCellValue();
String cidade= row.getCell(11).getStringCellValue();
String estado= row.getCell(12).getStringCellValue();
String curso= row.getCell(13).getStringCellValue();
String curso_ano= row.getCell(14).getStringCellValue();
String qtd_emprestimos= "0";
String emprestmax= row.getCell(15).getStringCellValue();
String observacoes= row.getCell(16).getStringCellValue();
String tipo= row.getCell(17).getStringCellValue();
String is_locked= "0";
//String = row.getCell(20).getStringCellValue();
String sql = "insert into tb_leitores (nome, rg, cpf, email, telefone, celular, cep, endereco, numero, complemento, bairro, cidade, estado, curso, curso_ano, qtd_emprestimos, emprestmax, observacoes, tipo, is_locked )"
+ "values("+nome +", "+ rg+", "+ cpf+","+email +","+ telefone+", "
+ ""+ celular+", "+cep +", "+ endereco+", "+numero +", "+ complemento+", "+ bairro+","
+ " "+ cidade+", "+estado +", "+ curso+", "+ curso_ano+", "+ qtd_emprestimos+", "+ emprestmax+","
+ " "+observacoes +", "+ tipo+", "+ is_locked+")";
stmt = (PreparedStatement) conexao.prepareStatement(sql);
stmt.execute();
System.out.println("Import rows " + i);
}
conexao.commit();
stmt.close();
conexao.close();
input.close();
System.out.println("Success import excel to mysql table");
}
}
+370
View File
@@ -0,0 +1,370 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.9" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<NonVisualComponents>
<Container class="javax.swing.JLayeredPane" name="jLayeredPane1">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="100" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="100" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
</Container>
</NonVisualComponents>
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
<Property name="title" type="java.lang.String" value="Cartao"/>
<Property name="location" type="java.awt.Point" editor="org.netbeans.beaninfo.editors.PointEditor">
<Point value="[0, 0]"/>
</Property>
<Property name="undecorated" type="boolean" value="true"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/>
</Events>
<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" attributes="0">
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
<Component id="btnSave" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="btnPrint" min="-2" pref="97" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jButton3" min="-2" pref="90" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="btnSave" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnPrint" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="16" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
<LineBorder>
<Color PropertyName="color" blue="cc" green="cc" red="cc" type="rgb"/>
</LineBorder>
</Border>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="cc" green="cc" red="cc" type="rgb"/>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="7" pref="7" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="lblInstituicao" min="-2" pref="184" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<Component id="lblFoto" min="-2" pref="65" max="-2" attributes="0"/>
<EmptySpace min="6" pref="6" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<EmptySpace min="6" pref="6" max="-2" attributes="0"/>
<Component id="lblId" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jLabel9" min="-2" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace min="4" pref="4" max="-2" attributes="0"/>
<Component id="lblCurso" min="-2" pref="117" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
<EmptySpace min="4" pref="4" max="-2" attributes="0"/>
<Component id="lblLogo" min="-2" pref="84" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<EmptySpace min="13" pref="13" max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<EmptySpace min="6" pref="6" max="-2" attributes="0"/>
<Component id="lblNome" min="-2" pref="220" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<EmptySpace min="7" pref="7" max="-2" attributes="0"/>
<Component id="lblAcesso" min="-2" max="-2" attributes="0"/>
<EmptySpace min="26" pref="26" max="-2" attributes="0"/>
<Component id="lblCodBarras" min="-2" pref="113" max="-2" attributes="0"/>
<EmptySpace min="12" pref="12" max="-2" attributes="0"/>
<Component id="lblQrcode" min="-2" pref="50" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="6" pref="6" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="lblInstituicao" min="-2" pref="10" max="-2" attributes="0"/>
<EmptySpace min="6" pref="6" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="2" pref="2" max="-2" attributes="0"/>
<Component id="lblFoto" min="-2" pref="70" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel7" min="-2" pref="10" max="-2" attributes="0"/>
<Component id="lblId" min="-2" pref="10" max="-2" attributes="0"/>
</Group>
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
<Component id="jLabel9" min="-2" pref="10" max="-2" attributes="0"/>
<EmptySpace min="6" pref="6" max="-2" attributes="0"/>
<Component id="lblCurso" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" attributes="0">
<EmptySpace min="5" pref="5" max="-2" attributes="0"/>
<Component id="lblLogo" min="-2" pref="83" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="6" pref="6" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="2" pref="2" max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" pref="14" max="-2" attributes="0"/>
</Group>
<Component id="lblNome" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="6" pref="6" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="3" pref="3" max="-2" attributes="0"/>
<Component id="lblAcesso" min="-2" pref="40" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<EmptySpace min="1" pref="1" max="-2" attributes="0"/>
<Component id="lblCodBarras" min="-2" pref="49" max="-2" attributes="0"/>
</Group>
<Component id="lblQrcode" min="-2" pref="50" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="lblLogo">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblInstituicao">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="99" green="33" red="0" type="rgb"/>
</Property>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="13" style="1"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="99" green="33" red="0" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" value="Nome da Institui&#xe7;&#xe3;o"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="ID:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblId">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="eb" green="eb" red="eb" type="rgb"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="0" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" value="XXXXXXX"/>
<Property name="opaque" type="boolean" value="true"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel9">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Curso:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblFoto">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/leitor.png"/>
</Property>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
<EtchetBorder bevelType="0">
<Color PropertyName="highlight" blue="c0" green="c0" id="lightGray" palette="1" red="c0" type="palette"/>
<Color PropertyName="shadow" blue="40" green="40" id="darkGray" palette="1" red="40" type="palette"/>
</EtchetBorder>
</Border>
</Property>
<Property name="focusable" type="boolean" value="false"/>
<Property name="inheritsPopupMenu" type="boolean" value="false"/>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
<Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_InitCodePre" type="java.lang.String" value="setContentPane(new JLabel(new ImageIcon(&quot;C:/Librography/images/cardBackground.jpg&quot;)));"/>
</AuxValues>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="cc" green="66" red="0" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" value="Nome:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblNome">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="eb" green="eb" red="eb" type="rgb"/>
</Property>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="13" style="1"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="0" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" value="XXXXXX XX XXXXXXX XXXXXXXXXXXX"/>
<Property name="opaque" type="boolean" value="true"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblAcesso">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="99" red="33" type="rgb"/>
</Property>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Segoe UI" size="15" style="1"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="cc" green="66" red="0" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" value="ESTUDANTE"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblQrcode">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" value="QRCODE"/>
<Property name="opaque" type="boolean" value="true"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblCodBarras">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" value="Cod Barras"/>
<Property name="opaque" type="boolean" value="true"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblCurso">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="eb" green="eb" red="eb" type="rgb"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="0" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" value="XXXXXXXXXXXXXXXXXXXX"/>
<Property name="opaque" type="boolean" value="true"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="btnPrint">
<Properties>
<Property name="text" type="java.lang.String" value="Imprimir"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnPrintActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="jButton3">
<Properties>
<Property name="text" type="java.lang.String" value="Fechar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnSave">
<Properties>
<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="btnSaveActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
+533
View File
@@ -0,0 +1,533 @@
/*
* 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.
*/
package br.com.projeto.view;
import br.com.projeto.dao.OptionsDao;
import br.com.projeto.model.QRCodeGenerator;
import com.bulenkov.darcula.DarculaLaf;
import java.awt.Image;
import java.sql.SQLException;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import com.google.zxing.WriterException;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.awt.print.PageFormat;
import java.awt.print.Printable;
import java.awt.print.PrinterException;
import java.awt.print.PrinterJob;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.plaf.basic.BasicLookAndFeel;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class FormCartao extends javax.swing.JFrame {
// Image src;
/**
* Creates new form FormCartao
*/
public FormCartao() {
//Toolkit.getDefaultToolkit().createImage("C:\\Librography\\images\\cardBackground.jpg");
initComponents();
}
public FormCartao(String msg, String msgNome, String msgCurso, String msgAcesso) throws SQLException {
initComponents();
// int in = Integer.parseInt(msg);
// String id = String.format("%08d", in);
lblId.setText(msg);
lblNome.setText(msgNome);
lblCurso.setText(msgCurso);
OptionsDao opt = new OptionsDao();
String biblioteca = opt.retornaOption(15);
lblInstituicao.setText(biblioteca.toUpperCase()); // global! nao precisa importar do outro frame
lblAcesso.setText(msgAcesso); // nivel de acesso a implementar
String path = "C:\\Librography\\images\\usuarios\\" + msg;
lblFoto.setIcon(ResizeIdImage(path));
String pathLogo = "C:\\Librography\\images\\libraryLogo.png";
lblLogo.setIcon(ResizeLogoImage(pathLogo));
int i = Integer.parseInt(msg);
//parse to int e add zero
String toCode = String.format("%08d", i);
//qrcode
String QrCodeName = toCode;
String QR_CODE_IMAGE_PATH = "C:\\Librography\\images\\QrCodes\\";
String Finalpath = QR_CODE_IMAGE_PATH + QrCodeName;
QRCodeGenerator genCode = new QRCodeGenerator();
try {
genCode.generateQRCodeImage(toCode, 550, 550, Finalpath);
} catch (WriterException ex) {
Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex);
}
String QrImage = "C:\\Librography\\images\\QrCodes\\" + toCode;
lblQrcode.setIcon(ResizeQrCodeImage(QrImage));
//lblCodBarras.setIcon(toCode);
String toBCode = String.format("%08d", i);
String BarCodeName = toBCode;
String BAR_CODE_IMAGE_PATH = "C:\\Librography\\images\\BarCodes\\";
String Finalbpath = BAR_CODE_IMAGE_PATH + BarCodeName;
QRCodeGenerator genBarCode = new QRCodeGenerator();
try {
genBarCode.generateBarCodeImage(toCode, 340, 150, Finalbpath);
} catch (WriterException ex) {
Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex);
}
String BarCodeImage = "C:\\Librography\\images\\BarCodes\\" + toCode;
lblCodBarras.setIcon(ResizeBarCodeImage(BarCodeImage));
}
//criar classe em arquivo separado aqui
class PrintObject implements Printable
{
public int print(Graphics g, PageFormat f, int pageIndex) {
Graphics2D g2 = (Graphics2D) g; // Allow use of Java 2 graphics on
// the print pages :
String msg =lblId.getText();
if (pageIndex == 0) {
// tamabnho de margens e papel
// Paper p = new Paper();
//p.setSize(5.48, 8.6);
//f.setPaper(p);
// double margin = 20.;
//p.setImageableArea(margin,
// p.getImageableY(),
// p.getWidth() - 2* margin, p.getImageableHeight());
//
// f.setPaper(p);
try {
g2.drawImage(ImageIO.read(new File("C:\\Librography\\images\\cards\\" + msg + ".png" )), null, pageIndex, pageIndex);
} catch (IOException ex) {
Logger.getLogger(PrintObject.class.getName()).log(Level.SEVERE, null, ex);
}
return PAGE_EXISTS;
} else {
return NO_SUCH_PAGE;
}
}
}
//funcao tira screenshot
public static BufferedImage getScreenshotCartao(Component component) {
BufferedImage image = new BufferedImage(component.getWidth(), component.getHeight(), BufferedImage.TYPE_INT_RGB);
component.paint(image.getGraphics());
return image;
}
public static void salvaImagemCartao(Component component, String filename) throws Exception {
BufferedImage img = getScreenshotCartao(component);
ImageIO.write(img, "png", new File(filename));
}
/**
* 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() {
jLayeredPane1 = new javax.swing.JLayeredPane();
jPanel1 = new javax.swing.JPanel();
lblLogo = new javax.swing.JLabel();
lblInstituicao = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
lblId = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
lblFoto = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
lblNome = new javax.swing.JLabel();
lblAcesso = new javax.swing.JLabel();
lblQrcode = new javax.swing.JLabel();
lblCodBarras = new javax.swing.JLabel();
lblCurso = new javax.swing.JLabel();
btnPrint = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
btnSave = new javax.swing.JButton();
javax.swing.GroupLayout jLayeredPane1Layout = new javax.swing.GroupLayout(jLayeredPane1);
jLayeredPane1.setLayout(jLayeredPane1Layout);
jLayeredPane1Layout.setHorizontalGroup(
jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
);
jLayeredPane1Layout.setVerticalGroup(
jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 100, Short.MAX_VALUE)
);
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Cartao");
setLocation(new java.awt.Point(0, 0));
setUndecorated(true);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowActivated(java.awt.event.WindowEvent evt) {
formWindowActivated(evt);
}
});
jPanel1.setBackground(new java.awt.Color(255, 255, 255));
jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204)));
jPanel1.setForeground(new java.awt.Color(204, 204, 204));
lblLogo.setBackground(new java.awt.Color(255, 255, 255));
lblInstituicao.setBackground(new java.awt.Color(0, 51, 153));
lblInstituicao.setFont(new java.awt.Font("Dialog", 1, 13)); // NOI18N
lblInstituicao.setForeground(new java.awt.Color(0, 51, 153));
lblInstituicao.setText("Nome da Instituição");
jLabel7.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
jLabel7.setText("ID:");
lblId.setBackground(new java.awt.Color(235, 235, 235));
lblId.setForeground(new java.awt.Color(0, 0, 0));
lblId.setText("XXXXXXX");
lblId.setOpaque(true);
jLabel9.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
jLabel9.setText("Curso:");
setContentPane(new JLabel(new ImageIcon("C:/Librography/images/cardBackground.jpg")));
lblFoto.setBackground(new java.awt.Color(255, 255, 255));
lblFoto.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/leitor.png"))); // NOI18N
lblFoto.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, java.awt.Color.lightGray, java.awt.Color.darkGray));
lblFoto.setFocusable(false);
lblFoto.setInheritsPopupMenu(false);
lblFoto.setRequestFocusEnabled(false);
lblFoto.setVerifyInputWhenFocusTarget(false);
jLabel6.setForeground(new java.awt.Color(0, 102, 204));
jLabel6.setText("Nome:");
lblNome.setBackground(new java.awt.Color(235, 235, 235));
lblNome.setFont(new java.awt.Font("Dialog", 1, 13)); // NOI18N
lblNome.setForeground(new java.awt.Color(0, 0, 0));
lblNome.setText("XXXXXX XX XXXXXXX XXXXXXXXXXXX");
lblNome.setOpaque(true);
lblAcesso.setBackground(new java.awt.Color(51, 153, 255));
lblAcesso.setFont(new java.awt.Font("Segoe UI", 1, 15)); // NOI18N
lblAcesso.setForeground(new java.awt.Color(0, 102, 204));
lblAcesso.setText("ESTUDANTE");
lblQrcode.setBackground(new java.awt.Color(255, 255, 255));
lblQrcode.setText("QRCODE");
lblQrcode.setOpaque(true);
lblCodBarras.setBackground(new java.awt.Color(255, 255, 255));
lblCodBarras.setText("Cod Barras");
lblCodBarras.setOpaque(true);
lblCurso.setBackground(new java.awt.Color(235, 235, 235));
lblCurso.setForeground(new java.awt.Color(0, 0, 0));
lblCurso.setText("XXXXXXXXXXXXXXXXXXXX");
lblCurso.setOpaque(true);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(7, 7, 7)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblInstituicao, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(lblFoto, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(6, 6, 6)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel7)
.addGap(6, 6, 6)
.addComponent(lblId))
.addComponent(jLabel9)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(4, 4, 4)
.addComponent(lblCurso, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addGap(4, 4, 4)
.addComponent(lblLogo, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(13, 13, 13)
.addComponent(jLabel6)
.addGap(6, 6, 6)
.addComponent(lblNome, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(7, 7, 7)
.addComponent(lblAcesso)
.addGap(26, 26, 26)
.addComponent(lblCodBarras, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(12, 12, 12)
.addComponent(lblQrcode, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(6, 6, 6)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(lblInstituicao, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(6, 6, 6)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(2, 2, 2)
.addComponent(lblFoto, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblId, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(10, 10, 10)
.addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(6, 6, 6)
.addComponent(lblCurso))))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(5, 5, 5)
.addComponent(lblLogo, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(6, 6, 6)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(2, 2, 2)
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(lblNome))
.addGap(6, 6, 6)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(3, 3, 3)
.addComponent(lblAcesso, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(1, 1, 1)
.addComponent(lblCodBarras, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(lblQrcode, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))
);
btnPrint.setText("Imprimir");
btnPrint.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnPrintActionPerformed(evt);
}
});
jButton3.setText("Fechar");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
btnSave.setText("Salvar");
btnSave.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSaveActionPerformed(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()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(26, 26, 26)
.addComponent(btnSave)
.addGap(18, 18, 18)
.addComponent(btnPrint, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(18, 18, 18))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnSave)
.addComponent(btnPrint)
.addComponent(jButton3))
.addContainerGap(16, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btnPrintActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrintActionPerformed
PrinterJob job = PrinterJob.getPrinterJob();
// It is first called to tell it what object will print each page.
job.setPrintable(new PrintObject());
// Then it is called to display the standard print options dialog.
if (job.printDialog())
{
// If the user has pressed OK (printDialog returns true), then go
// ahead with the printing. This is started by the simple call to
// the job print() method. When it runs, it calls the page print
// object for page index 0. Then page index 1, 2, and so on
// until NO_SUCH_PAGE is returned.
try { job.print(); }
catch (PrinterException e) { System.out.println(e); }
}
}//GEN-LAST:event_btnPrintActionPerformed
private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed
try {
String msg = lblId.getText();
salvaImagemCartao(jPanel1, "C:\\Librography\\images\\cards\\" + msg + ".png");
} catch (Exception ex) {
Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_btnSaveActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
super.dispose();
}//GEN-LAST:event_jButton3ActionPerformed
private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
// TODO add your handling code here:
}//GEN-LAST:event_formWindowActivated
/**
* @param args the command line arguments
*/
public static void main(String args[]) throws UnsupportedLookAndFeelException {
/* 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(FormCartao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(FormCartao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(FormCartao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FormCartao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
// BasicLookAndFeel darcula = new DarculaLaf();
// UIManager.setLookAndFeel(darcula);
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new FormCartao().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnPrint;
private javax.swing.JButton btnSave;
private javax.swing.JButton jButton3;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel9;
private javax.swing.JLayeredPane jLayeredPane1;
private javax.swing.JPanel jPanel1;
private javax.swing.JLabel lblAcesso;
private javax.swing.JLabel lblCodBarras;
private javax.swing.JLabel lblCurso;
private javax.swing.JLabel lblFoto;
private javax.swing.JLabel lblId;
private javax.swing.JLabel lblInstituicao;
private javax.swing.JLabel lblLogo;
private javax.swing.JLabel lblNome;
private javax.swing.JLabel lblQrcode;
// End of variables declaration//GEN-END:variables
//jPanel1.setLayout(new OverlayLayout(panel));
private ImageIcon ResizeIdImage(String imgPath) { //192x261
int imageX = 65;
int imageY = 73;
lblFoto.setSize(imageX, imageY);
ImageIcon myImage = new ImageIcon(imgPath);
Image img = myImage.getImage();
Image newImage = img.getScaledInstance(lblFoto.getWidth(), lblFoto.getHeight(), Image.SCALE_SMOOTH);
ImageIcon image = new ImageIcon(newImage);
return image;
}
private ImageIcon ResizeLogoImage(String imgPath) { //192x261
int imageX = 84;
int imageY = 83;
lblLogo.setSize(imageX, imageY);
ImageIcon myImage = new ImageIcon(imgPath);
Image img = myImage.getImage();
Image newImage = img.getScaledInstance(lblLogo.getWidth(), lblLogo.getHeight(), Image.SCALE_SMOOTH);
ImageIcon image = new ImageIcon(newImage);
return image;
}
private ImageIcon ResizeQrCodeImage(String imgPath) { //192x261
int imageX = 50;
int imageY = 50;
lblQrcode.setSize(imageX, imageY);
ImageIcon myImage = new ImageIcon(imgPath);
Image img = myImage.getImage();
Image newImage = img.getScaledInstance(lblQrcode.getWidth(), lblQrcode.getHeight(), Image.SCALE_SMOOTH);
ImageIcon image = new ImageIcon(newImage);
return image;
}
private ImageIcon ResizeBarCodeImage(String imgPath) { //192x261
int imageX = 113;
int imageY = 50;
lblCodBarras.setSize(imageX, imageY);
ImageIcon myImage = new ImageIcon(imgPath);
Image img = myImage.getImage();
Image newImage = img.getScaledInstance(lblCodBarras.getWidth(), lblCodBarras.getHeight(), Image.SCALE_SMOOTH);
ImageIcon image = new ImageIcon(newImage);
return image;
}
}
@@ -0,0 +1,458 @@
<?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="2"/>
<Property name="title" type="java.lang.String" value="DETALHES DO LIVRO"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/>
</Events>
<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" alignment="0" attributes="0">
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel14" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="lblSecao" min="-2" pref="289" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel12" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="lblPiso" min="-2" pref="146" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel13" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lblPosicao" min="-2" pref="125" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel11" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lblCorredor" min="-2" pref="115" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="363" max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel15" min="-2" max="-2" attributes="0"/>
<Component id="jScrollPane1" min="-2" pref="424" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="lblFoto" min="-2" pref="132" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="6" pref="6" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="lblTitulo" min="-2" pref="414" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="lblAutor" min="-2" pref="414" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="23" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="lblAno" min="-2" pref="53" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Component id="lblEditora" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="200" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel9" min="-2" max="-2" attributes="0"/>
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
<Component id="lblIdioma" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="lblFornecedor" min="-2" pref="231" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="65" max="-2" attributes="0"/>
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lblSerie" min="-2" pref="112" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="lblIsbn" min="-2" pref="128" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="86" pref="86" max="-2" attributes="0"/>
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lblEdicao" min="-2" pref="53" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="15" pref="15" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Group type="102" attributes="0">
<Component id="lblFoto" min="-2" pref="208" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel12" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblPiso" alignment="3" min="-2" pref="24" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblCorredor" alignment="3" min="-2" pref="24" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="lblPosicao" alignment="3" min="-2" pref="24" max="-2" attributes="0"/>
<Component id="jLabel13" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblTitulo" alignment="3" min="-2" pref="24" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="lblAutor" alignment="3" min="-2" pref="24" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblEditora" alignment="3" min="-2" pref="24" max="-2" attributes="0"/>
</Group>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="lblSerie" alignment="3" min="-2" pref="24" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblAno" alignment="3" min="-2" pref="24" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblEdicao" alignment="3" min="-2" pref="24" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblIsbn" alignment="3" min="-2" pref="24" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="lblIdioma" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblFornecedor" alignment="3" min="-2" pref="24" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Component id="jLabel15" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" min="-2" pref="127" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="lblSecao" alignment="3" min="-2" pref="24" max="-2" attributes="0"/>
<Component id="jLabel14" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="lblTitulo">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="18" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="T&#xed;tulo do Livro"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblFoto">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
<EtchetBorder bevelType="0">
<Color PropertyName="highlight" blue="c0" green="c0" id="lightGray" palette="1" red="c0" type="palette"/>
<Color PropertyName="shadow" blue="40" green="40" id="darkGray" palette="1" red="40" type="palette"/>
</EtchetBorder>
</Border>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="T&#xed;tulo:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblSerie">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="XXXX"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="text" type="java.lang.String" value="Autor:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="text" type="java.lang.String" value="Fornecedor:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="text" type="java.lang.String" value="S&#xe9;rie:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="text" type="java.lang.String" value="ISBN/ISSN:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="text" type="java.lang.String" value="Edi&#xe7;&#xe3;o:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel8">
<Properties>
<Property name="text" type="java.lang.String" value="Editora:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel9">
<Properties>
<Property name="text" type="java.lang.String" value="Idioma:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel10">
<Properties>
<Property name="text" type="java.lang.String" value="Ano:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel11">
<Properties>
<Property name="text" type="java.lang.String" value="Corredor:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel12">
<Properties>
<Property name="text" type="java.lang.String" value="Piso:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel13">
<Properties>
<Property name="text" type="java.lang.String" value="Posi&#xe7;&#xe3;o:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel14">
<Properties>
<Property name="text" type="java.lang.String" value="Se&#xe7;&#xe3;o:"/>
</Properties>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="txtObservacoes">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="columns" type="int" value="20"/>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="66" green="66" red="66" type="rgb"/>
</Property>
<Property name="rows" type="int" value="5"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="jLabel15">
<Properties>
<Property name="text" type="java.lang.String" value="Observa&#xe7;&#xf5;es:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblAutor">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="Autor"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblEditora">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="EDITORA"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblIsbn">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="XXXXXXXXXXXXX"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblSecao">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="SE&#xc7;&#xc3;O"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblAno">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="XXXX"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblEdicao">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="XXXX"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblFornecedor">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="Fornecedor"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblIdioma">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="IDIOMA"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblPiso">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="PISO"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblCorredor">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="CORREDOR"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblPosicao">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="POSI&#xc7;&#xc3;O"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jButton1">
<Properties>
<Property name="text" type="java.lang.String" value="Fechar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,432 @@
/*
* 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.
*/
package br.com.projeto.view;
import java.awt.Image;
import javax.swing.ImageIcon;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class FormDetalhesLivro extends javax.swing.JFrame {
/**
* Creates new form FormDetalhesLivro
*/
public FormDetalhesLivro() {
initComponents();
}
public FormDetalhesLivro(String msgTit, String msgAut, String msgEdt, String msgIsb, String msgAno, String msgSer, String msgEdc, String msgIdi, String msgFor, String msgPis, String msgCor, String msgPos, String msgSec, String msgObs) {
initComponents();
lblTitulo.setText(msgTit);
lblAutor.setText(msgAut);
lblEditora.setText(msgEdt);
lblIsbn.setText(msgIsb);
lblAno.setText(msgAno);
lblSerie.setText(msgSer);
lblEdicao.setText(msgEdc);
lblIdioma.setText(msgIdi);
lblFornecedor.setText(msgFor);
lblPiso.setText(msgPis);
lblCorredor.setText(msgCor);
lblPosicao.setText(msgPos);
lblSecao.setText(msgSec);
txtObservacoes.setText(msgObs);
// String img = Integer.toString(msgImg);
// System.out.println("img:" + img);
// System.out.println("msgImg:" + msgImg);
String path = "C:\\Librography\\images\\books\\" + msgIsb;
lblFoto.setIcon(ResizeBookImage(path));
}
/**
* 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() {
lblTitulo = new javax.swing.JLabel();
lblFoto = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
lblSerie = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
txtObservacoes = new javax.swing.JTextArea();
jLabel15 = new javax.swing.JLabel();
lblAutor = new javax.swing.JLabel();
lblEditora = new javax.swing.JLabel();
lblIsbn = new javax.swing.JLabel();
lblSecao = new javax.swing.JLabel();
lblAno = new javax.swing.JLabel();
lblEdicao = new javax.swing.JLabel();
lblFornecedor = new javax.swing.JLabel();
lblIdioma = new javax.swing.JLabel();
lblPiso = new javax.swing.JLabel();
lblCorredor = new javax.swing.JLabel();
lblPosicao = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("DETALHES DO LIVRO");
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowActivated(java.awt.event.WindowEvent evt) {
formWindowActivated(evt);
}
});
lblTitulo.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
lblTitulo.setText("Título do Livro");
lblFoto.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, java.awt.Color.lightGray, java.awt.Color.darkGray));
jLabel2.setText("Título:");
lblSerie.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
lblSerie.setText("XXXX");
jLabel3.setText("Autor:");
jLabel4.setText("Fornecedor:");
jLabel5.setText("Série:");
jLabel6.setText("ISBN/ISSN:");
jLabel7.setText("Edição:");
jLabel8.setText("Editora:");
jLabel9.setText("Idioma:");
jLabel10.setText("Ano:");
jLabel11.setText("Corredor:");
jLabel12.setText("Piso:");
jLabel13.setText("Posição:");
jLabel14.setText("Seção:");
txtObservacoes.setEditable(false);
txtObservacoes.setColumns(20);
txtObservacoes.setForeground(new java.awt.Color(102, 102, 102));
txtObservacoes.setRows(5);
jScrollPane1.setViewportView(txtObservacoes);
jLabel15.setText("Observações:");
lblAutor.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
lblAutor.setText("Autor");
lblEditora.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
lblEditora.setText("EDITORA");
lblIsbn.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
lblIsbn.setText("XXXXXXXXXXXXX");
lblSecao.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
lblSecao.setText("SEÇÃO");
lblAno.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
lblAno.setText("XXXX");
lblEdicao.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
lblEdicao.setText("XXXX");
lblFornecedor.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
lblFornecedor.setText("Fornecedor");
lblIdioma.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
lblIdioma.setText("IDIOMA");
lblPiso.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
lblPiso.setText("PISO");
lblCorredor.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
lblCorredor.setText("CORREDOR");
lblPosicao.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
lblPosicao.setText("POSIÇÃO");
jButton1.setText("Fechar");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(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()
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel14)
.addGap(18, 18, 18)
.addComponent(lblSecao, javax.swing.GroupLayout.PREFERRED_SIZE, 289, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel12)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lblPiso, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel13)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblPosicao, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel11)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblCorredor, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(363, 363, 363)
.addComponent(jButton1))
.addGroup(layout.createSequentialGroup()
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel15)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 424, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addComponent(lblFoto, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(6, 6, 6)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(lblTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 414, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3)
.addGap(18, 18, 18)
.addComponent(lblAutor, javax.swing.GroupLayout.PREFERRED_SIZE, 414, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(23, 23, 23))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(lblAno, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(lblEditora, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(200, 200, 200))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel9)
.addComponent(jLabel10))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(12, 12, 12)
.addComponent(lblIdioma, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel4)
.addGap(18, 18, 18)
.addComponent(lblFornecedor, javax.swing.GroupLayout.PREFERRED_SIZE, 231, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(65, 65, 65)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblSerie, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(lblIsbn, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(86, 86, 86)
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblEdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(0, 0, Short.MAX_VALUE)))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(15, 15, 15)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(layout.createSequentialGroup()
.addComponent(lblFoto, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel12)
.addComponent(lblPiso, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel11)
.addComponent(lblCorredor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblPosicao, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel13)))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(lblTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblAutor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel8)
.addComponent(lblEditora, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(8, 8, 8)
.addComponent(jLabel10))
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblSerie, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5)
.addComponent(lblAno, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(lblEdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(lblIsbn, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblIdioma)
.addComponent(jLabel9)
.addComponent(jLabel4)
.addComponent(lblFornecedor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel15)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblSecao, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel14)
.addComponent(jButton1))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
}//GEN-LAST:event_formWindowActivated
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
super.dispose();
}//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(FormDetalhesLivro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(FormDetalhesLivro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(FormDetalhesLivro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FormDetalhesLivro.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 FormDetalhesLivro().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JLabel lblAno;
private javax.swing.JLabel lblAutor;
private javax.swing.JLabel lblCorredor;
private javax.swing.JLabel lblEdicao;
private javax.swing.JLabel lblEditora;
private javax.swing.JLabel lblFornecedor;
private javax.swing.JLabel lblFoto;
private javax.swing.JLabel lblIdioma;
private javax.swing.JLabel lblIsbn;
private javax.swing.JLabel lblPiso;
private javax.swing.JLabel lblPosicao;
private javax.swing.JLabel lblSecao;
private javax.swing.JLabel lblSerie;
private javax.swing.JLabel lblTitulo;
private javax.swing.JTextArea txtObservacoes;
// End of variables declaration//GEN-END:variables
private ImageIcon ResizeBookImage(String imgPath) { //192x261
int imageX = 132;
int imageY = 208;
lblFoto.setSize(imageX, imageY);
ImageIcon myImage = new ImageIcon(imgPath);
Image img = myImage.getImage();
Image newImage = img.getScaledInstance(lblFoto.getWidth(), lblFoto.getHeight(), Image.SCALE_SMOOTH);
ImageIcon image = new ImageIcon(newImage);
return image;
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,707 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/>
</Events>
<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" max="32767" attributes="0"/>
<Component id="tabbedFrameF" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="btnImprimir" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="29" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="tabbedFrameF" max="32767" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="btnImprimir" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="33" green="33" red="33" type="rgb"/>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel1" alignment="1" pref="72" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="24" style="0"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="Cadastro de Fornecedores"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JTabbedPane" name="tabbedFrameF">
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="tabConsultaUsuarios">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Consulta de Fornecedores">
<Property name="tabTitle" type="java.lang.String" value="Consulta de Fornecedores"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="25" max="-2" attributes="0"/>
<Component id="jLabel14" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtPesquisaFornecedor" min="-2" pref="282" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="btnPesquisar" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="428" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel14" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtPesquisaFornecedor" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnPesquisar" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" min="-2" pref="208" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel14">
<Properties>
<Property name="text" type="java.lang.String" value="Nome:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtPesquisaFornecedor">
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtPesquisaFornecedorActionPerformed"/>
<EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtPesquisaFornecedorKeyReleased"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnPesquisar">
<Properties>
<Property name="text" type="java.lang.String" value="Pesquisar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnPesquisarActionPerformed"/>
<EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="btnPesquisarKeyReleased"/>
</Events>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="tabelaFornecedor">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
<Table columnCount="13" rowCount="0">
<Column editable="false" title="cod" type="java.lang.Object"/>
<Column editable="false" title="nome" type="java.lang.Object"/>
<Column editable="false" title="cnpj" type="java.lang.Object"/>
<Column editable="false" title="email" type="java.lang.Object"/>
<Column editable="false" title="telefone" type="java.lang.Object"/>
<Column editable="false" title="celular" type="java.lang.Object"/>
<Column editable="false" title="cep" type="java.lang.Object"/>
<Column editable="false" title="endereco" type="java.lang.Object"/>
<Column editable="false" title="numero" type="java.lang.Object"/>
<Column editable="false" title="complemento" type="java.lang.Object"/>
<Column editable="false" title="bairro" type="java.lang.Object"/>
<Column editable="false" title="cidade" type="java.lang.Object"/>
<Column editable="false" title="estado" type="java.lang.Object"/>
</Table>
</Property>
<Property name="autoResizeMode" type="int" value="4"/>
<Property name="autoscrolls" type="boolean" value="false"/>
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
<TableColumnModel selectionModel="0">
<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>
<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>
<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>
<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="false" resizingAllowed="true"/>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tabelaFornecedorMouseClicked"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="tabCadastro">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Cadastro de Fornecedores">
<Property name="tabTitle" type="java.lang.String" value="Cadastro de Fornecedores"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<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" attributes="0">
<EmptySpace min="-2" pref="312" max="-2" attributes="0"/>
<Component id="jLabel18" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="33" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel2" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="txtCnpj" min="-2" pref="165" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jLabel12" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtCelular" min="-2" pref="109" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel9" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtTelefone" min="-2" pref="125" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="txtId" min="-2" pref="59" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtNome" min="-2" pref="247" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtEmail" min="-2" pref="280" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="11" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel19" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtCep" min="-2" pref="111" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="46" max="-2" attributes="0"/>
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtEndereco" min="-2" pref="258" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtNum" min="-2" pref="45" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel13" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtComplemento" min="-2" pref="204" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtBairro" min="-2" pref="189" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel16" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtCidade" min="-2" pref="171" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="boxUf" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel21" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="53" max="-2" attributes="0"/>
<Component id="btnNovo" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="btnSalvar" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnExcluir" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</Group>
</Group>
<EmptySpace pref="64" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtId" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtNome" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtEmail" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel12" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtCelular" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtTelefone" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel10" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtCnpj" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace pref="47" max="32767" attributes="0"/>
<Component id="jLabel18" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="159" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel19" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtEndereco" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtNum" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtCep" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel13" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtComplemento" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtBairro" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel16" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtCidade" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="boxUf" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel21" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" max="-2" attributes="0">
<Component id="btnNovo" alignment="3" max="32767" attributes="0"/>
<Component id="btnSalvar" alignment="3" max="32767" attributes="0"/>
<Component id="btnExcluir" alignment="3" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="ID:"/>
</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="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="*Nome:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Email:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Logradouro:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="UF:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="N:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel8">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Bairro:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel9">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="*Telefone:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel10">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="*CNPJ:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel12">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Celular:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel13">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Complemento:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel16">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="*Cidade:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtNome">
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtNomeActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JTextField" name="txtEmail">
</Component>
<Component class="javax.swing.JTextField" name="txtEndereco">
</Component>
<Component class="javax.swing.JTextField" name="txtNum">
</Component>
<Component class="javax.swing.JTextField" name="txtComplemento">
</Component>
<Component class="javax.swing.JTextField" name="txtBairro">
</Component>
<Component class="javax.swing.JTextField" name="txtCidade">
</Component>
<Component class="javax.swing.JTextField" name="txtId">
<Properties>
<Property name="editable" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtIdActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel18">
</Component>
<Component class="javax.swing.JLabel" name="jLabel19">
<Properties>
<Property name="text" type="java.lang.String" value="CEP:"/>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="boxUf">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="27">
<StringItem index="0" value="AC"/>
<StringItem index="1" value="AL"/>
<StringItem index="2" value="AP"/>
<StringItem index="3" value="AM"/>
<StringItem index="4" value="BA"/>
<StringItem index="5" value="CE"/>
<StringItem index="6" value="DF"/>
<StringItem index="7" value="ES"/>
<StringItem index="8" value="GO"/>
<StringItem index="9" value="MA"/>
<StringItem index="10" value="MT"/>
<StringItem index="11" value="MS"/>
<StringItem index="12" value="MG"/>
<StringItem index="13" value="PA"/>
<StringItem index="14" value="PB"/>
<StringItem index="15" value="PR"/>
<StringItem index="16" value="PE"/>
<StringItem index="17" value="PI"/>
<StringItem index="18" value="RJ"/>
<StringItem index="19" value="RN"/>
<StringItem index="20" value="RS"/>
<StringItem index="21" value="RO"/>
<StringItem index="22" value="RR"/>
<StringItem index="23" value="SC"/>
<StringItem index="24" value="SP"/>
<StringItem index="25" value="SE"/>
<StringItem index="26" value="TO"/>
</StringArray>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JFormattedTextField" name="txtCep">
<Properties>
<Property name="formatterFactory" type="javax.swing.JFormattedTextField$AbstractFormatterFactory" editor="org.netbeans.modules.form.editors.AbstractFormatterFactoryEditor" preCode="try {" postCode="} catch (java.text.ParseException ex) {&#xa;ex.printStackTrace();&#xa;}">
<Format format="#####-###" subtype="-1" type="5"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JFormattedTextField" name="txtCelular">
<Properties>
<Property name="formatterFactory" type="javax.swing.JFormattedTextField$AbstractFormatterFactory" editor="org.netbeans.modules.form.editors.AbstractFormatterFactoryEditor" preCode="try {" postCode="} catch (java.text.ParseException ex) {&#xa;ex.printStackTrace();&#xa;}">
<Format format="(##)#####-####" subtype="-1" type="5"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JFormattedTextField" name="txtTelefone">
<Properties>
<Property name="formatterFactory" type="javax.swing.JFormattedTextField$AbstractFormatterFactory" editor="org.netbeans.modules.form.editors.AbstractFormatterFactoryEditor" preCode="try {" postCode="} catch (java.text.ParseException ex) {&#xa;ex.printStackTrace();&#xa;}">
<Format format="(##)####-####" subtype="-1" type="5"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JFormattedTextField" name="txtCnpj">
<Properties>
<Property name="formatterFactory" type="javax.swing.JFormattedTextField$AbstractFormatterFactory" editor="org.netbeans.modules.form.editors.AbstractFormatterFactoryEditor" preCode="try {" postCode="} catch (java.text.ParseException ex) {&#xa;ex.printStackTrace();&#xa;}">
<Format format="##.###.###/####-##" subtype="-1" type="5"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="btnNovo">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="14" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/new_file_small.png"/>
</Property>
<Property name="text" type="java.lang.String" value="NOVO"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnNovoActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnSalvar">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="14" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/save_small.png"/>
</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="btnSalvarActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnExcluir">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="14" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/delete_small.png"/>
</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="btnExcluirActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel21">
<Properties>
<Property name="text" type="java.lang.String" value="Campos marcados com * s&#xe3;o de preenchimento obrig&#xe1;t&#xf3;rio!"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jButton1">
<Properties>
<Property name="text" type="java.lang.String" value="Buscar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="btnImprimir">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="14" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"/>
</Property>
<Property name="text" type="java.lang.String" value="FECHAR"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnImprimirActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,781 @@
/*
* 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.
*/
//mude para vizualizacao por projeto para adicionar action
package br.com.projeto.view;
import br.com.parg.viacep.ViaCEP;
import br.com.parg.viacep.ViaCEPException;
import br.com.projeto.dao.FornecedorDao;
import br.com.projeto.model.Fornecedor;
import br.com.projeto.model.Utilitarios;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class FormFornecedores extends javax.swing.JFrame {
//metodo listar usuarios pt3
public void listarFunc() {
FornecedorDao dao = new FornecedorDao();
List<Fornecedor> lista = dao.listarFornecedores();
DefaultTableModel dados = (DefaultTableModel) tabelaFornecedor.getModel();
dados.setNumRows(0);
for (Fornecedor c : lista) {
dados.addRow(new Object[]{
c.getId(),
c.getNome(),
c.getCnpj(),
c.getEmail(),
c.getTelefone(),
c.getCelular(),
c.getCep(),
c.getEndereco(),
c.getNumero(),
c.getComplemento(),
c.getBairro(),
c.getCidade(),
c.getUf(),});
}
}
/**
* Creates new form formLeitor
*/
public FormFornecedores() {
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();
jLabel1 = new javax.swing.JLabel();
tabbedFrameF = new javax.swing.JTabbedPane();
tabConsultaUsuarios = new javax.swing.JPanel();
jLabel14 = new javax.swing.JLabel();
txtPesquisaFornecedor = new javax.swing.JTextField();
btnPesquisar = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
tabelaFornecedor = new javax.swing.JTable();
tabCadastro = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
jLabel16 = new javax.swing.JLabel();
txtNome = new javax.swing.JTextField();
txtEmail = new javax.swing.JTextField();
txtEndereco = new javax.swing.JTextField();
txtNum = new javax.swing.JTextField();
txtComplemento = new javax.swing.JTextField();
txtBairro = new javax.swing.JTextField();
txtCidade = new javax.swing.JTextField();
txtId = new javax.swing.JTextField();
jLabel18 = new javax.swing.JLabel();
jLabel19 = new javax.swing.JLabel();
boxUf = new javax.swing.JComboBox<>();
txtCep = new javax.swing.JFormattedTextField();
txtCelular = new javax.swing.JFormattedTextField();
txtTelefone = new javax.swing.JFormattedTextField();
txtCnpj = new javax.swing.JFormattedTextField();
btnNovo = new javax.swing.JButton();
btnSalvar = new javax.swing.JButton();
btnExcluir = new javax.swing.JButton();
jLabel21 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
btnImprimir = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowActivated(java.awt.event.WindowEvent evt) {
formWindowActivated(evt);
}
});
jPanel1.setBackground(new java.awt.Color(51, 51, 51));
jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
jLabel1.setForeground(new java.awt.Color(255, 255, 255));
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("Cadastro de Fornecedores");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE)
);
jLabel14.setText("Nome:");
txtPesquisaFornecedor.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtPesquisaFornecedorActionPerformed(evt);
}
});
txtPesquisaFornecedor.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtPesquisaFornecedorKeyReleased(evt);
}
});
btnPesquisar.setText("Pesquisar");
btnPesquisar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnPesquisarActionPerformed(evt);
}
});
btnPesquisar.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
btnPesquisarKeyReleased(evt);
}
});
tabelaFornecedor.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"cod", "nome", "cnpj", "email", "telefone", "celular", "cep", "endereco", "numero", "complemento", "bairro", "cidade", "estado"
}
) {
boolean[] canEdit = new boolean [] {
false, false, false, false, false, false, false, false, false, false, false, false, false
};
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
tabelaFornecedor.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);
tabelaFornecedor.setAutoscrolls(false);
tabelaFornecedor.getTableHeader().setReorderingAllowed(false);
tabelaFornecedor.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tabelaFornecedorMouseClicked(evt);
}
});
jScrollPane1.setViewportView(tabelaFornecedor);
javax.swing.GroupLayout tabConsultaUsuariosLayout = new javax.swing.GroupLayout(tabConsultaUsuarios);
tabConsultaUsuarios.setLayout(tabConsultaUsuariosLayout);
tabConsultaUsuariosLayout.setHorizontalGroup(
tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabConsultaUsuariosLayout.createSequentialGroup()
.addGap(25, 25, 25)
.addComponent(jLabel14)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtPesquisaFornecedor, javax.swing.GroupLayout.PREFERRED_SIZE, 282, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(btnPesquisar)
.addContainerGap(428, Short.MAX_VALUE))
.addGroup(tabConsultaUsuariosLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1)
.addContainerGap())
);
tabConsultaUsuariosLayout.setVerticalGroup(
tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabConsultaUsuariosLayout.createSequentialGroup()
.addGap(10, 10, 10)
.addGroup(tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel14)
.addComponent(txtPesquisaFornecedor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnPesquisar))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
tabbedFrameF.addTab("Consulta de Fornecedores", tabConsultaUsuarios);
jLabel2.setText("ID:");
jLabel3.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel3.setText("*Nome:");
jLabel4.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel4.setText("Email:");
jLabel5.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel5.setText("Logradouro:");
jLabel6.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel6.setText("UF:");
jLabel7.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel7.setText("N:");
jLabel8.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel8.setText("Bairro:");
jLabel9.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel9.setText("*Telefone:");
jLabel10.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel10.setText("*CNPJ:");
jLabel12.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel12.setText("Celular:");
jLabel13.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel13.setText("Complemento:");
jLabel16.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel16.setText("*Cidade:");
txtNome.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtNomeActionPerformed(evt);
}
});
txtId.setEditable(false);
txtId.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtIdActionPerformed(evt);
}
});
jLabel19.setText("CEP:");
boxUf.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO" }));
try {
txtCep.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("#####-###")));
} catch (java.text.ParseException ex) {
ex.printStackTrace();
}
try {
txtCelular.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##)#####-####")));
} catch (java.text.ParseException ex) {
ex.printStackTrace();
}
try {
txtTelefone.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##)####-####")));
} catch (java.text.ParseException ex) {
ex.printStackTrace();
}
try {
txtCnpj.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##.###.###/####-##")));
} catch (java.text.ParseException ex) {
ex.printStackTrace();
}
btnNovo.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
btnNovo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/new_file_small.png"))); // NOI18N
btnNovo.setText("NOVO");
btnNovo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnNovoActionPerformed(evt);
}
});
btnSalvar.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
btnSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/save_small.png"))); // NOI18N
btnSalvar.setText("SALVAR");
btnSalvar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSalvarActionPerformed(evt);
}
});
btnExcluir.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
btnExcluir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/delete_small.png"))); // NOI18N
btnExcluir.setText("EXCLUIR");
btnExcluir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnExcluirActionPerformed(evt);
}
});
jLabel21.setText("Campos marcados com * são de preenchimento obrigátório!");
jButton1.setText("Buscar");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout tabCadastroLayout = new javax.swing.GroupLayout(tabCadastro);
tabCadastro.setLayout(tabCadastroLayout);
tabCadastroLayout.setHorizontalGroup(
tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabCadastroLayout.createSequentialGroup()
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabCadastroLayout.createSequentialGroup()
.addGap(312, 312, 312)
.addComponent(jLabel18))
.addGroup(tabCadastroLayout.createSequentialGroup()
.addGap(33, 33, 33)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabCadastroLayout.createSequentialGroup()
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel2)
.addComponent(jLabel10))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabCadastroLayout.createSequentialGroup()
.addComponent(txtCnpj, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel12)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtCelular, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel9)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(tabCadastroLayout.createSequentialGroup()
.addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtNome, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGroup(tabCadastroLayout.createSequentialGroup()
.addGap(11, 11, 11)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabCadastroLayout.createSequentialGroup()
.addComponent(jLabel19)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtCep, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jButton1)
.addGap(46, 46, 46)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, 258, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtNum, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(tabCadastroLayout.createSequentialGroup()
.addComponent(jLabel13)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtComplemento, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtBairro, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(tabCadastroLayout.createSequentialGroup()
.addComponent(jLabel16)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtCidade, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(boxUf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(tabCadastroLayout.createSequentialGroup()
.addComponent(jLabel21)
.addGap(53, 53, 53)
.addComponent(btnNovo)
.addGap(18, 18, 18)
.addComponent(btnSalvar)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnExcluir)))))))
.addContainerGap(64, Short.MAX_VALUE))
);
tabCadastroLayout.setVerticalGroup(
tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabCadastroLayout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3)
.addComponent(txtNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4)
.addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel12)
.addComponent(jLabel9)
.addComponent(txtCelular, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel10)
.addComponent(txtCnpj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabCadastroLayout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 47, Short.MAX_VALUE)
.addComponent(jLabel18)
.addGap(159, 159, 159))
.addGroup(tabCadastroLayout.createSequentialGroup()
.addGap(18, 18, 18)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel19)
.addComponent(jLabel5)
.addComponent(txtEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel7)
.addComponent(txtNum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtCep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton1))
.addGap(18, 18, 18)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel13)
.addComponent(txtComplemento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel8)
.addComponent(txtBairro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel16)
.addComponent(txtCidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6)
.addComponent(boxUf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel21)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE, false)
.addComponent(btnNovo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnSalvar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnExcluir, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))))
);
tabbedFrameF.addTab("Cadastro de Fornecedores", tabCadastro);
btnImprimir.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
btnImprimir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"))); // NOI18N
btnImprimir.setText("FECHAR");
btnImprimir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnImprimirActionPerformed(evt);
}
});
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)
.addComponent(tabbedFrameF)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnImprimir)
.addGap(29, 29, 29))
);
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)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(tabbedFrameF)
.addGap(18, 18, 18)
.addComponent(btnImprimir, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btnSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarActionPerformed
// salvar usuario
Fornecedor obj = new Fornecedor();
obj.setNome(txtNome.getText());
obj.setCnpj(txtCnpj.getText());
obj.setEmail(txtEmail.getText());
obj.setTelefone(txtTelefone.getText());
obj.setCelular(txtCelular.getText());
obj.setCep(txtCep.getText());
obj.setEndereco(txtEndereco.getText());
obj.setNumero(txtNum.getText());
obj.setComplemento(txtComplemento.getText());
obj.setBairro(txtBairro.getText());
obj.setCidade(txtCidade.getText());
obj.setUf(boxUf.getSelectedItem().toString());
FornecedorDao dao = new FornecedorDao();
if (txtNome.getText().isEmpty() || txtCelular.getText().isEmpty() || txtCnpj.getText().isEmpty() || txtTelefone.getText().isEmpty() || txtCidade.getText().isEmpty()) {
JOptionPane.showMessageDialog(null, "Campos com * são de preenchimento obrigatório!");
} else {
Utilitarios util = new Utilitarios();
boolean valido = util.validaCnpj(txtCnpj.getText());
if (!txtCnpj.getText().equals("00.000.000/0000-00") && !valido == true && !txtCnpj.getText().equals(" . . / - ")) {
JOptionPane.showMessageDialog(null, "CNPJ Inválido! Tente Novamente!");
return;
}
if (!(txtId.getText()).equals("")) {
obj.setId(Integer.valueOf(txtId.getText()));
dao.alterarFornecedor(obj);
} else {
dao.cadastrarFornecedor(obj);
}
}
}//GEN-LAST:event_btnSalvarActionPerformed
private void btnImprimirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnImprimirActionPerformed
this.dispose();
}//GEN-LAST:event_btnImprimirActionPerformed
private void txtPesquisaFornecedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPesquisaFornecedorActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_txtPesquisaFornecedorActionPerformed
private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
// listar suario pt4
listarFunc();
}//GEN-LAST:event_formWindowActivated
private void btnExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirActionPerformed
// excluir
Fornecedor obj = new Fornecedor();
try {
obj.setId(Integer.valueOf(txtId.getText()));
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Aviso! Selecione um Fornecedor!");
}
FornecedorDao dao = new FornecedorDao();
dao.excluirFornecedor(obj);
}//GEN-LAST:event_btnExcluirActionPerformed
//TODO parei aqui
private void tabelaFornecedorMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaFornecedorMouseClicked
// tabela quando clicado
DefaultTableModel model = (DefaultTableModel) tabelaFornecedor.getModel();
int selectedRowIndex = tabelaFornecedor.getSelectedRow();
if ( model.getValueAt(selectedRowIndex, 0) != null) {
txtId.setText(model.getValueAt(selectedRowIndex, 0).toString());}
if ( model.getValueAt(selectedRowIndex, 1) != null) {
txtNome.setText(model.getValueAt(selectedRowIndex, 1).toString());}
if ( model.getValueAt(selectedRowIndex, 2)!= null) {
txtCnpj.setText(model.getValueAt(selectedRowIndex, 2).toString());}
if ( model.getValueAt(selectedRowIndex, 3) != null) {
txtEmail.setText(model.getValueAt(selectedRowIndex, 3).toString());}
if ( model.getValueAt(selectedRowIndex, 4) != null) {
txtTelefone.setText(model.getValueAt(selectedRowIndex, 4).toString());}
if ( model.getValueAt(selectedRowIndex, 5) != null ) {
txtCelular.setText(model.getValueAt(selectedRowIndex, 5).toString());}
if ( model.getValueAt(selectedRowIndex, 6) != null) {
txtCep.setText(model.getValueAt(selectedRowIndex, 6).toString());}
if ( model.getValueAt(selectedRowIndex, 7) != null) {
txtEndereco.setText(model.getValueAt(selectedRowIndex, 7).toString());}
if ( model.getValueAt(selectedRowIndex, 8) != null) {
txtNum.setText(model.getValueAt(selectedRowIndex, 8).toString());}
if ( model.getValueAt(selectedRowIndex, 9) != null) {
txtComplemento.setText(model.getValueAt(selectedRowIndex, 9).toString());}
if ( model.getValueAt(selectedRowIndex, 10) != null) {
txtBairro.setText(model.getValueAt(selectedRowIndex, 10).toString());}
if ( model.getValueAt(selectedRowIndex, 11) != null) {
txtCidade.setText(model.getValueAt(selectedRowIndex, 11).toString());}
if ( model.getValueAt(selectedRowIndex, 12) != null) {
boxUf.setSelectedItem(model.getValueAt(selectedRowIndex, 12).toString());}
//mouse click go to tab
tabbedFrameF.setSelectedIndex(1);
}//GEN-LAST:event_tabelaFornecedorMouseClicked
private void btnNovoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNovoActionPerformed
// TODO add your handling code here:
Utilitarios util = new Utilitarios();
util.limpaTela(tabCadastro);
}//GEN-LAST:event_btnNovoActionPerformed
private void txtIdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtIdActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_txtIdActionPerformed
private void txtNomeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNomeActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_txtNomeActionPerformed
private void btnPesquisarKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnPesquisarKeyReleased
// TODO add your handling code here:
}//GEN-LAST:event_btnPesquisarKeyReleased
private void txtPesquisaFornecedorKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtPesquisaFornecedorKeyReleased
// TODO add your handling code here:
String nome = "%" + txtPesquisaFornecedor.getText() + "%";
FornecedorDao dao = new FornecedorDao();
List<Fornecedor> lista = dao.pesquisarNomeFornecedores(nome);
DefaultTableModel dados = (DefaultTableModel) tabelaFornecedor.getModel();
dados.setNumRows(0); //limpa/zera pesquisa a cada digitacao
for (Fornecedor c : lista) {
dados.addRow(new Object[]{
c.getId(),
c.getNome(),
c.getCnpj(),
c.getEmail(),
c.getTelefone(),
c.getCelular(),
c.getCep(),
c.getEndereco(),
c.getNumero(),
c.getComplemento(),
c.getBairro(),
c.getCidade(),
c.getUf(),});
}
}//GEN-LAST:event_txtPesquisaFornecedorKeyReleased
private void btnPesquisarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPesquisarActionPerformed
// TODO add your handling code here:
String nome = txtNome.getText();
Fornecedor obj = new Fornecedor();
FornecedorDao dao = new FornecedorDao();
obj = dao.buscarFornecedor(nome);
if (obj.getNome() != null) {
txtId.setText(String.valueOf(obj.getId()));
txtNome.setText(obj.getNome());
txtCnpj.setText(obj.getCnpj());
txtEmail.setText(obj.getEmail());
txtTelefone.setText(obj.getTelefone());
txtCelular.setText(obj.getCelular());
txtCep.setText(obj.getCep());
txtEndereco.setText(obj.getEndereco());
txtNum.setText(obj.getNumero());
txtComplemento.setText(obj.getComplemento());
txtBairro.setText(obj.getBairro());
txtCidade.setText(obj.getCidade());
boxUf.setSelectedItem(obj.getUf());
} else {
JOptionPane.showMessageDialog(null, "Fornecedor não encontrado");
}
}//GEN-LAST:event_btnPesquisarActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
ViaCEP viacep = new ViaCEP();
try {
viacep.buscar(txtCep.getText());
txtBairro.setText(viacep.getBairro());
txtCidade.setText(viacep.getLocalidade());
txtEndereco.setText(viacep.getLogradouro());
boxUf.setSelectedItem(viacep.getUf());
} catch (ViaCEPException ex) {
Logger.getLogger(FormLeitor.class.getName()).log(Level.SEVERE, null, ex);
}
{
}
}//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(FormFornecedores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(FormFornecedores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(FormFornecedores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FormFornecedores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new FormFornecedores().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JComboBox<String> boxUf;
private javax.swing.JButton btnExcluir;
private javax.swing.JButton btnImprimir;
private javax.swing.JButton btnNovo;
private javax.swing.JButton btnPesquisar;
private javax.swing.JButton btnSalvar;
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel18;
private javax.swing.JLabel jLabel19;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel21;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JPanel tabCadastro;
private javax.swing.JPanel tabConsultaUsuarios;
private javax.swing.JTabbedPane tabbedFrameF;
private javax.swing.JTable tabelaFornecedor;
private javax.swing.JTextField txtBairro;
private javax.swing.JFormattedTextField txtCelular;
private javax.swing.JFormattedTextField txtCep;
private javax.swing.JTextField txtCidade;
private javax.swing.JFormattedTextField txtCnpj;
private javax.swing.JTextField txtComplemento;
private javax.swing.JTextField txtEmail;
private javax.swing.JTextField txtEndereco;
private javax.swing.JTextField txtId;
private javax.swing.JTextField txtNome;
private javax.swing.JTextField txtNum;
private javax.swing.JTextField txtPesquisaFornecedor;
private javax.swing.JFormattedTextField txtTelefone;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,840 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/>
</Events>
<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" max="32767" attributes="0"/>
<Component id="tabbedFrameF" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="btnFechar" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="tabbedFrameF" min="-2" pref="266" max="-2" attributes="0"/>
<EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
<Component id="btnFechar" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="33" green="33" red="33" type="rgb"/>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel1" alignment="1" pref="72" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="24" style="0"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="Cadastro de Funcion&#xe1;rios"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JTabbedPane" name="tabbedFrameF">
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="tabConsultaUsuarios">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Consulta de Funcion&#xe1;rios">
<Property name="tabTitle" type="java.lang.String" value="Consulta de Funcion&#xe1;rios"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="25" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jScrollPane1" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel14" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtPesquisaFuncionario" pref="307" max="32767" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="btnPesquisar" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="618" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel14" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtPesquisaFuncionario" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnPesquisar" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="38" max="-2" attributes="0"/>
<Component id="jScrollPane1" min="-2" pref="176" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel14">
<Properties>
<Property name="text" type="java.lang.String" value="Nome:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtPesquisaFuncionario">
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtPesquisaFuncionarioActionPerformed"/>
<EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtPesquisaFuncionarioKeyReleased"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnPesquisar">
<Properties>
<Property name="text" type="java.lang.String" value="Pesquisar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnPesquisarActionPerformed"/>
<EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="btnPesquisarKeyReleased"/>
</Events>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="tabelaFuncionario">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
<Table columnCount="17" rowCount="0">
<Column editable="false" title="cod" type="java.lang.Object"/>
<Column editable="false" title="nome" type="java.lang.Object"/>
<Column editable="false" title="rg" type="java.lang.Object"/>
<Column editable="false" title="cpf" type="java.lang.Object"/>
<Column editable="false" title="email" type="java.lang.Object"/>
<Column editable="false" title="senha" type="java.lang.Object"/>
<Column editable="false" title="cargo" type="java.lang.Object"/>
<Column editable="false" title="nivel_acesso" type="java.lang.Object"/>
<Column editable="false" title="telefone" type="java.lang.Object"/>
<Column editable="false" title="celular" type="java.lang.Object"/>
<Column editable="false" title="cep" type="java.lang.Object"/>
<Column editable="false" title="endereco" type="java.lang.Object"/>
<Column editable="false" title="numero" type="java.lang.Object"/>
<Column editable="false" title="complemento" type="java.lang.Object"/>
<Column editable="false" title="bairro" type="java.lang.Object"/>
<Column editable="false" title="cidade" type="java.lang.Object"/>
<Column editable="false" title="estado" type="java.lang.Object"/>
</Table>
</Property>
<Property name="autoResizeMode" type="int" value="4"/>
<Property name="autoscrolls" type="boolean" value="false"/>
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
<TableColumnModel selectionModel="0">
<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>
<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>
<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>
<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="false">
<Title/>
<Editor/>
<Renderer/>
</Column>
</TableColumnModel>
</Property>
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
<TableHeader reorderingAllowed="false" resizingAllowed="true"/>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tabelaFuncionarioMouseClicked"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="tabCadastro">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Cadastro deFuncion&#xe1;rios">
<Property name="tabTitle" type="java.lang.String" value="Cadastro deFuncion&#xe1;rios"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel19" min="-2" max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="txtCep" min="-2" pref="111" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtEndereco" min="-2" pref="258" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtNum" min="-2" pref="45" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="txtBairro" min="-2" pref="189" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel16" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtCidade" min="-2" pref="171" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<EmptySpace min="6" pref="6" max="-2" attributes="0"/>
<Component id="jLabel21" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="25" max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="boxUf" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel13" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtComplemento" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="307" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="btnNovo" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="btnSalvar" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="btnExcluir" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="312" max="-2" attributes="0"/>
<Component id="jLabel18" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="33" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="6" pref="6" max="-2" attributes="0"/>
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtEmail" min="-2" pref="280" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtCpf" min="-2" pref="165" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jLabel11" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtRg" min="-2" pref="156" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel2" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel17" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="txtCargo" max="32767" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jLabel12" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtCelular" min="-2" pref="109" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel9" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtTelefone" min="-2" pref="125" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="348" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jTextField17" alignment="0" min="-2" pref="86" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="txtId" min="-2" pref="59" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtNome" min="-2" pref="247" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel15" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtSenha" min="-2" pref="206" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel20" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="boxNivelAcesso" min="-2" pref="241" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtId" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtNome" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel15" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel20" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="boxNivelAcesso" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtSenha" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel12" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtCelular" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtTelefone" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel17" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtCargo" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="11" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="txtEmail" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel10" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtCpf" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtRg" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel19" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtEndereco" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtNum" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel13" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtComplemento" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtCep" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtBairro" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel16" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtCidade" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="boxUf" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jLabel21" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="31" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" max="-2" attributes="0">
<Component id="btnNovo" alignment="3" max="32767" attributes="0"/>
<Component id="btnSalvar" alignment="3" max="32767" attributes="0"/>
<Component id="btnExcluir" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace min="-2" pref="63" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel18" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="159" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="-2" pref="181" max="-2" attributes="0"/>
<Component id="jTextField17" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="ID:"/>
</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="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="*Nome:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="*Email:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Endere&#xe7;o:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="UF:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="N:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel8">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Bairro:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel9">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Telefone:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel10">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="CPF:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel11">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="*RG:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel12">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="*Celular:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel13">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Complemento:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel16">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Cidade:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtNome">
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtNomeActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JTextField" name="txtEmail">
</Component>
<Component class="javax.swing.JTextField" name="txtEndereco">
</Component>
<Component class="javax.swing.JTextField" name="txtNum">
</Component>
<Component class="javax.swing.JTextField" name="txtComplemento">
</Component>
<Component class="javax.swing.JTextField" name="txtBairro">
</Component>
<Component class="javax.swing.JTextField" name="txtCidade">
</Component>
<Component class="javax.swing.JTextField" name="txtId">
<Properties>
<Property name="editable" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtIdActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel15">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="*Senha"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtCargo">
</Component>
<Component class="javax.swing.JLabel" name="jLabel17">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="*Cargo"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="jTextField17">
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTextField17ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel18">
</Component>
<Component class="javax.swing.JLabel" name="jLabel19">
<Properties>
<Property name="text" type="java.lang.String" value="CEP:"/>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="boxUf">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="27">
<StringItem index="0" value="AC"/>
<StringItem index="1" value="AL"/>
<StringItem index="2" value="AP"/>
<StringItem index="3" value="AM"/>
<StringItem index="4" value="BA"/>
<StringItem index="5" value="CE"/>
<StringItem index="6" value="DF"/>
<StringItem index="7" value="ES"/>
<StringItem index="8" value="GO"/>
<StringItem index="9" value="MA"/>
<StringItem index="10" value="MT"/>
<StringItem index="11" value="MS"/>
<StringItem index="12" value="MG"/>
<StringItem index="13" value="PA"/>
<StringItem index="14" value="PB"/>
<StringItem index="15" value="PR"/>
<StringItem index="16" value="PE"/>
<StringItem index="17" value="PI"/>
<StringItem index="18" value="RJ"/>
<StringItem index="19" value="RN"/>
<StringItem index="20" value="RS"/>
<StringItem index="21" value="RO"/>
<StringItem index="22" value="RR"/>
<StringItem index="23" value="SC"/>
<StringItem index="24" value="SP"/>
<StringItem index="25" value="SE"/>
<StringItem index="26" value="TO"/>
</StringArray>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JFormattedTextField" name="txtCep">
<Properties>
<Property name="formatterFactory" type="javax.swing.JFormattedTextField$AbstractFormatterFactory" editor="org.netbeans.modules.form.editors.AbstractFormatterFactoryEditor" preCode="try {" postCode="} catch (java.text.ParseException ex) {&#xa;ex.printStackTrace();&#xa;}">
<Format format="#####-###" subtype="-1" type="5"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JFormattedTextField" name="txtCelular">
<Properties>
<Property name="formatterFactory" type="javax.swing.JFormattedTextField$AbstractFormatterFactory" editor="org.netbeans.modules.form.editors.AbstractFormatterFactoryEditor" preCode="try {" postCode="} catch (java.text.ParseException ex) {&#xa;ex.printStackTrace();&#xa;}">
<Format format="(##)#####-####" subtype="-1" type="5"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JFormattedTextField" name="txtTelefone">
<Properties>
<Property name="formatterFactory" type="javax.swing.JFormattedTextField$AbstractFormatterFactory" editor="org.netbeans.modules.form.editors.AbstractFormatterFactoryEditor" preCode="try {" postCode="} catch (java.text.ParseException ex) {&#xa;ex.printStackTrace();&#xa;}">
<Format format="(##)####-####" subtype="-1" type="5"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JFormattedTextField" name="txtCpf">
<Properties>
<Property name="formatterFactory" type="javax.swing.JFormattedTextField$AbstractFormatterFactory" editor="org.netbeans.modules.form.editors.AbstractFormatterFactoryEditor" preCode="try {" postCode="} catch (java.text.ParseException ex) {&#xa;ex.printStackTrace();&#xa;}">
<Format format="###.###.###-##" subtype="-1" type="5"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JFormattedTextField" name="txtRg">
<Properties>
<Property name="formatterFactory" type="javax.swing.JFormattedTextField$AbstractFormatterFactory" editor="org.netbeans.modules.form.editors.AbstractFormatterFactoryEditor" preCode="try {" postCode="} catch (java.text.ParseException ex) {&#xa;ex.printStackTrace();&#xa;}">
<Format format="#.###.###-#" subtype="-1" type="5"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel20">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="*N&#xed;vel de Acesso"/>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="boxNivelAcesso">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="3">
<StringItem index="0" value="Administrador"/>
<StringItem index="1" value="Atendente"/>
<StringItem index="2" value="Usuario"/>
</StringArray>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JPasswordField" name="txtSenha">
</Component>
<Component class="javax.swing.JButton" name="btnNovo">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="14" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/new_file_small.png"/>
</Property>
<Property name="text" type="java.lang.String" value="NOVO"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnNovoActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnSalvar">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="14" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/save_small.png"/>
</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="btnSalvarActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnExcluir">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="14" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/delete_small.png"/>
</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="btnExcluirActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel21">
<Properties>
<Property name="text" type="java.lang.String" value="Campos marcados com * s&#xe3;o de preenchimento obrig&#xe1;t&#xf3;rio!"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jButton1">
<Properties>
<Property name="text" type="java.lang.String" value="Buscar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="btnFechar">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="14" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"/>
</Property>
<Property name="text" type="java.lang.String" value="FECHAR"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnFecharActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,887 @@
/*
* 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.
*/
//mude para vizualizacao por projeto para adicionar action
package br.com.projeto.view;
import br.com.parg.viacep.ViaCEP;
import br.com.parg.viacep.ViaCEPException;
import br.com.projeto.dao.FuncionarioDao;
import br.com.projeto.model.Funcionario;
import br.com.projeto.model.Utilitarios;
import java.awt.Component;
import java.awt.Window;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableModel;
import javax.swing.text.JTextComponent;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class FormFuncionarios extends javax.swing.JFrame {
//metodo listar usuarios pt3
public void listarFunc() {
FuncionarioDao dao = new FuncionarioDao();
List<Funcionario> lista = dao.listarFuncionarios();
DefaultTableModel dados = (DefaultTableModel) tabelaFuncionario.getModel();
dados.setNumRows(0);
for (Funcionario c : lista) {
dados.addRow(new Object[]{
c.getId(),
c.getNome(),
c.getRg(),
c.getCpf(),
c.getEmail(),
c.getSenha(),
c.getCargo(),
c.getNivel_acesso(),
c.getTelefone(),
c.getCelular(),
c.getCep(),
c.getEndereco(),
c.getNumero(),
c.getComplemento(),
c.getBairro(),
c.getCidade(),
c.getUf(),});
}
}
/**
* Creates new form formLeitor
*/
public FormFuncionarios() {
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();
jLabel1 = new javax.swing.JLabel();
tabbedFrameF = new javax.swing.JTabbedPane();
tabConsultaUsuarios = new javax.swing.JPanel();
jLabel14 = new javax.swing.JLabel();
txtPesquisaFuncionario = new javax.swing.JTextField();
btnPesquisar = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
tabelaFuncionario = new javax.swing.JTable();
tabCadastro = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
jLabel16 = new javax.swing.JLabel();
txtNome = new javax.swing.JTextField();
txtEmail = new javax.swing.JTextField();
txtEndereco = new javax.swing.JTextField();
txtNum = new javax.swing.JTextField();
txtComplemento = new javax.swing.JTextField();
txtBairro = new javax.swing.JTextField();
txtCidade = new javax.swing.JTextField();
txtId = new javax.swing.JTextField();
jLabel15 = new javax.swing.JLabel();
txtCargo = new javax.swing.JTextField();
jLabel17 = new javax.swing.JLabel();
jTextField17 = new javax.swing.JTextField();
jLabel18 = new javax.swing.JLabel();
jLabel19 = new javax.swing.JLabel();
boxUf = new javax.swing.JComboBox<>();
txtCep = new javax.swing.JFormattedTextField();
txtCelular = new javax.swing.JFormattedTextField();
txtTelefone = new javax.swing.JFormattedTextField();
txtCpf = new javax.swing.JFormattedTextField();
txtRg = new javax.swing.JFormattedTextField();
jLabel20 = new javax.swing.JLabel();
boxNivelAcesso = new javax.swing.JComboBox<>();
txtSenha = new javax.swing.JPasswordField();
btnNovo = new javax.swing.JButton();
btnSalvar = new javax.swing.JButton();
btnExcluir = new javax.swing.JButton();
jLabel21 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
btnFechar = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowActivated(java.awt.event.WindowEvent evt) {
formWindowActivated(evt);
}
});
jPanel1.setBackground(new java.awt.Color(51, 51, 51));
jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
jLabel1.setForeground(new java.awt.Color(255, 255, 255));
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("Cadastro de Funcionários");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE)
);
jLabel14.setText("Nome:");
txtPesquisaFuncionario.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtPesquisaFuncionarioActionPerformed(evt);
}
});
txtPesquisaFuncionario.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtPesquisaFuncionarioKeyReleased(evt);
}
});
btnPesquisar.setText("Pesquisar");
btnPesquisar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnPesquisarActionPerformed(evt);
}
});
btnPesquisar.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
btnPesquisarKeyReleased(evt);
}
});
tabelaFuncionario.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"cod", "nome", "rg", "cpf", "email", "senha", "cargo", "nivel_acesso", "telefone", "celular", "cep", "endereco", "numero", "complemento", "bairro", "cidade", "estado"
}
) {
boolean[] canEdit = new boolean [] {
false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false
};
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
tabelaFuncionario.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);
tabelaFuncionario.setAutoscrolls(false);
tabelaFuncionario.getTableHeader().setReorderingAllowed(false);
tabelaFuncionario.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tabelaFuncionarioMouseClicked(evt);
}
});
jScrollPane1.setViewportView(tabelaFuncionario);
if (tabelaFuncionario.getColumnModel().getColumnCount() > 0) {
tabelaFuncionario.getColumnModel().getColumn(15).setResizable(false);
}
javax.swing.GroupLayout tabConsultaUsuariosLayout = new javax.swing.GroupLayout(tabConsultaUsuarios);
tabConsultaUsuarios.setLayout(tabConsultaUsuariosLayout);
tabConsultaUsuariosLayout.setHorizontalGroup(
tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabConsultaUsuariosLayout.createSequentialGroup()
.addGap(25, 25, 25)
.addGroup(tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabConsultaUsuariosLayout.createSequentialGroup()
.addComponent(jScrollPane1)
.addContainerGap())
.addGroup(tabConsultaUsuariosLayout.createSequentialGroup()
.addComponent(jLabel14)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtPesquisaFuncionario, javax.swing.GroupLayout.DEFAULT_SIZE, 307, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addComponent(btnPesquisar)
.addGap(618, 618, 618))))
);
tabConsultaUsuariosLayout.setVerticalGroup(
tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabConsultaUsuariosLayout.createSequentialGroup()
.addGap(10, 10, 10)
.addGroup(tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel14)
.addComponent(txtPesquisaFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnPesquisar))
.addGap(38, 38, 38)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
tabbedFrameF.addTab("Consulta de Funcionários", tabConsultaUsuarios);
jLabel2.setText("ID:");
jLabel3.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel3.setText("*Nome:");
jLabel4.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel4.setText("*Email:");
jLabel5.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel5.setText("Endereço:");
jLabel6.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel6.setText("UF:");
jLabel7.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel7.setText("N:");
jLabel8.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel8.setText("Bairro:");
jLabel9.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel9.setText("Telefone:");
jLabel10.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel10.setText("CPF:");
jLabel11.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel11.setText("*RG:");
jLabel12.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel12.setText("*Celular:");
jLabel13.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel13.setText("Complemento:");
jLabel16.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel16.setText("Cidade:");
txtNome.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtNomeActionPerformed(evt);
}
});
txtId.setEditable(false);
txtId.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtIdActionPerformed(evt);
}
});
jLabel15.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel15.setText("*Senha");
jLabel17.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel17.setText("*Cargo");
jTextField17.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField17ActionPerformed(evt);
}
});
jLabel19.setText("CEP:");
boxUf.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO" }));
try {
txtCep.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("#####-###")));
} catch (java.text.ParseException ex) {
ex.printStackTrace();
}
try {
txtCelular.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##)#####-####")));
} catch (java.text.ParseException ex) {
ex.printStackTrace();
}
try {
txtTelefone.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##)####-####")));
} catch (java.text.ParseException ex) {
ex.printStackTrace();
}
try {
txtCpf.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##")));
} catch (java.text.ParseException ex) {
ex.printStackTrace();
}
try {
txtRg.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("#.###.###-#")));
} catch (java.text.ParseException ex) {
ex.printStackTrace();
}
jLabel20.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel20.setText("*Nível de Acesso");
boxNivelAcesso.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Administrador", "Atendente", "Usuario" }));
btnNovo.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
btnNovo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/new_file_small.png"))); // NOI18N
btnNovo.setText("NOVO");
btnNovo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnNovoActionPerformed(evt);
}
});
btnSalvar.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
btnSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/save_small.png"))); // NOI18N
btnSalvar.setText("SALVAR");
btnSalvar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSalvarActionPerformed(evt);
}
});
btnExcluir.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
btnExcluir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/delete_small.png"))); // NOI18N
btnExcluir.setText("EXCLUIR");
btnExcluir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnExcluirActionPerformed(evt);
}
});
jLabel21.setText("Campos marcados com * são de preenchimento obrigátório!");
jButton1.setText("Buscar");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout tabCadastroLayout = new javax.swing.GroupLayout(tabCadastro);
tabCadastro.setLayout(tabCadastroLayout);
tabCadastroLayout.setHorizontalGroup(
tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tabCadastroLayout.createSequentialGroup()
.addContainerGap()
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel19)
.addComponent(jLabel8))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabCadastroLayout.createSequentialGroup()
.addComponent(txtCep, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jButton1)
.addGap(26, 26, 26)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, 258, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtNum, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(tabCadastroLayout.createSequentialGroup()
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabCadastroLayout.createSequentialGroup()
.addComponent(txtBairro, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel16)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtCidade, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(tabCadastroLayout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(jLabel21)))
.addGap(25, 25, 25)
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(boxUf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabCadastroLayout.createSequentialGroup()
.addComponent(jLabel13)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtComplemento)
.addGap(307, 307, 307))
.addGroup(tabCadastroLayout.createSequentialGroup()
.addComponent(btnNovo)
.addGap(18, 18, 18)
.addComponent(btnSalvar)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(btnExcluir)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addGroup(tabCadastroLayout.createSequentialGroup()
.addGap(312, 312, 312)
.addComponent(jLabel18)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(tabCadastroLayout.createSequentialGroup()
.addGap(33, 33, 33)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabCadastroLayout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel10)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtCpf, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel11)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtRg, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(tabCadastroLayout.createSequentialGroup()
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel2)
.addComponent(jLabel17))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tabCadastroLayout.createSequentialGroup()
.addComponent(txtCargo)
.addGap(18, 18, 18)
.addComponent(jLabel12)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtCelular, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel9)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(348, 348, 348))
.addGroup(tabCadastroLayout.createSequentialGroup()
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField17, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(tabCadastroLayout.createSequentialGroup()
.addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtNome, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel15)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtSenha, javax.swing.GroupLayout.PREFERRED_SIZE, 206, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel20)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(boxNivelAcesso, javax.swing.GroupLayout.PREFERRED_SIZE, 241, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))))
);
tabCadastroLayout.setVerticalGroup(
tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabCadastroLayout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3)
.addComponent(txtNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel15)
.addComponent(jLabel20)
.addComponent(boxNivelAcesso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtSenha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel12)
.addComponent(jLabel9)
.addComponent(txtCelular, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel17)
.addComponent(txtCargo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(11, 11, 11)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4)
.addComponent(jLabel10)
.addComponent(jLabel11)
.addComponent(txtCpf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtRg, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel19)
.addComponent(jLabel5)
.addComponent(txtEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel7)
.addComponent(txtNum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel13)
.addComponent(txtComplemento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtCep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton1))
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabCadastroLayout.createSequentialGroup()
.addGap(18, 18, 18)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel8)
.addComponent(txtBairro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel16)
.addComponent(txtCidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6)
.addComponent(boxUf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel21))
.addGroup(tabCadastroLayout.createSequentialGroup()
.addGap(31, 31, 31)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE, false)
.addComponent(btnNovo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnSalvar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnExcluir))))
.addGap(63, 63, 63)
.addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabCadastroLayout.createSequentialGroup()
.addComponent(jLabel18)
.addGap(159, 159, 159))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tabCadastroLayout.createSequentialGroup()
.addGap(181, 181, 181)
.addComponent(jTextField17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18))))
);
tabbedFrameF.addTab("Cadastro deFuncionários", tabCadastro);
btnFechar.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
btnFechar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"))); // NOI18N
btnFechar.setText("FECHAR");
btnFechar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnFecharActionPerformed(evt);
}
});
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)
.addComponent(tabbedFrameF)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnFechar)
.addGap(19, 19, 19))
);
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)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(tabbedFrameF, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(btnFechar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btnSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarActionPerformed
// salvar usuario
Funcionario obj = new Funcionario();
obj.setNome(txtNome.getText());
obj.setRg(txtRg.getText());
obj.setCpf(txtCpf.getText());
obj.setEmail(txtEmail.getText());
obj.setTelefone(txtTelefone.getText());
obj.setCelular(txtCelular.getText());
obj.setSenha(txtSenha.getText());
obj.setCargo(txtCargo.getText());
obj.setNivel_acesso(boxNivelAcesso.getSelectedItem().toString());
obj.setCep(txtCep.getText());
obj.setEndereco(txtEndereco.getText());
obj.setNumero(txtNum.getText());
obj.setComplemento(txtComplemento.getText());
obj.setBairro(txtBairro.getText());
obj.setCidade(txtCidade.getText());
obj.setUf(boxUf.getSelectedItem().toString());
FuncionarioDao dao = new FuncionarioDao();
if (txtNome.getText().isEmpty() || txtCelular.getText().isEmpty() || txtRg.getText().isEmpty() || txtSenha.getText().isEmpty() || txtEmail.getText().isEmpty() || boxNivelAcesso.getSelectedIndex() == -1 || txtCargo.getText().isEmpty()) {
JOptionPane.showMessageDialog(null, "Campos com * são de preenchimento obrigatório!");
} else {
Utilitarios util = new Utilitarios();
boolean valido = util.valida(txtCpf.getText());
if (!txtCpf.getText().equals(" . . - ") && !valido == true && !txtCpf.getText().equals("000.000.000-00")) {
JOptionPane.showMessageDialog(null, "CPF Inválido! Tente Novamente!");
return;
}
if (!(txtId.getText()).equals("")) {
obj.setId(Integer.valueOf(txtId.getText()));
dao.alterarFuncionario(obj);
} else {
dao.cadastrarFuncionario(obj);
}
}
}//GEN-LAST:event_btnSalvarActionPerformed
private void btnFecharActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFecharActionPerformed
this.dispose();
}//GEN-LAST:event_btnFecharActionPerformed
private void txtPesquisaFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPesquisaFuncionarioActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_txtPesquisaFuncionarioActionPerformed
private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
// listar suario pt4
listarFunc();
}//GEN-LAST:event_formWindowActivated
private void btnExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirActionPerformed
// excluir
Funcionario obj = new Funcionario();
try {
obj.setId(Integer.valueOf(txtId.getText()));
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Aviso! Selecione um usuário!");
return;
}
FuncionarioDao dao = new FuncionarioDao();
dao.excluirFuncionario(obj);
Utilitarios util = new Utilitarios();
util.limpaTela(tabCadastro);
}//GEN-LAST:event_btnExcluirActionPerformed
//TODO parei aqui
private void tabelaFuncionarioMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaFuncionarioMouseClicked
// tabela quando clicado
DefaultTableModel model = (DefaultTableModel) tabelaFuncionario.getModel();
int selectedRowIndex = tabelaFuncionario.getSelectedRow();
txtId.setText(model.getValueAt(selectedRowIndex, 0).toString());
txtNome.setText(model.getValueAt(selectedRowIndex, 1).toString());
txtRg.setText(model.getValueAt(selectedRowIndex, 2).toString());
txtCpf.setText(model.getValueAt(selectedRowIndex, 3).toString());
txtEmail.setText(model.getValueAt(selectedRowIndex, 4).toString());
txtSenha.setText(model.getValueAt(selectedRowIndex, 5).toString());
txtCargo.setText(model.getValueAt(selectedRowIndex, 6).toString());
boxNivelAcesso.setSelectedItem(model.getValueAt(selectedRowIndex, 7).toString());
txtTelefone.setText(model.getValueAt(selectedRowIndex, 8).toString());
txtCelular.setText(model.getValueAt(selectedRowIndex, 9).toString());
txtCep.setText(model.getValueAt(selectedRowIndex, 10).toString());
txtEndereco.setText(model.getValueAt(selectedRowIndex, 11).toString());
txtNum.setText(model.getValueAt(selectedRowIndex, 12).toString());
txtComplemento.setText(model.getValueAt(selectedRowIndex, 13).toString());
txtBairro.setText(model.getValueAt(selectedRowIndex, 14).toString());
txtCidade.setText(model.getValueAt(selectedRowIndex, 15).toString());
boxUf.setSelectedItem(model.getValueAt(selectedRowIndex, 16).toString());
//mouse click go to tab
tabbedFrameF.setSelectedIndex(1);
}//GEN-LAST:event_tabelaFuncionarioMouseClicked
private void btnNovoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNovoActionPerformed
// TODO add your handling code here:
Utilitarios util = new Utilitarios();
util.limpaTela(tabCadastro);
}//GEN-LAST:event_btnNovoActionPerformed
private void jTextField17ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField17ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField17ActionPerformed
private void txtIdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtIdActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_txtIdActionPerformed
private void txtNomeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNomeActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_txtNomeActionPerformed
private void btnPesquisarKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnPesquisarKeyReleased
// TODO add your handling code here:
}//GEN-LAST:event_btnPesquisarKeyReleased
private void txtPesquisaFuncionarioKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtPesquisaFuncionarioKeyReleased
// TODO add your handling code here:
String nome = "%" + txtPesquisaFuncionario.getText() + "%";
FuncionarioDao dao = new FuncionarioDao();
List<Funcionario> lista = dao.pesquisarNomeFuncionarios(nome);
DefaultTableModel dados = (DefaultTableModel) tabelaFuncionario.getModel();
dados.setNumRows(0); //limpa/zera pesquisa a cada digitacao
for (Funcionario c : lista) {
dados.addRow(new Object[]{
c.getId(),
c.getNome(),
c.getRg(),
c.getCpf(),
c.getEmail(),
c.getSenha(),
c.getCargo(),
c.getNivel_acesso(),
c.getTelefone(),
c.getCelular(),
c.getCep(),
c.getEndereco(),
c.getNumero(),
c.getComplemento(),
c.getBairro(),
c.getCidade(),
c.getUf(),});
}
}//GEN-LAST:event_txtPesquisaFuncionarioKeyReleased
private void btnPesquisarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPesquisarActionPerformed
// TODO add your handling code here:
String nome = txtNome.getText();
Funcionario obj = new Funcionario();
FuncionarioDao dao = new FuncionarioDao();
obj = dao.buscarFuncionario(nome);
if (obj.getNome() != null) {
txtId.setText(String.valueOf(obj.getId()));
txtNome.setText(obj.getNome());
txtRg.setText(obj.getRg());
txtCpf.setText(obj.getCpf());
txtEmail.setText(obj.getEmail());
txtSenha.setText(obj.getSenha());
txtCargo.setText(obj.getCargo());
boxNivelAcesso.setSelectedItem(obj.getNivel_acesso());
txtTelefone.setText(obj.getTelefone());
txtCelular.setText(obj.getCelular());
txtCep.setText(obj.getCep());
txtEndereco.setText(obj.getEndereco());
txtNum.setText(obj.getNumero());
txtComplemento.setText(obj.getComplemento());
txtBairro.setText(obj.getBairro());
txtCidade.setText(obj.getCidade());
boxUf.setSelectedItem(obj.getUf());
} else {
JOptionPane.showMessageDialog(null, "Funcionario não encontrado");
}
}//GEN-LAST:event_btnPesquisarActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
ViaCEP viacep = new ViaCEP();
try {
viacep.buscar(txtCep.getText());
txtBairro.setText(viacep.getBairro());
txtCidade.setText(viacep.getLocalidade());
txtEndereco.setText(viacep.getLogradouro());
boxUf.setSelectedItem(viacep.getUf());
} catch (ViaCEPException ex) {
Logger.getLogger(FormLeitor.class.getName()).log(Level.SEVERE, null, ex);
}
{
}
}//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(FormFuncionarios.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(FormFuncionarios.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(FormFuncionarios.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FormFuncionarios.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new FormFuncionarios().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JComboBox<String> boxNivelAcesso;
private javax.swing.JComboBox<String> boxUf;
private javax.swing.JButton btnExcluir;
private javax.swing.JButton btnFechar;
private javax.swing.JButton btnNovo;
private javax.swing.JButton btnPesquisar;
private javax.swing.JButton btnSalvar;
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel18;
private javax.swing.JLabel jLabel19;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel20;
private javax.swing.JLabel jLabel21;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextField jTextField17;
private javax.swing.JPanel tabCadastro;
private javax.swing.JPanel tabConsultaUsuarios;
private javax.swing.JTabbedPane tabbedFrameF;
private javax.swing.JTable tabelaFuncionario;
private javax.swing.JTextField txtBairro;
private javax.swing.JTextField txtCargo;
private javax.swing.JFormattedTextField txtCelular;
private javax.swing.JFormattedTextField txtCep;
private javax.swing.JTextField txtCidade;
private javax.swing.JTextField txtComplemento;
private javax.swing.JFormattedTextField txtCpf;
private javax.swing.JTextField txtEmail;
private javax.swing.JTextField txtEndereco;
private javax.swing.JTextField txtId;
private javax.swing.JTextField txtNome;
private javax.swing.JTextField txtNum;
private javax.swing.JTextField txtPesquisaFuncionario;
private javax.swing.JFormattedTextField txtRg;
private javax.swing.JPasswordField txtSenha;
private javax.swing.JFormattedTextField txtTelefone;
// End of variables declaration//GEN-END:variables
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+971
View File
@@ -0,0 +1,971 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<NonVisualComponents>
<Container class="javax.swing.JMenu" name="jMenu1">
<Properties>
<Property name="text" type="java.lang.String" value="jMenu1"/>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="true"/>
</Layout>
</Container>
</NonVisualComponents>
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/>
</Events>
<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" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="tabbedFrameF" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="16" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="tabbedFrameF" min="-2" pref="444" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jButton1" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="33" green="33" red="33" type="rgb"/>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel1" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel1" alignment="1" pref="72" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="24" style="0"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="Cadastro de Livros"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JTabbedPane" name="tabbedFrameF">
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="tabConsultaUsuarios">
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tabConsultaUsuariosMouseClicked"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Consulta de Livros">
<Property name="tabTitle" type="java.lang.String" value="Consulta de Livros"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="25" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="jScrollPane1" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel14" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtPesquisaLivros" pref="362" max="32767" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="btnPesquisar" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="426" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="btnXlsxExport" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jButton3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel14" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtPesquisaLivros" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnPesquisar" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jScrollPane1" min="-2" pref="278" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="btnXlsxExport" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton3" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="42" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel14">
<Properties>
<Property name="text" type="java.lang.String" value="Nome:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtPesquisaLivros">
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtPesquisaLivrosActionPerformed"/>
<EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtPesquisaLivrosKeyReleased"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnPesquisar">
<Properties>
<Property name="text" type="java.lang.String" value="Pesquisar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnPesquisarActionPerformed"/>
<EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="btnPesquisarKeyReleased"/>
</Events>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="tabelaLivros">
<Properties>
<Property name="autoCreateRowSorter" type="boolean" value="true"/>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
<Table columnCount="16" rowCount="0">
<Column editable="false" title="cod" type="java.lang.Object"/>
<Column editable="false" title="T&#xed;tulo" type="java.lang.Object"/>
<Column editable="false" title="Autor" type="java.lang.Object"/>
<Column editable="false" title="Editora" type="java.lang.Object"/>
<Column editable="false" title="ISBN" type="java.lang.Object"/>
<Column editable="false" title="Ano" type="java.lang.Object"/>
<Column editable="false" title="Serie" type="java.lang.Object"/>
<Column editable="false" title="Edi&#xe7;&#xe3;o" type="java.lang.Object"/>
<Column editable="false" title="Idioma" type="java.lang.Object"/>
<Column editable="false" title="Fornecedor" type="java.lang.Object"/>
<Column editable="false" title="Piso" type="java.lang.Object"/>
<Column editable="false" title="Corredor" type="java.lang.Object"/>
<Column editable="false" title="Posi&#xe7;&#xe3;o" type="java.lang.Object"/>
<Column editable="false" title="Se&#xe7;&#xe3;o" type="java.lang.Object"/>
<Column editable="false" title="Disponibilidade" type="java.lang.Object"/>
<Column editable="false" title="Observa&#xe7;&#xf5;es" type="java.lang.Object"/>
</Table>
</Property>
<Property name="autoResizeMode" type="int" value="0"/>
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor" preCode="tabelaLivros.getColumn(tabelaLivros.getColumnName(0)).setPreferredWidth(30);&#xa;tabelaLivros.getColumn(tabelaLivros.getColumnName(1)).setPreferredWidth(200);">
<TableColumnModel selectionModel="0">
<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>
<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>
<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>
<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="false" resizingAllowed="true"/>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tabelaLivrosMouseClicked"/>
</Events>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="btnXlsxExport">
<Properties>
<Property name="text" type="java.lang.String" value="Exportar para XLSX"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnXlsxExportActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="jButton3">
<Properties>
<Property name="text" type="java.lang.String" value="Importar de arquivo XLSX"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="tabCadastro">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Cadastro de livros">
<Property name="tabTitle" type="java.lang.String" value="Cadastro de livros"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="23" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel2" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="lblNome" min="-2" max="-2" attributes="0"/>
<Component id="lblAutor" min="-2" max="-2" attributes="0"/>
<Component id="lblEditora" min="-2" max="-2" attributes="0"/>
<Component id="lblIsbn" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel19" min="-2" max="-2" attributes="0"/>
<Component id="jLabel20" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="15" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="txtId" min="-2" pref="59" max="-2" attributes="0"/>
<Component id="txtIdioma" alignment="0" min="-2" pref="133" max="-2" attributes="0"/>
<Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
<Component id="txtEditora" alignment="0" max="32767" attributes="0"/>
<Component id="txtAutor" alignment="0" max="32767" attributes="0"/>
<Component id="txtTitulo" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Group type="102" attributes="0">
<Component id="txtIsbn" min="-2" pref="146" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="lblAno" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="txtSerie" max="32767" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="lblEdicao" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="txtEdicao" min="-2" pref="45" max="-2" attributes="0"/>
<Component id="txtAno" min="-2" pref="43" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="17" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
<Component id="jSeparator2" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="boxFornecedor" max="32767" attributes="0"/>
<Component id="boxDisponibilidade" min="-2" pref="208" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel9" min="-2" max="-2" attributes="0"/>
<Component id="jLabel12" min="-2" max="-2" attributes="0"/>
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<Component id="jLabel13" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="boxCorredor" alignment="1" max="32767" attributes="0"/>
<Component id="boxSecao" alignment="1" max="32767" attributes="0"/>
<Component id="boxPiso" pref="0" max="32767" attributes="0"/>
<Component id="boxPosicao" alignment="1" max="32767" attributes="0"/>
</Group>
</Group>
<Component id="jScrollPane2" alignment="0" max="32767" 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="10" max="-2" attributes="0"/>
<Component id="jSeparator1" min="-2" pref="203" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="73" max="-2" attributes="0"/>
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="160" max="-2" attributes="0"/>
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="0" pref="67" max="32767" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="btnMapa" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="btnNovo" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="btnSalvar" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="btnExcluir" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel18" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
<Component id="btNavegar" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="btnbaixarCapa" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
<Component id="lblImagem" min="-2" pref="162" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jSeparator2" min="-2" pref="232" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="173" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="boxFornecedor" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="boxDisponibilidade" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Component id="jSeparator1" min="-2" pref="5" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="23" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel13" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="boxPiso" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="boxCorredor" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel12" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="boxSecao" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="boxPosicao" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane2" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="lblImagem" min="-2" pref="240" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="btNavegar" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnbaixarCapa" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
<Component id="btnMapa" min="-2" pref="40" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="48" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtId" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="txtTitulo" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblNome" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="txtAutor" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblAutor" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="txtEditora" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblEditora" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="lblIsbn" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtIsbn" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblAno" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtAno" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel19" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblEdicao" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtSerie" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtEdicao" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel20" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtIdioma" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="btnExcluir" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnSalvar" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnNovo" alignment="3" max="32767" attributes="0"/>
</Group>
<Component id="jLabel18" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="32" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="ID:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblNome">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="*T&#xed;tulo:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblAutor">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="*Autor:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="LOCALIZA&#xc7;&#xc3;O"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblAno">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="*Ano:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Posi&#xe7;&#xe3;o:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblEditora">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="*Editora:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel9">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="*Se&#xe7;&#xe3;o:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblIsbn">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="*ISBN:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel12">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Corredor:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel13">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Piso:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblEdicao">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Edi&#xe7;&#xe3;o:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtTitulo">
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtTituloActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JTextField" name="txtAutor">
</Component>
<Component class="javax.swing.JTextField" name="txtEditora">
</Component>
<Component class="javax.swing.JTextField" name="txtId">
<Properties>
<Property name="editable" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtIdActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel18">
</Component>
<Component class="javax.swing.JLabel" name="jLabel19">
<Properties>
<Property name="text" type="java.lang.String" value="S&#xe9;rie:"/>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="boxSecao">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="0"/>
</Property>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxSecaoMouseClicked"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JFormattedTextField" name="txtIsbn">
<Properties>
<Property name="formatterFactory" type="javax.swing.JFormattedTextField$AbstractFormatterFactory" editor="org.netbeans.modules.form.editors.AbstractFormatterFactoryEditor" preCode="try {" postCode="} catch (java.text.ParseException ex) {&#xa;ex.printStackTrace();&#xa;}">
<Format format="#############" subtype="-1" type="5"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JSeparator" name="jSeparator2">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.BevelBorderInfo">
<BevelBorder/>
</Border>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="boxCorredor">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="0"/>
</Property>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxCorredorMouseClicked"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JComboBox" name="boxPiso">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="0"/>
</Property>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
<Property name="lightWeightPopupEnabled" type="boolean" value="false"/>
<Property name="name" type="java.lang.String" value="" noResource="true"/>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
<Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxPisoMouseClicked"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JComboBox" name="boxPosicao">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="0"/>
</Property>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxPosicaoMouseClicked"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JButton" name="btnMapa">
<Properties>
<Property name="text" type="java.lang.String" value="mapa"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnMapaActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JSeparator" name="jSeparator1">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.SoftBevelBorderInfo">
<BevelBorder/>
</Border>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="btNavegar">
<Properties>
<Property name="text" type="java.lang.String" value="Navegar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btNavegarActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnbaixarCapa">
<Properties>
<Property name="text" type="java.lang.String" value="baixar capa"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel20">
<Properties>
<Property name="text" type="java.lang.String" value="*Idioma:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtSerie">
</Component>
<Component class="javax.swing.JTextField" name="txtIdioma">
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtIdiomaActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JTextField" name="txtEdicao">
</Component>
<Component class="javax.swing.JComboBox" name="boxFornecedor">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
<Property name="lightWeightPopupEnabled" type="boolean" value="false"/>
<Property name="opaque" type="boolean" value="false"/>
<Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxFornecedorMouseClicked"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_SerializeTo" type="java.lang.String" value="FormLivros_boxFornecedor"/>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value=""/>
</AuxValues>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="txtAreaObservacoes">
<Properties>
<Property name="columns" type="int" value="20"/>
<Property name="rows" type="int" value="5"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="text" type="java.lang.String" value="Observa&#xe7;&#xf5;es:"/>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="boxDisponibilidade">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="0"/>
</Property>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxDisponibilidadeMouseClicked"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value=""/>
</AuxValues>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="text" type="java.lang.String" value="*Disponibilidade:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblImagem">
<Properties>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/book_cover.png"/>
</Property>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
<LineBorder/>
</Border>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel8">
<Properties>
<Property name="text" type="java.lang.String" value="Alterar Fornecedor:"/>
</Properties>
</Component>
<Component class="javax.swing.JFormattedTextField" name="txtAno">
<Properties>
<Property name="formatterFactory" type="javax.swing.JFormattedTextField$AbstractFormatterFactory" editor="org.netbeans.modules.form.editors.AbstractFormatterFactoryEditor" preCode="try {" postCode="} catch (java.text.ParseException ex) {&#xa;ex.printStackTrace();&#xa;}">
<Format format="####" subtype="-1" type="5"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="btnSalvar">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="14" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/save_small.png"/>
</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="btnSalvarActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnNovo">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="14" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/new_file_small.png"/>
</Property>
<Property name="text" type="java.lang.String" value="NOVO"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnNovoActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnExcluir">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="14" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/delete_small.png"/>
</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="btnExcluirActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="jButton1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"/>
</Property>
<Property name="text" type="java.lang.String" value="FECHAR"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
File diff suppressed because it is too large Load Diff
+172
View File
@@ -0,0 +1,172 @@
<?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="2"/>
<Property name="resizable" type="boolean" value="false"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="true"/>
</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="1" max="32767" 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="121" max="-2" attributes="0"/>
<Component id="btnEntrarLogin" min="-2" pref="124" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="34" max="-2" attributes="0"/>
<Component id="btnCancelarLogin" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="58" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="txtNomeLogin" max="32767" attributes="0"/>
<Component id="txtSenhaLogin" min="-2" pref="272" max="-2" attributes="0"/>
</Group>
</Group>
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace pref="68" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="28" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="txtNomeLogin" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="29" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtSenhaLogin" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="39" max="-2" attributes="0"/>
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="31" max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="btnCancelarLogin" alignment="3" min="-2" pref="42" max="-2" attributes="0"/>
<Component id="btnEntrarLogin" alignment="3" min="-2" pref="42" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="0" type="rgb"/>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel1" alignment="1" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="22" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" pref="54" max="-2" attributes="0"/>
<EmptySpace pref="20" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="24" style="0"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="Autentica&#xe7;&#xe3;o de Usu&#xe1;rio"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="Nome de Usu&#xe1;rio:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="text" type="java.lang.String" value="Senha:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtNomeLogin">
</Component>
<Component class="javax.swing.JPasswordField" name="txtSenhaLogin">
</Component>
<Component class="javax.swing.JButton" name="btnCancelarLogin">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="14" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/cancel_small.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Cancelar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelarLoginActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnEntrarLogin">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="14" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/user_small.png"/>
</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="btnEntrarLoginActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="text" type="java.lang.String" value="Dica: Credenciais iniciais padr&#xe3;o s&#xe3;o: admin@admin e senha: admin"/>
</Properties>
</Component>
</SubComponents>
</Form>
+233
View File
@@ -0,0 +1,233 @@
/*
* 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.
*/
package br.com.projeto.view;
import br.com.projeto.dao.FuncionarioDao;
import br.com.projeto.dao.OptionsDao;
import com.bulenkov.darcula.DarculaLaf;
import java.io.IOException;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.plaf.basic.BasicLookAndFeel;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class FormLogin extends javax.swing.JFrame {
/**
* Creates new form formLogin
*/
public FormLogin() {
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();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
txtNomeLogin = new javax.swing.JTextField();
txtSenhaLogin = new javax.swing.JPasswordField();
btnCancelarLogin = new javax.swing.JButton();
btnEntrarLogin = new javax.swing.JButton();
jLabel4 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setResizable(false);
jPanel1.setBackground(new java.awt.Color(0, 0, 0));
jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
jLabel1.setForeground(new java.awt.Color(255, 255, 255));
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("Autenticação de Usuário");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, 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()
.addGap(22, 22, 22)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(20, Short.MAX_VALUE))
);
jLabel2.setText("Nome de Usuário:");
jLabel3.setText("Senha:");
btnCancelarLogin.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
btnCancelarLogin.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/cancel_small.png"))); // NOI18N
btnCancelarLogin.setText("Cancelar");
btnCancelarLogin.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCancelarLoginActionPerformed(evt);
}
});
btnEntrarLogin.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
btnEntrarLogin.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/user_small.png"))); // NOI18N
btnEntrarLogin.setText("Entrar");
btnEntrarLogin.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnEntrarLoginActionPerformed(evt);
}
});
jLabel4.setText("Dica: Credenciais iniciais padrão são: admin@admin e senha: admin");
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.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(121, 121, 121)
.addComponent(btnEntrarLogin, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(34, 34, 34)
.addComponent(btnCancelarLogin))
.addGroup(layout.createSequentialGroup()
.addGap(58, 58, 58)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel3)
.addComponent(jLabel2))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(txtNomeLogin)
.addComponent(txtSenhaLogin, javax.swing.GroupLayout.PREFERRED_SIZE, 272, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jLabel4))))
.addContainerGap(68, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(28, 28, 28)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtNomeLogin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2))
.addGap(29, 29, 29)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(txtSenhaLogin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(39, 39, 39)
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnCancelarLogin, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnEntrarLogin, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(24, 24, 24))
);
pack();
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents
private void btnEntrarLoginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEntrarLoginActionPerformed
String email, senha;
email = txtNomeLogin.getText();
senha = txtSenhaLogin.getText();
FuncionarioDao dao = new FuncionarioDao();
try {
dao.efetuarLogin(email,senha);
} catch (IOException ex) {
Logger.getLogger(FormLogin.class.getName()).log(Level.SEVERE, null, ex);
}
dispose(); //fecha formulário
}//GEN-LAST:event_btnEntrarLoginActionPerformed
private void btnCancelarLoginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarLoginActionPerformed
int op = JOptionPane.showConfirmDialog(null, "Tem certeza que deseja sair?");
if(op == 0) {
System.exit(0);
} else if (op ==2) {
JOptionPane.showMessageDialog(null, "Cancelado");
}
}//GEN-LAST:event_btnCancelarLoginActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) throws UnsupportedLookAndFeelException, SQLException {
/* 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
*/
OptionsDao optionsdao = new OptionsDao();
String temaPadrao = optionsdao.retornaOption(30);
if (temaPadrao.equals("Tema Claro")) {
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(FormLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(FormLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(FormLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FormLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
} else if (temaPadrao.equals("Tema Escuro")) {
BasicLookAndFeel darcula = new DarculaLaf();
UIManager.setLookAndFeel(darcula);
}
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new FormLogin().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnCancelarLogin;
private javax.swing.JButton btnEntrarLogin;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JPanel jPanel1;
private javax.swing.JTextField txtNomeLogin;
private javax.swing.JPasswordField txtSenhaLogin;
// End of variables declaration//GEN-END:variables
}
+296
View File
@@ -0,0 +1,296 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<NonVisualComponents>
<Component class="javax.swing.JTextField" name="txtlogado">
</Component>
<Menu class="javax.swing.JMenuBar" name="jMenuBar1">
<SubComponents>
<Menu class="javax.swing.JMenu" name="jMenu1">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/leitor.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Usu&#xe1;rios"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Segoe UI" size="18" style="1"/>
</Property>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem9">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="Ctrl+U"/>
</Property>
<Property name="text" type="java.lang.String" value="Controle de usu&#xe1;rios"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem9ActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
<Menu class="javax.swing.JMenu" name="jMenu2">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/funcionario.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Funcion&#xe1;rios"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Segoe UI" size="18" style="1"/>
</Property>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem1">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="Ctrl+F"/>
</Property>
<Property name="text" type="java.lang.String" value="Controle de Funcion&#xe1;rios"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem1ActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem10">
<Properties>
<Property name="text" type="java.lang.String" value="Alterar Funcion&#xe1;rio"/>
</Properties>
</MenuItem>
</SubComponents>
</Menu>
<Menu class="javax.swing.JMenu" name="jMenu3">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/provider.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Fornecedores"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Segoe UI" size="18" style="1"/>
</Property>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem2">
<Properties>
<Property name="text" type="java.lang.String" value="Controle de Forncedores"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem2ActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
<Menu class="javax.swing.JMenu" name="jMenu4">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/boook.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Livraria"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Segoe UI" size="18" style="1"/>
</Property>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem3">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="Ctrl+L"/>
</Property>
<Property name="text" type="java.lang.String" value="Controle de Livros"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem3ActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
<Menu class="javax.swing.JMenu" name="jMenu5">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/bookloc.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Empr&#xe9;stimos"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Segoe UI" size="18" style="1"/>
</Property>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem4">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="Ctrl+E"/>
</Property>
<Property name="text" type="java.lang.String" value="Controle de Empr&#xe9;stimos"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem4ActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem5">
<Properties>
<Property name="text" type="java.lang.String" value="Hist&#xf3;rico de Empr&#xe9;stimos"/>
</Properties>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem6">
<Properties>
<Property name="text" type="java.lang.String" value="Controle de Multas"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem6ActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
<Menu class="javax.swing.JMenu" name="jMenu6">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/config.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Configura&#xe7;&#xf5;es"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Segoe UI" size="18" style="1"/>
</Property>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem7">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="Ctrl+C"/>
</Property>
<Property name="text" type="java.lang.String" value="Configurara&#xe7;&#xf5;es"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem7ActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
<Menu class="javax.swing.JMenu" name="jMenu7">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Sair"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Segoe UI" size="18" style="1"/>
</Property>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem8">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="Ctrl+S"/>
</Property>
<Property name="text" type="java.lang.String" value="Sair"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem8ActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
</SubComponents>
</Menu>
</NonVisualComponents>
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/>
</Events>
<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">
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="357" max="32767" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
</Group>
</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="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lblLogado" min="-2" pref="143" max="-2" attributes="0"/>
<EmptySpace pref="569" max="32767" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtIdLogado" min="-2" pref="29" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="109" 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="10" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="txtIdLogado" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lblLogado" alignment="1" min="-2" pref="20" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="Logado como:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblLogado">
</Component>
<Component class="javax.swing.JTextField" name="txtIdLogado">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="enabled" type="boolean" value="false"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value=""/>
</AuxValues>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="Id:"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
+379
View File
@@ -0,0 +1,379 @@
/*
* 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.
*/
package br.com.projeto.view;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class FormMenu extends javax.swing.JFrame {
public String usuarioLogado;
public int idLogado;
/**
* Creates new form formMenu
*/
public FormMenu() {
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() {
txtlogado = new javax.swing.JTextField();
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
lblLogado = new javax.swing.JLabel();
txtIdLogado = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenuItem9 = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
jMenuItem1 = new javax.swing.JMenuItem();
jMenuItem10 = new javax.swing.JMenuItem();
jMenu3 = new javax.swing.JMenu();
jMenuItem2 = new javax.swing.JMenuItem();
jMenu4 = new javax.swing.JMenu();
jMenuItem3 = new javax.swing.JMenuItem();
jMenu5 = new javax.swing.JMenu();
jMenuItem4 = new javax.swing.JMenuItem();
jMenuItem5 = new javax.swing.JMenuItem();
jMenuItem6 = new javax.swing.JMenuItem();
jMenu6 = new javax.swing.JMenu();
jMenuItem7 = new javax.swing.JMenuItem();
jMenu7 = new javax.swing.JMenu();
jMenuItem8 = new javax.swing.JMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowActivated(java.awt.event.WindowEvent evt) {
formWindowActivated(evt);
}
});
jLabel1.setText("Logado como:");
txtIdLogado.setEditable(false);
txtIdLogado.setEnabled(false);
txtIdLogado.setFocusable(false);
txtIdLogado.setOpaque(false);
jLabel2.setText("Id:");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblLogado, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 569, Short.MAX_VALUE)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtIdLogado, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(109, 109, 109))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(10, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtIdLogado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblLogado, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jLabel2)))
.addGap(10, 10, 10))
);
jMenu1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/leitor.png"))); // NOI18N
jMenu1.setText("Usuários");
jMenu1.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
jMenuItem9.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.CTRL_MASK));
jMenuItem9.setText("Controle de usuários");
jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem9ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem9);
jMenuBar1.add(jMenu1);
jMenu2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/funcionario.png"))); // NOI18N
jMenu2.setText("Funcionários");
jMenu2.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK));
jMenuItem1.setText("Controle de Funcionários");
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem1ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem1);
jMenuItem10.setText("Alterar Funcionário");
jMenu2.add(jMenuItem10);
jMenuBar1.add(jMenu2);
jMenu3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/provider.png"))); // NOI18N
jMenu3.setText("Fornecedores");
jMenu3.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
jMenuItem2.setText("Controle de Forncedores");
jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem2ActionPerformed(evt);
}
});
jMenu3.add(jMenuItem2);
jMenuBar1.add(jMenu3);
jMenu4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/boook.png"))); // NOI18N
jMenu4.setText("Livraria");
jMenu4.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.CTRL_MASK));
jMenuItem3.setText("Controle de Livros");
jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem3ActionPerformed(evt);
}
});
jMenu4.add(jMenuItem3);
jMenuBar1.add(jMenu4);
jMenu5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/bookloc.png"))); // NOI18N
jMenu5.setText("Empréstimos");
jMenu5.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
jMenuItem4.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.CTRL_MASK));
jMenuItem4.setText("Controle de Empréstimos");
jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem4ActionPerformed(evt);
}
});
jMenu5.add(jMenuItem4);
jMenuItem5.setText("Histórico de Empréstimos");
jMenu5.add(jMenuItem5);
jMenuItem6.setText("Controle de Multas");
jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem6ActionPerformed(evt);
}
});
jMenu5.add(jMenuItem6);
jMenuBar1.add(jMenu5);
jMenu6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/config.png"))); // NOI18N
jMenu6.setText("Configurações");
jMenu6.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
jMenuItem7.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK));
jMenuItem7.setText("Configurarações");
jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem7ActionPerformed(evt);
}
});
jMenu6.add(jMenuItem7);
jMenuBar1.add(jMenu6);
jMenu7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"))); // NOI18N
jMenu7.setText("Sair");
jMenu7.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
jMenuItem8.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
jMenuItem8.setText("Sair");
jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem8ActionPerformed(evt);
}
});
jMenu7.add(jMenuItem8);
jMenuBar1.add(jMenu7);
setJMenuBar(jMenuBar1);
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)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(0, 357, Short.MAX_VALUE)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jMenuItem6ActionPerformed
private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
this.setExtendedState(this.MAXIMIZED_BOTH);
lblLogado.setText(usuarioLogado);
String logId = String.valueOf(idLogado);
txtIdLogado.setText(logId);// Int(idLogado);
txtlogado.setText(usuarioLogado);
PrintWriter out;
try {
out = new PrintWriter(new FileWriter("C:\\Librography\\LoggedIn"));
txtIdLogado.write(out);
} catch (IOException ex) {
Logger.getLogger(FormMenu.class.getName()).log(Level.SEVERE, null, ex);
}//totxt
this.setVisible(true);
}//GEN-LAST:event_formWindowActivated
private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed
// TODO add your handling code here:
FormLeitor leitor = new FormLeitor();
//centralizar
leitor.pack();
leitor.setLocationRelativeTo(null);
leitor.setVisible(true);
}//GEN-LAST:event_jMenuItem9ActionPerformed
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
FormFuncionarios ctrlFuncWd = new FormFuncionarios();
//centralizar
ctrlFuncWd.pack();
ctrlFuncWd.setLocationRelativeTo(null);
ctrlFuncWd.setVisible(true);
}//GEN-LAST:event_jMenuItem1ActionPerformed
private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
FormFornecedores ctrlForn = new FormFornecedores();
//centralizar
ctrlForn.pack();
ctrlForn.setLocationRelativeTo(null);
ctrlForn.setVisible(true);
}//GEN-LAST:event_jMenuItem2ActionPerformed
private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
FormLivros BookForn = new FormLivros();
//centralizar
BookForn.pack();
BookForn.setLocationRelativeTo(null);
BookForn.setVisible(true);
}//GEN-LAST:event_jMenuItem3ActionPerformed
private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
FormOptions optionsForn = new FormOptions();
//centralizar
optionsForn.pack();
optionsForn.setLocationRelativeTo(null);
optionsForn.setVisible(true);
}//GEN-LAST:event_jMenuItem7ActionPerformed
private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
FormEmprestimos emprestForn = new FormEmprestimos();
//centralizar
emprestForn.pack();
emprestForn.setLocationRelativeTo(null);
emprestForn.setVisible(true);
}//GEN-LAST:event_jMenuItem4ActionPerformed
private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
super.dispose();
}//GEN-LAST:event_jMenuItem8ActionPerformed
/**
* @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(FormMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(FormMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(FormMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FormMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new FormMenu().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenu jMenu3;
private javax.swing.JMenu jMenu4;
private javax.swing.JMenu jMenu5;
private javax.swing.JMenu jMenu6;
private javax.swing.JMenu jMenu7;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jMenuItem1;
private javax.swing.JMenuItem jMenuItem10;
private javax.swing.JMenuItem jMenuItem2;
private javax.swing.JMenuItem jMenuItem3;
private javax.swing.JMenuItem jMenuItem4;
private javax.swing.JMenuItem jMenuItem5;
private javax.swing.JMenuItem jMenuItem6;
private javax.swing.JMenuItem jMenuItem7;
private javax.swing.JMenuItem jMenuItem8;
private javax.swing.JMenuItem jMenuItem9;
private javax.swing.JPanel jPanel1;
private javax.swing.JLabel lblLogado;
private javax.swing.JTextField txtIdLogado;
private javax.swing.JTextField txtlogado;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,222 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<NonVisualComponents>
<Component class="javax.swing.JTextField" name="txtlogado">
</Component>
<Menu class="javax.swing.JMenuBar" name="jMenuBar1">
<SubComponents>
<Menu class="javax.swing.JMenu" name="jMenu1">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/leitor.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Usu&#xe1;rios"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Segoe UI" size="18" style="1"/>
</Property>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem9">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="Ctrl+U"/>
</Property>
<Property name="text" type="java.lang.String" value="Controle de usu&#xe1;rios"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem9ActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
<Menu class="javax.swing.JMenu" name="jMenu4">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/boook.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Livraria"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Segoe UI" size="18" style="1"/>
</Property>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem3">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="Ctrl+L"/>
</Property>
<Property name="text" type="java.lang.String" value="Controle de Livros"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem3ActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
<Menu class="javax.swing.JMenu" name="jMenu5">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/bookloc.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Empr&#xe9;stimos"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Segoe UI" size="18" style="1"/>
</Property>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem4">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="Ctrl+E"/>
</Property>
<Property name="text" type="java.lang.String" value="Controle de Empr&#xe9;stimos"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem4ActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem5">
<Properties>
<Property name="text" type="java.lang.String" value="Hist&#xf3;rico de Empr&#xe9;stimos"/>
</Properties>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem6">
<Properties>
<Property name="text" type="java.lang.String" value="Controle de Multas"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem6ActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
<Menu class="javax.swing.JMenu" name="jMenu7">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Sair"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Segoe UI" size="18" style="1"/>
</Property>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem8">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="Ctrl+S"/>
</Property>
<Property name="text" type="java.lang.String" value="Sair"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem8ActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>
</SubComponents>
</Menu>
</NonVisualComponents>
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/>
</Events>
<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">
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="357" max="32767" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
</Group>
</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="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lblLogado" min="-2" pref="143" max="-2" attributes="0"/>
<EmptySpace pref="569" max="32767" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtIdLogado" min="-2" pref="29" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="109" 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="10" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="txtIdLogado" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lblLogado" alignment="1" min="-2" pref="20" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="Logado como:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblLogado">
</Component>
<Component class="javax.swing.JTextField" name="txtIdLogado">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="enabled" type="boolean" value="false"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value=""/>
</AuxValues>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="Id:"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
@@ -0,0 +1,298 @@
/*
* 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.
*/
package br.com.projeto.view;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class FormMenuAtendente extends javax.swing.JFrame {
public String usuarioLogado;
public int idLogado;
/**
* Creates new form formMenu
*/
public FormMenuAtendente() {
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() {
txtlogado = new javax.swing.JTextField();
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
lblLogado = new javax.swing.JLabel();
txtIdLogado = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenuItem9 = new javax.swing.JMenuItem();
jMenu4 = new javax.swing.JMenu();
jMenuItem3 = new javax.swing.JMenuItem();
jMenu5 = new javax.swing.JMenu();
jMenuItem4 = new javax.swing.JMenuItem();
jMenuItem5 = new javax.swing.JMenuItem();
jMenuItem6 = new javax.swing.JMenuItem();
jMenu7 = new javax.swing.JMenu();
jMenuItem8 = new javax.swing.JMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowActivated(java.awt.event.WindowEvent evt) {
formWindowActivated(evt);
}
});
jLabel1.setText("Logado como:");
txtIdLogado.setEditable(false);
txtIdLogado.setEnabled(false);
txtIdLogado.setFocusable(false);
txtIdLogado.setOpaque(false);
jLabel2.setText("Id:");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblLogado, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 569, Short.MAX_VALUE)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtIdLogado, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(109, 109, 109))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(10, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtIdLogado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblLogado, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jLabel2)))
.addGap(10, 10, 10))
);
jMenu1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/leitor.png"))); // NOI18N
jMenu1.setText("Usuários");
jMenu1.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
jMenuItem9.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.CTRL_MASK));
jMenuItem9.setText("Controle de usuários");
jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem9ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem9);
jMenuBar1.add(jMenu1);
jMenu4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/boook.png"))); // NOI18N
jMenu4.setText("Livraria");
jMenu4.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.CTRL_MASK));
jMenuItem3.setText("Controle de Livros");
jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem3ActionPerformed(evt);
}
});
jMenu4.add(jMenuItem3);
jMenuBar1.add(jMenu4);
jMenu5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/bookloc.png"))); // NOI18N
jMenu5.setText("Empréstimos");
jMenu5.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
jMenuItem4.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.CTRL_MASK));
jMenuItem4.setText("Controle de Empréstimos");
jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem4ActionPerformed(evt);
}
});
jMenu5.add(jMenuItem4);
jMenuItem5.setText("Histórico de Empréstimos");
jMenu5.add(jMenuItem5);
jMenuItem6.setText("Controle de Multas");
jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem6ActionPerformed(evt);
}
});
jMenu5.add(jMenuItem6);
jMenuBar1.add(jMenu5);
jMenu7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"))); // NOI18N
jMenu7.setText("Sair");
jMenu7.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
jMenuItem8.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
jMenuItem8.setText("Sair");
jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem8ActionPerformed(evt);
}
});
jMenu7.add(jMenuItem8);
jMenuBar1.add(jMenu7);
setJMenuBar(jMenuBar1);
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)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(0, 357, Short.MAX_VALUE)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jMenuItem6ActionPerformed
private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
// TODO add your handling code here:
this.setExtendedState(this.MAXIMIZED_BOTH);
lblLogado.setText(usuarioLogado);
//System.out.println(idLogado);
String logId = String.valueOf(idLogado);
// int number = Integer.parseInt(idLogado);
txtIdLogado.setText(logId);// Int(idLogado);
txtlogado.setText(usuarioLogado);
PrintWriter out;
try {
out = new PrintWriter(new FileWriter("C:\\Librography\\LoggedIn"));
txtIdLogado.write(out);
} catch (IOException ex) {
Logger.getLogger(FormMenuAtendente.class.getName()).log(Level.SEVERE, null, ex);
}//totxt//totxt
this.setVisible(true);
}//GEN-LAST:event_formWindowActivated
private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
FormLivros BookForn = new FormLivros();
//centralizar
BookForn.pack();
BookForn.setLocationRelativeTo(null);
BookForn.setVisible(true);
}//GEN-LAST:event_jMenuItem3ActionPerformed
private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
FormEmprestimos emprestForn = new FormEmprestimos();
//centralizar
emprestForn.pack();
emprestForn.setLocationRelativeTo(null);
emprestForn.setVisible(true);
}//GEN-LAST:event_jMenuItem4ActionPerformed
private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
super.dispose();
}//GEN-LAST:event_jMenuItem8ActionPerformed
private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed
// TODO add your handling code here:
FormLeitor leitor = new FormLeitor();
//centralizar
leitor.pack();
leitor.setLocationRelativeTo(null);
leitor.setVisible(true);
}//GEN-LAST:event_jMenuItem9ActionPerformed
/**
* @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(FormMenuAtendente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(FormMenuAtendente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(FormMenuAtendente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FormMenuAtendente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new FormMenuAtendente().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu4;
private javax.swing.JMenu jMenu5;
private javax.swing.JMenu jMenu7;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jMenuItem3;
private javax.swing.JMenuItem jMenuItem4;
private javax.swing.JMenuItem jMenuItem5;
private javax.swing.JMenuItem jMenuItem6;
private javax.swing.JMenuItem jMenuItem8;
private javax.swing.JMenuItem jMenuItem9;
private javax.swing.JPanel jPanel1;
private javax.swing.JLabel lblLogado;
private javax.swing.JTextField txtIdLogado;
private javax.swing.JTextField txtlogado;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,606 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.9" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<NonVisualComponents>
<Component class="javax.swing.JTextField" name="txtlogado">
</Component>
<Menu class="javax.swing.JMenuBar" name="jMenuBar1">
</Menu>
</NonVisualComponents>
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="40" green="40" id="darkGray" palette="1" red="40" type="palette"/>
</Property>
<Property name="undecorated" type="boolean" value="true"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/>
</Events>
<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"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,105,0,0,4,23"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="3" fill="0" ipadX="601" ipadY="8" insetsTop="6" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lblLogado" min="-2" pref="143" max="-2" attributes="0"/>
<EmptySpace pref="607" 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 pref="14" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="lblLogado" alignment="1" min="-2" pref="20" max="-2" attributes="0"/>
<Component id="jLabel1" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="Logado como:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblLogado">
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="Id:"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="20" insetsLeft="61" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="txtIdLogado">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="enabled" type="boolean" value="false"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value=""/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="2" gridY="2" gridWidth="4" gridHeight="2" fill="0" ipadX="15" ipadY="0" insetsTop="20" insetsLeft="6" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Container class="javax.swing.JPanel" name="jPanel2">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="0" type="rgb"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="0" gridWidth="6" gridHeight="1" fill="0" ipadX="721" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel3" pref="945" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" pref="54" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="24" style="0"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="Terminal de Consulta"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel3">
<Properties>
<Property name="toolTipText" type="java.lang.String" value=""/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="1" gridWidth="3" gridHeight="1" fill="0" ipadX="9" ipadY="12" insetsTop="10" insetsLeft="17" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="16" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane5" min="-2" pref="366" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtBuscaLivro" min="-2" pref="242" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="25" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
<Component id="jScrollPane3" min="-2" pref="499" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
<Component id="txtPrazoEntrega" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="9" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="lblImagem" min="-2" pref="126" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtBookId" min="-2" pref="93" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtISBN" min="-2" pref="178" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel11" min="-2" max="-2" attributes="0"/>
<Component id="jLabel23" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="txtTituloSelect" alignment="0" min="-2" pref="313" max="-2" attributes="0"/>
<Component id="txtStatus" alignment="1" min="-2" pref="313" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel20" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" alignment="0" groupAlignment="1" attributes="0">
<Component id="lblAutor" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="lblEditora" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="-2" pref="11" max="-2" attributes="0"/>
<Component id="jLabel19" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Component id="txtEditora" alignment="0" max="32767" attributes="0"/>
<Component id="txtAutor" alignment="0" max="32767" attributes="0"/>
<Component id="txtSerie" alignment="0" min="-2" pref="313" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="3" max="-2" attributes="0"/>
<Component id="txtIdioma" min="-2" pref="154" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="lblAno" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtAno" min="-2" pref="43" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="lblEdicao" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="txtEdicao" min="-2" pref="45" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="txtTituloSelect" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel23" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtStatus" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="103" alignment="1" groupAlignment="3" attributes="0">
<Component id="txtBookId" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jLabel10" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="txtISBN" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="txtAutor" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblAutor" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="txtEditora" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblEditora" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel19" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtSerie" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="11" max="-2" attributes="0"/>
<Component id="lblImagem" min="-2" pref="190" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="lblEdicao" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtEdicao" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel20" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtIdioma" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblAno" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtAno" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="txtPrazoEntrega" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane3" min="-2" pref="106" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtBuscaLivro" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jScrollPane5" min="-2" pref="398" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace pref="18" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JTextField" name="txtBuscaLivro">
<Events>
<EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtBuscaLivroKeyReleased"/>
</Events>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane5">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="tabelaLivrosFiltro">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
<Table columnCount="7" rowCount="0">
<Column editable="false" title="Disponibilidade" type="java.lang.Object"/>
<Column editable="false" title="T&#xed;tulo" type="java.lang.Object"/>
<Column editable="true" title="Observa&#xe7;&#xf5;es" type="java.lang.Object"/>
<Column editable="false" title="Localiza&#xe7;&#xe3;o" type="java.lang.Object"/>
<Column editable="false" title="Cod" type="java.lang.Object"/>
<Column editable="false" title="ISBN" type="java.lang.Object"/>
<Column editable="false" title="Emprestado" type="java.lang.Object"/>
</Table>
</Property>
<Property name="autoResizeMode" type="int" value="0"/>
<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="tabelaLivrosFiltroMouseClicked"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_AddingCodePost" type="java.lang.String" value="tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(0)).setPreferredWidth(34);&#xa;tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(1)).setPreferredWidth(170);&#xa;tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(2)).setPreferredWidth(150);&#xa;tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(3)).setPreferredWidth(140);"/>
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new javax.swing.JTable()&#xa;/*&#xa;{&#xa; @Override&#xa; public Component prepareRenderer (TableCellRenderer renderer, int rowIndex, int columnIndex){&#xa; Component componenet = super.prepareRenderer(renderer, rowIndex, columnIndex);&#xa; Object value = getModel().getValueAt(rowIndex,columnIndex);&#xa;&#xa; System.out.println(&quot;value ===&quot; +value);&#xa; if(columnIndex == 6){&#xa; if(value.equals(&quot;true&quot;))&#xa; {&#xa; componenet.setBackground(Color.RED);&#xa; componenet.setForeground(Color.GREEN);&#xa; }&#xa; if(value.equals(&quot;false&quot;)){&#xa; componenet.setBackground(Color.GREEN);&#xa; componenet.setForeground(Color.RED);&#xa; }&#xa; }else {&#xa; componenet.setBackground(Color.WHITE);&#xa; componenet.setForeground(Color.BLACK);&#xa; }&#xa; return componenet;&#xa; }&#xa;&#xa;}&#xa;*/&#xa;"/>
</AuxValues>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="lblImagem">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/imagens/book_cover.png"/>
</Property>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
<EtchetBorder bevelType="0">
<Color PropertyName="highlight" blue="ff" green="ff" id="white" palette="1" red="ff" type="palette"/>
<Color PropertyName="shadow" blue="40" green="40" id="darkGray" palette="1" red="40" type="palette"/>
</EtchetBorder>
</Border>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel23">
<Properties>
<Property name="text" type="java.lang.String" value="T&#xed;tulo:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel11">
<Properties>
<Property name="text" type="java.lang.String" value="Status:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtTituloSelect">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="66" green="66" red="66" type="rgb"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtTituloSelectActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JTextField" name="txtStatus">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="66" green="66" red="66" type="rgb"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtStatusActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JTextField" name="txtBookId">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="66" green="66" red="66" type="rgb"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel10">
<Properties>
<Property name="text" type="java.lang.String" value="&lt;html&gt;ISBN/&lt;br&gt;ISSN:&#xa;"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtISBN">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="66" green="66" red="66" type="rgb"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtISBNActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JTextField" name="txtAutor">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="66" green="66" red="66" type="rgb"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblAutor">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Autor:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblEditora">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Editora:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtEditora">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="66" green="66" red="66" type="rgb"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtSerie">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="66" green="66" red="66" type="rgb"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel19">
<Properties>
<Property name="text" type="java.lang.String" value="S&#xe9;rie:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel20">
<Properties>
<Property name="text" type="java.lang.String" value="Idioma:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtIdioma">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="66" green="66" red="66" type="rgb"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtIdiomaActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="text" type="java.lang.String" value="Localiza&#xe7;&#xe3;o"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtPrazoEntrega">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="66" green="66" red="66" type="rgb"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtPrazoEntregaActionPerformed"/>
</Events>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane3">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="txtObservacoes">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="columns" type="int" value="20"/>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="66" green="66" red="66" type="rgb"/>
</Property>
<Property name="rows" type="int" value="5"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="jLabel8">
<Properties>
<Property name="text" type="java.lang.String" value="Ficha T&#xe9;cnica:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtEdicao">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="66" green="66" red="66" type="rgb"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JFormattedTextField" name="txtAno">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="66" green="66" red="66" type="rgb"/>
</Property>
<Property name="formatterFactory" type="javax.swing.JFormattedTextField$AbstractFormatterFactory" editor="org.netbeans.modules.form.editors.AbstractFormatterFactoryEditor" preCode="try {" postCode="} catch (java.text.ParseException ex) {&#xa;ex.printStackTrace();&#xa;}">
<Format format="####" subtype="-1" type="5"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblAno">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Ano:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblEdicao">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Edi&#xe7;&#xe3;o:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="text" type="java.lang.String" value="Livro ID:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="Filtrar Livro:"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
@@ -0,0 +1,692 @@
/*
* 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.
*/
package br.com.projeto.view;
import br.com.projeto.dao.EmprestimoDao;
import br.com.projeto.dao.LivroDao;
import br.com.projeto.model.Livro;
import java.awt.Image;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.table.DefaultTableModel;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class FormMenuUsuario extends javax.swing.JFrame {
public String usuarioLogado;
public int idLogado;
/**
* Creates new form formMenu
*/
public FormMenuUsuario() {
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() {
java.awt.GridBagConstraints gridBagConstraints;
txtlogado = new javax.swing.JTextField();
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
lblLogado = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
txtIdLogado = new javax.swing.JTextField();
jPanel2 = new javax.swing.JPanel();
jLabel3 = new javax.swing.JLabel();
jPanel3 = new javax.swing.JPanel();
txtBuscaLivro = new javax.swing.JTextField();
jScrollPane5 = new javax.swing.JScrollPane();
tabelaLivrosFiltro = new javax.swing.JTable()
/*
{
@Override
public Component prepareRenderer (TableCellRenderer renderer, int rowIndex, int columnIndex){
Component componenet = super.prepareRenderer(renderer, rowIndex, columnIndex);
Object value = getModel().getValueAt(rowIndex,columnIndex);
System.out.println("value ===" +value);
if(columnIndex == 6){
if(value.equals("true"))
{
componenet.setBackground(Color.RED);
componenet.setForeground(Color.GREEN);
}
if(value.equals("false")){
componenet.setBackground(Color.GREEN);
componenet.setForeground(Color.RED);
}
}else {
componenet.setBackground(Color.WHITE);
componenet.setForeground(Color.BLACK);
}
return componenet;
}
}
*/
;
lblImagem = new javax.swing.JLabel();
jLabel23 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
txtTituloSelect = new javax.swing.JTextField();
txtStatus = new javax.swing.JTextField();
txtBookId = new javax.swing.JTextField();
jLabel10 = new javax.swing.JLabel();
txtISBN = new javax.swing.JTextField();
txtAutor = new javax.swing.JTextField();
lblAutor = new javax.swing.JLabel();
lblEditora = new javax.swing.JLabel();
txtEditora = new javax.swing.JTextField();
txtSerie = new javax.swing.JTextField();
jLabel19 = new javax.swing.JLabel();
jLabel20 = new javax.swing.JLabel();
txtIdioma = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
txtPrazoEntrega = new javax.swing.JTextField();
jScrollPane3 = new javax.swing.JScrollPane();
txtObservacoes = new javax.swing.JTextArea();
jLabel8 = new javax.swing.JLabel();
txtEdicao = new javax.swing.JTextField();
txtAno = new javax.swing.JFormattedTextField();
lblAno = new javax.swing.JLabel();
lblEdicao = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jMenuBar1 = new javax.swing.JMenuBar();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setForeground(java.awt.Color.darkGray);
setUndecorated(true);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowActivated(java.awt.event.WindowEvent evt) {
formWindowActivated(evt);
}
});
getContentPane().setLayout(new java.awt.GridBagLayout());
jLabel1.setText("Logado como:");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblLogado, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(607, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(14, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblLogado, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING))
.addGap(10, 10, 10))
);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 2;
gridBagConstraints.gridheight = 3;
gridBagConstraints.ipadx = 601;
gridBagConstraints.ipady = 8;
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 0);
getContentPane().add(jPanel1, gridBagConstraints);
jLabel2.setText("Id:");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 2;
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
gridBagConstraints.insets = new java.awt.Insets(20, 61, 0, 0);
getContentPane().add(jLabel2, gridBagConstraints);
txtIdLogado.setEditable(false);
txtIdLogado.setEnabled(false);
txtIdLogado.setFocusable(false);
txtIdLogado.setOpaque(false);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 2;
gridBagConstraints.gridwidth = 4;
gridBagConstraints.gridheight = 2;
gridBagConstraints.ipadx = 15;
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
gridBagConstraints.insets = new java.awt.Insets(20, 6, 0, 0);
getContentPane().add(txtIdLogado, gridBagConstraints);
jPanel2.setBackground(new java.awt.Color(0, 0, 0));
jLabel3.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
jLabel3.setForeground(new java.awt.Color(255, 255, 255));
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel3.setText("Terminal de Consulta");
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()
.addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 945, Short.MAX_VALUE)
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
gridBagConstraints.gridwidth = 6;
gridBagConstraints.ipadx = 721;
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
getContentPane().add(jPanel2, gridBagConstraints);
jPanel3.setToolTipText("");
txtBuscaLivro.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtBuscaLivroKeyReleased(evt);
}
});
tabelaLivrosFiltro.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"Disponibilidade", "Título", "Observações", "Localização", "Cod", "ISBN", "Emprestado"
}
) {
boolean[] canEdit = new boolean [] {
false, false, true, false, false, false, false
};
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
tabelaLivrosFiltro.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
tabelaLivrosFiltro.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
tabelaLivrosFiltroMouseClicked(evt);
}
});
jScrollPane5.setViewportView(tabelaLivrosFiltro);
tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(0)).setPreferredWidth(34);
tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(1)).setPreferredWidth(170);
tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(2)).setPreferredWidth(150);
tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(3)).setPreferredWidth(140);
lblImagem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/book_cover.png"))); // NOI18N
lblImagem.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, java.awt.Color.white, java.awt.Color.darkGray));
jLabel23.setText("Título:");
jLabel11.setText("Status:");
txtTituloSelect.setEditable(false);
txtTituloSelect.setForeground(new java.awt.Color(102, 102, 102));
txtTituloSelect.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtTituloSelectActionPerformed(evt);
}
});
txtStatus.setEditable(false);
txtStatus.setForeground(new java.awt.Color(102, 102, 102));
txtStatus.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtStatusActionPerformed(evt);
}
});
txtBookId.setEditable(false);
txtBookId.setForeground(new java.awt.Color(102, 102, 102));
jLabel10.setText("<html>ISBN/<br>ISSN:\n");
txtISBN.setEditable(false);
txtISBN.setForeground(new java.awt.Color(102, 102, 102));
txtISBN.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtISBNActionPerformed(evt);
}
});
txtAutor.setEditable(false);
txtAutor.setForeground(new java.awt.Color(102, 102, 102));
lblAutor.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
lblAutor.setText("Autor:");
lblEditora.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
lblEditora.setText("Editora:");
txtEditora.setEditable(false);
txtEditora.setForeground(new java.awt.Color(102, 102, 102));
txtSerie.setEditable(false);
txtSerie.setForeground(new java.awt.Color(102, 102, 102));
jLabel19.setText("Série:");
jLabel20.setText("Idioma:");
txtIdioma.setEditable(false);
txtIdioma.setForeground(new java.awt.Color(102, 102, 102));
txtIdioma.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtIdiomaActionPerformed(evt);
}
});
jLabel4.setText("Localização");
txtPrazoEntrega.setEditable(false);
txtPrazoEntrega.setForeground(new java.awt.Color(102, 102, 102));
txtPrazoEntrega.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtPrazoEntregaActionPerformed(evt);
}
});
txtObservacoes.setEditable(false);
txtObservacoes.setColumns(20);
txtObservacoes.setForeground(new java.awt.Color(102, 102, 102));
txtObservacoes.setRows(5);
jScrollPane3.setViewportView(txtObservacoes);
jLabel8.setText("Ficha Técnica:");
txtEdicao.setEditable(false);
txtEdicao.setForeground(new java.awt.Color(102, 102, 102));
txtAno.setEditable(false);
txtAno.setForeground(new java.awt.Color(102, 102, 102));
try {
txtAno.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("####")));
} catch (java.text.ParseException ex) {
ex.printStackTrace();
}
lblAno.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
lblAno.setText("Ano:");
lblEdicao.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
lblEdicao.setText("Edição:");
jLabel7.setText("Livro ID:");
jLabel5.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
jLabel5.setText("Filtrar Livro:");
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(16, 16, 16)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 366, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtBuscaLivro, javax.swing.GroupLayout.PREFERRED_SIZE, 242, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(25, 25, 25)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel8)
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 499, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(jLabel4)
.addGap(9, 9, 9)
.addComponent(txtPrazoEntrega))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addGap(0, 9, Short.MAX_VALUE)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addComponent(lblImagem, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtBookId, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtISBN, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel11)
.addComponent(jLabel23))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtTituloSelect, javax.swing.GroupLayout.PREFERRED_SIZE, 313, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtStatus, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 313, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addComponent(jLabel20)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(lblAutor)
.addComponent(lblEditora))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addGap(11, 11, 11)
.addComponent(jLabel19)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(txtEditora, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtAutor, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtSerie, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 313, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(3, 3, 3)
.addComponent(txtIdioma, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lblAno)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtAno, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(lblEdicao)
.addGap(18, 18, 18)
.addComponent(txtEdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)))))))
.addContainerGap())
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtTituloSelect, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel23))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel11)
.addComponent(txtStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtBookId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel7))
.addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtISBN, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtAutor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblAutor))
.addGap(18, 18, 18)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtEditora, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblEditora))
.addGap(20, 20, 20)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel19)
.addComponent(txtSerie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup()
.addGap(11, 11, 11)
.addComponent(lblImagem, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(18, 18, 18)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblEdicao)
.addComponent(txtEdicao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel20)
.addComponent(txtIdioma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblAno)
.addComponent(txtAno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(8, 8, 8)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtPrazoEntrega, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(txtBuscaLivro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 398, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(18, Short.MAX_VALUE))
);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 1;
gridBagConstraints.gridwidth = 3;
gridBagConstraints.ipadx = 9;
gridBagConstraints.ipady = 12;
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
gridBagConstraints.insets = new java.awt.Insets(10, 17, 0, 0);
getContentPane().add(jPanel3, gridBagConstraints);
setJMenuBar(jMenuBar1);
pack();
}// </editor-fold>//GEN-END:initComponents
public void listarLivrosFiltro() throws Exception {
LivroDao dao = new LivroDao();
List<Livro> lista = dao.buscarLivros();
DefaultTableModel dados = (DefaultTableModel) tabelaLivrosFiltro.getModel();
dados.setNumRows(0);
for (Livro c : lista) {
dados.addRow(new Object[]{
c.getDisponibilidade(),
c.getTitulo(),
//trocar para ususario que emprestou
c.getObservacoes(),
c.getSecao(),
c.getId(),
c.getIsbn(),
c.isEmprestado(),});
}
}
private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
try {
listarLivrosFiltro();
} catch (Exception ex) {
Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex);
}
this.setExtendedState(this.MAXIMIZED_BOTH);
lblLogado.setText(usuarioLogado);
String logId = String.valueOf(idLogado);
txtIdLogado.setText(logId);// Int(idLogado);
txtlogado.setText(usuarioLogado);
PrintWriter out;
try {
out = new PrintWriter(new FileWriter("C:\\Librography\\LoggedIn"));
txtIdLogado.write(out);
} catch (IOException ex) {
Logger.getLogger(FormMenuUsuario.class.getName()).log(Level.SEVERE, null, ex);
}
this.setVisible(true);
}//GEN-LAST:event_formWindowActivated
////
private void tabelaLivrosFiltroMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaLivrosFiltroMouseClicked
try {
DefaultTableModel model = (DefaultTableModel) tabelaLivrosFiltro.getModel();
int selectedRowIndex = tabelaLivrosFiltro.getSelectedRow();
txtBookId.setText(model.getValueAt(selectedRowIndex, 4).toString());
txtTituloSelect.setText(model.getValueAt(selectedRowIndex, 1).toString());
txtObservacoes.setText(model.getValueAt(selectedRowIndex, 2).toString());
String path = "C:\\Librography\\images\\books\\" + txtISBN.getText();
EmprestimoDao emprestimodao = new EmprestimoDao();
lblImagem.setIcon(ResizeBookImage(path));
txtStatus.setText(emprestimodao.campoStatusLista(Integer.parseInt(txtBookId.getText())));
Livro livro = new Livro();
LivroDao livrodao = new LivroDao();
livro = livrodao.buscarLivro(txtTituloSelect.getText());
txtAutor.setText(livro.getAutor());
txtEditora.setText(livro.getEditora());
txtSerie.setText(livro.getSerie());
txtIdioma.setText(livro.getIdioma());
txtAno.setText(livro.getAno());
txtEdicao.setText(livro.getEdicao());
txtISBN.setText(livro.getIsbn());
txtPrazoEntrega.setText(livro.getPiso() + " / " + livro.getCorredor() + " / " + livro.getPosicao() + " / " + livro.getSecao());
} catch (Exception ex) {
Logger.getLogger(FormMenuUsuario.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_tabelaLivrosFiltroMouseClicked
private void txtBuscaLivroKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtBuscaLivroKeyReleased
}//GEN-LAST:event_txtBuscaLivroKeyReleased
private void txtTituloSelectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtTituloSelectActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_txtTituloSelectActionPerformed
private void txtISBNActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtISBNActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_txtISBNActionPerformed
private void txtPrazoEntregaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPrazoEntregaActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_txtPrazoEntregaActionPerformed
private void txtIdiomaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtIdiomaActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_txtIdiomaActionPerformed
private void txtStatusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtStatusActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_txtStatusActionPerformed
/**
* @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(FormMenuUsuario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(FormMenuUsuario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(FormMenuUsuario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FormMenuUsuario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new FormMenuUsuario().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel19;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel20;
private javax.swing.JLabel jLabel23;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JScrollPane jScrollPane5;
private javax.swing.JLabel lblAno;
private javax.swing.JLabel lblAutor;
private javax.swing.JLabel lblEdicao;
private javax.swing.JLabel lblEditora;
private javax.swing.JLabel lblImagem;
private javax.swing.JLabel lblLogado;
private javax.swing.JTable tabelaLivrosFiltro;
private javax.swing.JFormattedTextField txtAno;
private javax.swing.JTextField txtAutor;
private javax.swing.JTextField txtBookId;
private javax.swing.JTextField txtBuscaLivro;
private javax.swing.JTextField txtEdicao;
private javax.swing.JTextField txtEditora;
private javax.swing.JTextField txtISBN;
private javax.swing.JTextField txtIdLogado;
private javax.swing.JTextField txtIdioma;
private javax.swing.JTextArea txtObservacoes;
private javax.swing.JTextField txtPrazoEntrega;
private javax.swing.JTextField txtSerie;
private javax.swing.JTextField txtStatus;
private javax.swing.JTextField txtTituloSelect;
private javax.swing.JTextField txtlogado;
// End of variables declaration//GEN-END:variables
private ImageIcon ResizeBookImage(String imgPath) { //192x261
int imageX = 126;
int imageY = 194;
lblImagem.setSize(imageX, imageY);
ImageIcon myImage = new ImageIcon(imgPath);
Image img = myImage.getImage();
Image newImage = img.getScaledInstance(lblImagem.getWidth(), lblImagem.getHeight(), Image.SCALE_SMOOTH);
ImageIcon image = new ImageIcon(newImage);
return image;
}
}
+280
View File
@@ -0,0 +1,280 @@
<?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="2"/>
<Property name="focusable" type="boolean" value="false"/>
<Property name="focusableWindowState" type="boolean" value="false"/>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[448, 175]"/>
</Property>
<Property name="undecorated" type="boolean" value="true"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[448, 175]"/>
</Property>
<Property name="resizable" type="boolean" value="false"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="true"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/>
</Events>
<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"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,-81,0,0,1,-63"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="true"/>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel2">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="0" y="22" width="440" height="150"/>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="15" max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtNumMulta" min="-2" pref="84" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="33" max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtLeitorId" max="32767" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtEmprestimoId" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="59" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="txtDiasAtraso" min="-2" pref="53" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtNomeLivro" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtValorMulta" min="-2" pref="79" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtImprimeMulta" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="btnReceberMulta" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jButton2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtNumMulta" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtLeitorId" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtDiasAtraso" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtEmprestimoId" 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="txtNomeLivro" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtValorMulta" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
<Component id="txtImprimeMulta" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnReceberMulta" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace pref="10" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="N&#xba; da Multa:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="Livro:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="text" type="java.lang.String" value="Dias de Atraso:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="text" type="java.lang.String" value="Valor da Multa:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="text" type="java.lang.String" value="Id de Usu&#xe1;rio:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="text" type="java.lang.String" value="Referente Empr&#xe9;stimo n&#xba;:"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="txtImprimeMulta">
<Properties>
<Property name="text" type="java.lang.String" value="Imprimir"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtImprimeMultaActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="jButton2">
<Properties>
<Property name="text" type="java.lang.String" value="Fechar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JTextField" name="txtNumMulta">
</Component>
<Component class="javax.swing.JTextField" name="txtEmprestimoId">
</Component>
<Component class="javax.swing.JTextField" name="txtLeitorId">
</Component>
<Component class="javax.swing.JTextField" name="txtDiasAtraso">
</Component>
<Component class="javax.swing.JTextField" name="txtNomeLivro">
</Component>
<Component class="javax.swing.JTextField" name="txtValorMulta">
</Component>
<Component class="javax.swing.JButton" name="btnReceberMulta">
<Properties>
<Property name="text" type="java.lang.String" value="Receber"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnReceberMultaActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel1">
<Properties>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="0" type="rgb"/>
</Property>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="0" y="0" width="520" height="30"/>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jPanel3" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="3" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jPanel3" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="9" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel3">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="cc" red="66" type="rgb"/>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="70" max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" pref="306" max="-2" attributes="0"/>
<EmptySpace pref="141" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel3" alignment="0" pref="21" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="24" style="0"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="MULTA"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Form>
+410
View File
@@ -0,0 +1,410 @@
/*
* 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.
*/
package br.com.projeto.view;
import br.com.projeto.dao.EmprestimoDao;
import br.com.projeto.dao.FuncionarioDao;
import br.com.projeto.dao.LivroDao;
import br.com.projeto.dao.MultaDao;
import br.com.projeto.dao.ReciboDao;
import br.com.projeto.model.Funcionario;
import br.com.projeto.model.Multa;
import br.com.projeto.model.Utilitarios;
import java.awt.Font;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JEditorPane;
import javax.swing.JOptionPane;
/**
*
* @author Everton Luiz Kozloski - evertonkozloski@hotmail.com
*/
public class FormMulta extends javax.swing.JFrame {
/**
* Creates new form FormMulta
*/
public FormMulta() {
initComponents();
}
public void listarMulta(int idDoEmprestimo) throws Exception {
MultaDao dao = new MultaDao();
EmprestimoDao emprest = new EmprestimoDao();
Utilitarios util = new Utilitarios();
LivroDao lvr = new LivroDao();
List<Multa> lista = dao.listaMulta(idDoEmprestimo);
for (Multa c : lista) {
txtNumMulta.setText(String.valueOf(c.getId()));
txtDiasAtraso.setText(String.valueOf(c.getDias_atraso()));
txtValorMulta.setText(util.campoMulta(c.getValor_multa()));//(util.campoMulta(multa))
Boolean esta_pago = c.isEsta_pago();
txtLeitorId.setText(emprest.getUserData("nome", c.getTb_leitores_id()));//formatter
txtEmprestimoId.setText(String.valueOf(c.getTb_emprestimos_id()));
txtNomeLivro.setText(lvr.getLivroData("titulo", emprest.getEmprestimoFKeyData("tb_livros_id", c.getTb_emprestimos_id())));//formatter
}
}
public FormMulta(int msgEmpId) throws Exception { //cria construtor apenas com a variavel, que é usada para consulta no db e popular campos
initComponents();
listarMulta(msgEmpId);
//esta criando uma multa a cada vez que clica no botao
}
public void imprimeMulta(int idDoEmprestimo) throws Exception {
Utilitarios util = new Utilitarios();
Funcionario funcionario = new Funcionario();
String contentid = new String(Files.readAllBytes(Paths.get("C:\\Librography\\LoggedIn")));
funcionario.setId(Integer.parseInt(contentid));
FuncionarioDao funcionariodao = new FuncionarioDao();
String nomeFuncionario = funcionariodao.getFuncionarioData("nome", funcionario.getId());
String toBCode = String.format("%08d", idDoEmprestimo);
//int code = Integer.parseInt(toBCode);
util.gerarBarCode("Multa", idDoEmprestimo);
util.gerarQrCode("Multa", idDoEmprestimo);
//System.out.println("code==" + code);
String QrImage = "file:C:\\\\Librography\\\\images\\\\Multas\\\\QrCode\\\\" + toBCode;
String BarCodeImage = "file:C:\\\\Librography\\\\images\\\\Multas\\\\BarCode\\\\" + toBCode;
String filepath = "C:\\Librography\\ticket";
//LivroDao livro = new LivroDao();
String livroNome = txtNomeLivro.getText();
File arquivo = new File(filepath);
if (!arquivo.exists()) {
arquivo.createNewFile();
}
String line = "Obrigado pela Preferencia";
JEditorPane p = new JEditorPane("file:" + filepath);
p.setContentType("text/html");
p.setFont(new Font("Helvetica", 0, 9));
StringBuilder htmlContent = new StringBuilder();
htmlContent.append("<html><head></head><body><p>");
htmlContent.append("<h3><img src='file:C:\\Librography\\images\\libraryLogo.png' width=30 height=30></img>");
htmlContent.append("BIBLIOTECA DE HOGWARTS</h3>");
htmlContent.append("<h3 align=center>MULTA POR ATRASO</h3><br>");
htmlContent.append("LIVRO:");
htmlContent.append("<h4 align=right>").append(String.format("%26s", livroNome)).append("</h4>");
htmlContent.append("Valor da Multa:");
htmlContent.append("<h4 align=right>").append(String.format("%26s", txtValorMulta.getText())).append("</h4>");
htmlContent.append("Referenmte Empréstimo nº::");
htmlContent.append("<h4 align=right>").append(String.format("%26s", txtEmprestimoId.getText())).append("</h4>");
htmlContent.append(" Multa: ").append(String.format("%26s", txtValorMulta.getText())).append("<br>");
htmlContent.append("Dias de Atraso:: ").append(String.format("%26s", txtDiasAtraso.getText())).append("<br>");
htmlContent.append(" Usuário: ").append(String.format("%26s", txtLeitorId.getText().toUpperCase())).append("<br>");
htmlContent.append(" Atendente: ").append(String.format("%26s", nomeFuncionario.toUpperCase())).append("<br>");
htmlContent.append("<img src='").append(BarCodeImage).append("' width=100 height=40></img>");
htmlContent.append("<img src='").append(QrImage).append("' width=40 height=40></img><br>");
htmlContent.append("<font face=\"monospace\">").append(line).append("</font><br><br><br>");
htmlContent.append("</body>");
htmlContent.append("</html>");
p.setText(htmlContent.toString());
ReciboDao recibodao = new ReciboDao();
recibodao.imprimirTicket(p, 1);
arquivo.delete();
}
/**
* 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() {
jPanel2 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
txtImprimeMulta = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
txtNumMulta = new javax.swing.JTextField();
txtEmprestimoId = new javax.swing.JTextField();
txtLeitorId = new javax.swing.JTextField();
txtDiasAtraso = new javax.swing.JTextField();
txtNomeLivro = new javax.swing.JTextField();
txtValorMulta = new javax.swing.JTextField();
btnReceberMulta = new javax.swing.JButton();
jPanel1 = new javax.swing.JPanel();
jPanel3 = new javax.swing.JPanel();
jLabel3 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setFocusable(false);
setFocusableWindowState(false);
setMinimumSize(new java.awt.Dimension(448, 175));
setUndecorated(true);
setPreferredSize(new java.awt.Dimension(448, 175));
setResizable(false);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowActivated(java.awt.event.WindowEvent evt) {
formWindowActivated(evt);
}
});
getContentPane().setLayout(null);
jLabel2.setText("Nº da Multa:");
jLabel1.setText("Livro:");
jLabel4.setText("Dias de Atraso:");
jLabel5.setText("Valor da Multa:");
jLabel6.setText("Id de Usuário:");
jLabel7.setText("Referente Empréstimo nº:");
txtImprimeMulta.setText("Imprimir");
txtImprimeMulta.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtImprimeMultaActionPerformed(evt);
}
});
jButton2.setText("Fechar");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
btnReceberMulta.setText("Receber");
btnReceberMulta.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnReceberMultaActionPerformed(evt);
}
});
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(15, 15, 15)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtNumMulta, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(33, 33, 33)
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtLeitorId))
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtEmprestimoId)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel4)
.addGap(59, 59, 59))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(txtDiasAtraso, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtNomeLivro))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(14, 14, 14)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtValorMulta, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtImprimeMulta)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnReceberMulta)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2)
.addGap(12, 12, 12))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtNumMulta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtLeitorId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(txtDiasAtraso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel7)
.addComponent(txtEmprestimoId, 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.BASELINE)
.addComponent(jLabel1)
.addComponent(txtNomeLivro, 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)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(txtValorMulta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtImprimeMulta)
.addComponent(jButton2)
.addComponent(btnReceberMulta)))
.addContainerGap(10, Short.MAX_VALUE))
);
getContentPane().add(jPanel2);
jPanel2.setBounds(0, 22, 440, 150);
jPanel1.setForeground(new java.awt.Color(0, 0, 0));
jPanel1.setOpaque(false);
jPanel3.setBackground(new java.awt.Color(102, 204, 255));
jLabel3.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
jLabel3.setForeground(new java.awt.Color(255, 255, 255));
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel3.setText("MULTA");
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(70, 70, 70)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 306, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(141, Short.MAX_VALUE))
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 21, Short.MAX_VALUE)
);
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(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 3, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(9, Short.MAX_VALUE))
);
getContentPane().add(jPanel1);
jPanel1.setBounds(0, 0, 520, 30);
pack();
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
// TODO add your handling code here:
super.dispose();
}//GEN-LAST:event_jButton2ActionPerformed
private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
//pegar dados de user
}//GEN-LAST:event_formWindowActivated
private void btnReceberMultaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReceberMultaActionPerformed
String multa = txtValorMulta.getText();
if (!multa.equals("Em dia")) {
Utilitarios util = new Utilitarios();
int i = util.okcancel("Confirma o recebimento do valor de " + multa + ", Recebimento do Livro e desbloqueio do usuário?");
System.out.println("ret : " + i);
try {
EmprestimoDao devEmpres = new EmprestimoDao();
MultaDao multaDao = new MultaDao();
devEmpres.devolveLivro(Integer.parseInt(txtEmprestimoId.getText()));
multaDao.zeraMulta(Integer.parseInt(txtNumMulta.getText()));
} catch (Exception ex) {
Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex);
}
} else {
JOptionPane.showMessageDialog(null, "Não há multa registrada");
}
}//GEN-LAST:event_btnReceberMultaActionPerformed
private void txtImprimeMultaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtImprimeMultaActionPerformed
try {
this.imprimeMulta(Integer.parseInt(txtEmprestimoId.getText()));
} catch (Exception ex) {
Logger.getLogger(FormMulta.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_txtImprimeMultaActionPerformed
/**
* @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(FormMulta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(FormMulta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(FormMulta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FormMulta.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 FormMulta().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnReceberMulta;
private javax.swing.JButton jButton2;
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.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JTextField txtDiasAtraso;
private javax.swing.JTextField txtEmprestimoId;
private javax.swing.JButton txtImprimeMulta;
private javax.swing.JTextField txtLeitorId;
private javax.swing.JTextField txtNomeLivro;
private javax.swing.JTextField txtNumMulta;
private javax.swing.JTextField txtValorMulta;
// End of variables declaration//GEN-END:variables
}
+873
View File
@@ -0,0 +1,873 @@
<?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="2"/>
<Property name="resizable" type="boolean" value="false"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="true"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/>
</Events>
<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" max="32767" attributes="0"/>
<Component id="jTabbedPane2" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jTabbedPane2" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="0" type="rgb"/>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel1" alignment="1" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" pref="54" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="24" style="0"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="Op&#xe7;&#xf5;es"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JTabbedPane" name="jTabbedPane2">
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel2">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Geral">
<Property name="tabTitle" type="java.lang.String" value="Geral"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="txtIp" min="-2" pref="251" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="btnSaveIp" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="jLabel12" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="txtUserDB" min="-2" pref="251" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="btnSaveUserDB" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="jLabel15" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="txtPassDB" min="-2" pref="251" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="btnSavePassDB" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="jLabel16" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="txtmsgRecibo" min="-2" pref="245" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
<Component id="btnSaveMsgRecibo" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="101" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel13" alignment="0" min="-2" pref="146" max="-2" attributes="0"/>
<Component id="lblLibraryLogo" alignment="0" min="-2" pref="143" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="22" max="-2" attributes="0"/>
<Component id="jLabel9" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="boxPrinter" min="-2" pref="251" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="btnSavePrinter" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel11" alignment="0" min="-2" pref="144" max="-2" attributes="0"/>
<Component id="jLabel10" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="txtLibraryName" min="-2" pref="320" max="-2" attributes="0"/>
<Component id="txtLibraryAddress" min="-2" pref="317" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="btnSetLibraryLogo" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="btnLibraryName" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="btnLibraryAddress" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtIp" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnSaveIp" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel12" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtUserDB" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnSaveUserDB" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel15" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnSavePassDB" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="txtPassDB" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="btnSaveMsgRecibo" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel16" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtmsgRecibo" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel13" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lblLibraryLogo" min="-2" pref="146" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="btnSetLibraryLogo" min="-2" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="boxPrinter" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnSavePrinter" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel10" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtLibraryName" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnLibraryName" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="23" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtLibraryAddress" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnLibraryAddress" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace pref="59" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="btnSaveIp">
<Properties>
<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="btnSaveIpActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="text" type="java.lang.String" value="IP ou Url do Servidor"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtIp">
</Component>
<Component class="javax.swing.JLabel" name="jLabel9">
<Properties>
<Property name="text" type="java.lang.String" value="Impressora Padr&#xe3;o:"/>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="boxPrinter">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="1">
<StringItem index="0" value="&lt;Selecione&gt;"/>
</StringArray>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxPrinterMouseClicked"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JButton" name="btnSavePrinter">
<Properties>
<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="btnSavePrinterActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel10">
<Properties>
<Property name="text" type="java.lang.String" value="Nome da Institui&#xe7;&#xe3;o:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel11">
<Properties>
<Property name="text" type="java.lang.String" value="Endere&#xe7;o da Institui&#xe7;&#xe3;o:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtLibraryName">
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtLibraryNameActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnLibraryAddress">
<Properties>
<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="btnLibraryAddressActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JTextField" name="txtLibraryAddress">
</Component>
<Component class="javax.swing.JButton" name="btnLibraryName">
<Properties>
<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="btnLibraryNameActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="lblLibraryLogo">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
<EtchetBorder bevelType="0">
<Color PropertyName="highlight" blue="ff" green="ff" id="white" palette="1" red="ff" type="palette"/>
<Color PropertyName="shadow" blue="40" green="40" id="darkGray" palette="1" red="40" type="palette"/>
</EtchetBorder>
</Border>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="btnSetLibraryLogo">
<Properties>
<Property name="text" type="java.lang.String" value="Selecione"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSetLibraryLogoActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel13">
<Properties>
<Property name="text" type="java.lang.String" value="Logotipo da Institui&#xe7;&#xe3;o"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel12">
<Properties>
<Property name="text" type="java.lang.String" value="Usuario banco de Dados:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtUserDB">
</Component>
<Component class="javax.swing.JButton" name="btnSaveUserDB">
<Properties>
<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="btnSaveUserDBActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel15">
<Properties>
<Property name="text" type="java.lang.String" value="Senha Banco de Dados:"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="btnSavePassDB">
<Properties>
<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="btnSavePassDBActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JPasswordField" name="txtPassDB">
</Component>
<Component class="javax.swing.JButton" name="btnSaveMsgRecibo">
<Properties>
<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="btnSaveMsgReciboActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel16">
<Properties>
<Property name="text" type="java.lang.String" value="Mensagem Recibo:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtmsgRecibo">
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel3">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Biblioteca">
<Property name="tabTitle" type="java.lang.String" value="Biblioteca"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="136" max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="21" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="txtPiso" alignment="0" max="32767" attributes="0"/>
<Component id="txtCorredor" alignment="0" max="32767" attributes="0"/>
<Component id="txtPosicao" alignment="0" max="32767" attributes="0"/>
<Component id="txtSecao" max="32767" attributes="0"/>
<Component id="txtDisponibilidade" min="-2" pref="195" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="btnAddPosicao" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="boxPosicao" min="-2" pref="225" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="btnApagarPosicao" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="btnAddCorredor" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="boxCorredor" min="-2" pref="225" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="btnApagarCorredor" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="btnAddPiso" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="boxPiso" min="-2" pref="225" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="btnExcluirPiso" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="btnAddDsiponibilidade" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="boxDisponibilidade" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="btnAddSecao" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="boxSecao" min="-2" pref="225" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="btnApagarSecao" min="-2" max="-2" attributes="0"/>
<Component id="btnApagarDisponibilidade" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</Group>
<EmptySpace pref="54" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="jLabel14" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtTipos" min="-2" pref="195" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="btnAddtipos" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="boxTipos" min="-2" pref="225" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="btnExcluirTipos" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="48" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="37" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnAddPiso" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="boxPiso" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnExcluirPiso" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="txtPiso" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="btnAddCorredor" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="boxCorredor" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnApagarCorredor" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtCorredor" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="txtPosicao" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnAddPosicao" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="boxPosicao" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnApagarPosicao" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
<Component id="btnAddSecao" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtSecao" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
<Component id="boxSecao" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnApagarSecao" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
<Component id="btnAddDsiponibilidade" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="boxDisponibilidade" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnApagarDisponibilidade" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtDisponibilidade" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="btnAddtipos" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="boxTipos" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnExcluirTipos" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtTipos" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel14" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="57" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="Piso:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="text" type="java.lang.String" value="Corredor:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="text" type="java.lang.String" value="Posi&#xe7;&#xe3;o:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="text" type="java.lang.String" value="Se&#xe7;&#xe3;o:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtPiso">
</Component>
<Component class="javax.swing.JTextField" name="txtCorredor">
</Component>
<Component class="javax.swing.JTextField" name="txtPosicao">
</Component>
<Component class="javax.swing.JTextField" name="txtSecao">
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtSecaoActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnAddPiso">
<Properties>
<Property name="text" type="java.lang.String" value="Add"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddPisoActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnAddCorredor">
<Properties>
<Property name="text" type="java.lang.String" value="Add"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddCorredorActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnAddPosicao">
<Properties>
<Property name="text" type="java.lang.String" value="Add"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddPosicaoActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnAddSecao">
<Properties>
<Property name="text" type="java.lang.String" value="Add"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddSecaoActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JComboBox" name="boxCorredor">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="1">
<StringItem index="0" value="&lt;Lista de Corredores&gt;"/>
</StringArray>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxCorredorMouseClicked"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JComboBox" name="boxPiso">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="1">
<StringItem index="0" value="&lt;Lista de Pisos&gt;"/>
</StringArray>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxPisoMouseClicked"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value=""/>
</AuxValues>
</Component>
<Component class="javax.swing.JComboBox" name="boxPosicao">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="1">
<StringItem index="0" value="&lt;Lista de Posi&#xe7;&#xf5;es&gt;"/>
</StringArray>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxPosicaoMouseClicked"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JComboBox" name="boxSecao">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="1">
<StringItem index="0" value="&lt;Lista de Se&#xe7;&#xf5;es&gt;"/>
</StringArray>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxSecaoMouseClicked"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JButton" name="btnExcluirPiso">
<Properties>
<Property name="text" type="java.lang.String" value="Apagar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnExcluirPisoActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnApagarCorredor">
<Properties>
<Property name="text" type="java.lang.String" value="Apagar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnApagarCorredorActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnApagarPosicao">
<Properties>
<Property name="text" type="java.lang.String" value="Apagar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnApagarPosicaoActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnApagarSecao">
<Properties>
<Property name="text" type="java.lang.String" value="Apagar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnApagarSecaoActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnAddDsiponibilidade">
<Properties>
<Property name="text" type="java.lang.String" value="Add"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddDsiponibilidadeActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="text" type="java.lang.String" value="Disponibilidade:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtDisponibilidade">
</Component>
<Component class="javax.swing.JComboBox" name="boxDisponibilidade">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="1">
<StringItem index="0" value="Quantos dias pode ser locado"/>
</StringArray>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxDisponibilidadeMouseClicked"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JButton" name="btnApagarDisponibilidade">
<Properties>
<Property name="text" type="java.lang.String" value="Apagar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnApagarDisponibilidadeActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel8">
<Properties>
<Property name="text" type="java.lang.String" value="Configura para qtos dias o livro pode ser locado ( Zero para Apenas Leitura Interna)"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel14">
<Properties>
<Property name="text" type="java.lang.String" value="Tipo de Usu&#xe1;rios:"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtTipos">
</Component>
<Component class="javax.swing.JButton" name="btnAddtipos">
<Properties>
<Property name="text" type="java.lang.String" value="Add"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddtiposActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JComboBox" name="boxTipos">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="1">
<StringItem index="0" value="&lt;Lista de Tipos de Usu&#xe1;rios&gt;"/>
</StringArray>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxTiposMouseClicked"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="boxTiposActionPerformed"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value=""/>
</AuxValues>
</Component>
<Component class="javax.swing.JButton" name="btnExcluirTipos">
<Properties>
<Property name="text" type="java.lang.String" value="Apagar"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnExcluirTiposActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel4">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Apar&#xea;ncia">
<Property name="tabTitle" type="java.lang.String" value="Apar&#xea;ncia"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="39" max="-2" attributes="0"/>
<Component id="jLabel17" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="cboxTema" min="-2" pref="280" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="279" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="38" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel17" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="cboxTema" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="324" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel17">
<Properties>
<Property name="text" type="java.lang.String" value="Tema Padr&#xe3;o:"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jButton1">
<Properties>
<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="jButton1ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JComboBox" name="cboxTema">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="2">
<StringItem index="0" value="Tema Claro"/>
<StringItem index="1" value="Tema Escuro"/>
</StringArray>
</Property>
<Property name="selectedIndex" type="int" value="-1"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Form>
File diff suppressed because it is too large Load Diff