Você está na página 1de 39

UNIVERSIDADE CASTELO BRANCO

ESCOLA SUPERIOR DE GESTO E TECNOLOGIA


CURSO DE SISTEMAS DE INFORMAO 6 Perodo
PROJETOS DE SOFTWARE

AVALIAO A1 - SPCI

Diogo Finizola
Felipe da Silva Gis
Rio de Janeiro, out. 2014

DIOGO FINIZOLA
FELIPE DA SILVA GIS
Alunos do Curso de Sistemas de Informao da UCB

AVALIAO A1 - SPCI

Trabalho apresentado como requisito parcial


para aprovao em A1 na disciplina de
Projetos de Software da UCB, sob a orientao
do Prof. Jos Caetano.

Rio de Janeiro, out. 2014

DIOGO FINIZOLA MATRCULA: 2012150077


FELIPE DA SILVA GIS MATRCULA: 2012160283

AVALIAO A1 - SPCI

O professor delibera o conceito:____________

____________________________________________
Jos Caetano

Universidade Castelo Branco

Rio de Janeiro, out. 2014

INTRODUO
A finalidade deste documento definir a todo o aprendizado obtido em sala de
aula. O documento contm uma viso geral dos requisitos mais importantes do projeto.
SCPI Sistema de cadastro de Produtos de informtica tem como objetivo cadastrar
Clientes e Produtos. Todo o sistema foi desenvolvido utilizando linguagem orientada a
objeto com padro de camadas.
DESENVOLVIMENTO
Arquitetura do projeto
O projeto est dividido em camadas como podemos ver na imagem abaixo temos
4 tipos de pacotes cada um com sua respectiva funo.
PCT Controles Neste pacote encontramos a classe com as validaes, as
classes controladoras .
PCT Entidades Neste pacote encontramos as classes com os gets e sets
necessrios para os formulrios
PCT Telas Neste pacote encontramos a classe com os formulrios
desenhados.
PCT IMG - Neste pacote encontramos as imagens utilizadas na aplicao.
PCT scpi Com a classe principal do projeto.

Aps arquitetarmos o projeto como foi descrito acima, comeamos a elaborar as telas
sempre seguindo a ideia de que a programao est dividida em camadas com o objetivo
principal de reusabilidade de cdigo e separao de conceitos.
Telas
Tela principal
Esta a primeira tela do nosso sistema, nela que encontramos o menu que d

acesso as demais telas. Aqui foram utilizados diversos conhecimentos tais como:
Exibir a janela centralizada na tela com o comando
(this.setLocationRelativeTo(null);)
Exibis mensagem de confirmao quando sairmos da aplicao com o
comando (JOptionPane.showMessageDialog(this."Obrigada por Utilizar
o SCPI!");
Sair da Aplicao com o comando (System.exit(0);)
Ao clicar no Menu, exibir o formulrio respectivo com o comando (new
CadastroCliente(this).setVisible(true);
e
newCadastrodeProdutos(this).setVisible(true);) e no deixar ao abri esses
formulrios desabilitar para click (edio) a tela Principal com o
comando (this.setEnabled(false);)
Com o objetivo de melhorar o design da aplicao realizamos pesquisas em diversos
fruns (vide bibliografia) para realizarmos a troca do LookAndFeel, ou seja , a troca de
aparncia da aplicao tais pesquisas nos levaram as seguintes modificaes no cdigo:
Criamos uma funo chamada lookandfeel(), nela definimos o padro de
design e aplicamos .
Desenho da tela

Mensagem exibida na tela

Tela de clientes
Tela de cadastro de clientes, nesta tela temos os campos necessrios para
efetuarmos o cadastro de clientes. Os conhecimentos que utilizamos para fazer esta tela
foram :
Validao de todos os campos do formulrio, onde os mesmo no podem
estar vazios. Esta validao est inserida no evento ActionPerformed do
boto Salvar.
Limpar todo o formulrio. Esta funcionalidade est inserida no evento
ActionPerformed do boto Limpar
Cancelar a ao . Esta funcionalidade est inserida no ActionPerformed
do boto Cancelar.
Observe que ao carregar o formulrio no h item selecionado na
combobox tipo de pessoa. O comando utilizado para isto
jComboBox1.setSelectedIndex(-1);

Desenho da tela

Mensagens da Tela

Tela produtos
Tela de cadastro de produtos, nesta tela temos os campos necessrios para
efetuarmos o cadastro de produtos. Os conhecimentos que utilizamos para fazer esta tela
foram :
Validao de todos os campos do formulrio, onde os mesmo no podem
estar vazios. Esta validao est inserida no evento ActionPerformed do
boto Salvar.
Limpar todo o formulrio. Esta funcionalidade est inserida no evento
ActionPerformed do boto Limpar
Cancelar a ao . Esta funcionalidade est inserida no ActionPerformed
do boto Cancelar.
Validao para que o valor unitrio nunca seja maior que o valor do lote
da mercadoria
Como j foi dito todas as validaes encontram-se no pacote controle na classe
controlador cadastro.
Desenho da tela :

Mensagem da tela

Concluso
Conclumos que a elaborao deste trabalho nos possibilitou aumentar os
conhecimentos em java com swing no netbeans , fixar todo o contedo aprendido em
sala de aula com programao em camadas e aprender novos contedos como a troca de
design da aplicao. O intuito do sistema realizar cadastro de clientes e produtos de
uma stand de informtica, o objetivo principal ter controle sobre os produtos que
existem no stand, ter dados sobre o clientes a fim de realizar entregas, enviar promoes
e descontos por email .

ANEXO

Cdigos do sistema
Pacote Controle
Classe ControladorCadastro
package controles;
import entidades.Cliente;
import entidades.Produto;
public class ControladorCadastro {
public boolean cadastrarCliente(Cliente c) {
boolean resultado = false;
if (c != null
&& c.getNome().length() > 0
&& c.getEmail().length() > 0
&& c.getIdade().length() > 0
&& c.getTelefone().length() > 0 ) {
resultado = true;
}
return resultado;
}
public boolean cadastrarProduto(Produto p) {
boolean resultado = false;
if (p != null
&& p.getNome().length() > 0 // campo nome nao pode ser vazio
&& p.getDescricao().length() > 0 // campo descrio nao pode ser vazio
&& p.getQtd().length()>0
&& Float.parseFloat(p.valorLote())>Float.parseFloat(p.valorUnitrio())) { //
converte de string para float para fazer a comparao
resultado = true;
}
return resultado;
}
}

Pacote entidade
Classe cliente
package entidades;
public class Cliente {
//atributos do cliente
private String nome;
private String telefone;
private String idade;
private String endereco;
private String email;
private String interesses;
private boolean tipo;

public Cliente(String nome, String telefone, String idade, String endereco, String
email, String interesses, boolean tipo) {
this.nome = nome;
this.email=email;
this.telefone=telefone;
this.idade=idade;
this.endereco=endereco;
this.interesses=interesses;
this.tipo=tipo;
}
/**
* @return the nome
*/
public String getNome() {
return nome;
}
/**
* @param nome the nome to set
*/
public void setNome(String nome) {
this.nome = nome;
}
/**
* @return the telefone
*/

public String getTelefone() {


return telefone;
}
/**
* @param telefone the telefone to set
*/
public void setTelefone(String telefone) {
this.telefone = telefone;
}
/**
* @return the idade
*/
public String getIdade() {
return idade;
}
/**
* @param idade the idade to set
*/
public void setIdade(String idade) {
this.idade = idade;
}
/**
* @return the endereco
*/
public String getEndereco() {
return endereco;
}
/**
* @param endereco the endereco to set
*/
public void setEndereco(String endereco) {
this.endereco = endereco;
}
/**
* @return the email
*/
public String getEmail() {
return email;
}
/**
* @param email the email to set
*/
public void setEmail(String email) {

this.email = email;
}
/**
* @return the tipo
*/
public boolean isTipo() {
return tipo;
}
/**
* @param tipo the tipo to set
*/
public void setTipo(boolean tipo) {
this.tipo = tipo;
}
}

Pacote Entidade
Classe Produto
package entidades;
public class Produto {
//atributos do produto
private String nome;
private String descricao;
private String valorUnitrio;
private String valorLote;
private String qtd;

public Produto(String nome, String descricao, String valorUnitrio, String valorLote,


String qtd) {
this.nome = nome;
this.descricao = descricao;
this.valorUnitrio = valorUnitrio;
this.valorLote = valorLote;
this.qtd= qtd;
}
public String getNome() {
return nome;
}

public void setNome(String nome) {


this.nome = nome;
}
public String getDescricao() {
return descricao;
}
public void setDescricao(String atributos) {
this.descricao = descricao;
}
public String valorUnitrio() {
return valorUnitrio;
}
public void valorUnitrio(String valorUnitrio) {
this.valorUnitrio = valorUnitrio;
}
public String valorLote() {
return valorLote;
}
public void valorLote(String valorLote) {
this.valorLote = valorLote;
}
/**
* @return the qtd
*/
public String getQtd() {
return qtd;
}
/**
* @param qtd the qtd to set
*/
public void setQtd(String qtd) {
this.qtd = qtd;
}
}

Pacote SCPI
Classe SCPI

package scpi;
import telas.TelaPrincipal;
public class SCPI {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
System.out.println("Teste de sada do Sistema!");
new TelaPrincipal().setVisible(true);
}
}

Pacote Telas
Tela de Clientes
package telas;
import controles.ControladorCadastro;
import entidades.Cliente;
import javax.swing.JOptionPane;
public class CadastroCliente extends javax.swing.JFrame {
private TelaPrincipal telaAnterior;
/**
* Creates new form TelaCadastro
*/
private CadastroCliente() {
initComponents();
this.setLocationRelativeTo(null); // Centralizar Janela
}
public CadastroCliente(TelaPrincipal telaAnterior){
this();
this.telaAnterior = telaAnterior;
}
/**
* 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">
private void initComponents() {
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jPanel1 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jComboBox1 = new javax.swing.JComboBox();
jLabel4 = new javax.swing.JLabel();
jTextField3 = new javax.swing.JTextField();
jTextField4 = new javax.swing.JTextField();
jLabel7 = new javax.swing.JLabel();
jTextField5 = new javax.swing.JTextField();
jLabel6 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jButton3 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Tela de Cadastro");
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosed(java.awt.event.WindowEvent evt) {
formWindowClosed(evt);
}
});
jButton1.setText("Salvar");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton2.setText("Cancelar");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Cadastro
de Cliente", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,

javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("sansserif",


1, 12), new java.awt.Color(153, 204, 255))); // NOI18N
jLabel2.setText("Nome:");
jTextField1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField1ActionPerformed(evt);
}
});
jLabel3.setText("Telefone:");
jTextField2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField2ActionPerformed(evt);
}
});
jLabel5.setText("Tipo:");
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
"Fsica", "Jurdica" }));
jComboBox1.setSelectedIndex(-1);
jComboBox1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBox1ActionPerformed(evt);
}
});
jLabel4.setText("Endereo:");
jTextField3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField3ActionPerformed(evt);
}
});
jLabel7.setText("Idade:");
jTextField5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField5ActionPerformed(evt);
}
});
jLabel6.setText("Email:");
jLabel1.setText("Interesses:");

jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jScrollPane1.setViewportView(jTextArea1);
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()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addComponent(jLabel1)
.addComponent(jLabel6)
.addComponent(jLabel4)
.addComponent(jLabel3)
.addComponent(jLabel2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jTextField1,
javax.swing.GroupLayout.PREFERRED_SIZE, 291,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jTextField2,
javax.swing.GroupLayout.PREFERRED_SIZE, 116,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jComboBox1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jTextField4,
javax.swing.GroupLayout.PREFERRED_SIZE, 181,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField5,
javax.swing.GroupLayout.PREFERRED_SIZE, 63,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TR
AILING, false)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 290, Short.MAX_VALUE)
.addComponent(jTextField3,
javax.swing.GroupLayout.Alignment.LEADING)))
.addContainerGap(20, Short.MAX_VALUE))))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BA
SELINE)
.addComponent(jLabel2)
.addComponent(jTextField1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BA
SELINE)
.addComponent(jTextField2,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3)
.addComponent(jLabel5)
.addComponent(jComboBox1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BA
SELINE)
.addComponent(jLabel4)

.addComponent(jTextField3,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(25, 25, 25)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BA
SELINE)
.addComponent(jLabel6)
.addComponent(jTextField4,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel7)
.addComponent(jTextField5,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addComponent(jLabel1)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
jButton3.setText("Limpar ");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new
javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 8, Short.MAX_VALUE))

.addGroup(layout.createSequentialGroup()
.addComponent(jButton1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton3)
.addGap(91, 91, 91)
.addComponent(jButton2))))
);
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)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE
)
.addComponent(jButton1)
.addComponent(jButton2)
.addComponent(jButton3))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
pack();
}// </editor-fold>
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
this.setVisible(false); // fecha a janela de cliente
telaAnterior.setVisible(true);// vizualiza a janela de cadastro
telaAnterior.setEnabled(true);// habilita a navegao na tela de cadastro
// TODO add your handling code here:
}
private void formWindowClosed(java.awt.event.WindowEvent evt) {
// TODO add your handling code here:
System.out.println("Tela de cadastro de clientes fechada");
this.setVisible(false);// fecha a janela de clientes
telaAnterior.setVisible(true);// vizualiza a janela de cadastro
telaAnterior.setEnabled(true);// habilita a navegao na tela de cadastro
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// tratamento do boto salvar
String nome = jTextField1.getText();
String telefone = jTextField2.getText ();

String endereco = jTextField3.getText ();


String email = jTextField4.getText ();
String idade=jTextField5.getText();
String interesses = jTextArea1.getText();
int itemSelecionado = jComboBox1.getSelectedIndex();//se for 0 pessoa fsica se
for 1 pessoa juridica

//Criar um objeto cliente


Cliente f = new
Cliente(nome,telefone,endereco,email,idade,interesses,itemSelecionado ==0?false:true);
//criar controlador
ControladorCadastro controlador = new ControladorCadastro();
if(controlador.cadastrarCliente (f)){
JOptionPane.showMessageDialog(this, "Cliente Cadastrado com Sucesso");
this.dispose();
telaAnterior.setEnabled(true);}
else {JOptionPane.showMessageDialog(this, "Existem Campos que devem ser
Preenchidos");}
}

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


// TODO add your handling code here:
jTextField1.setText("");
jTextField2.setText("");
jTextField3.setText("");
jTextField4.setText("");
jTextField5.setText("");
jTextArea1.setText("");
jComboBox1.setSelectedIndex(-1);
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look
and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/

try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Windows".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(CadastroCliente.class.getName()).log(java.util.loggi
ng.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(CadastroCliente.class.getName()).log(java.util.loggi
ng.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(CadastroCliente.class.getName()).log(java.util.loggi
ng.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(CadastroCliente.class.getName()).log(java.util.loggi
ng.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new CadastroCliente().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JComboBox jComboBox1;
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.JScrollPane jScrollPane1;
private javax.swing.JTextArea jTextArea1;

private javax.swing.JTextField jTextField1;


private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField4;
private javax.swing.JTextField jTextField5;
// End of variables declaration
}
Pacote telas
Classe Cadastro de produto
package telas;
//import controles.ControladorCadastro;
import controles.ControladorCadastro;
import entidades.Cliente;
import entidades.Produto;
import javax.swing.JOptionPane;
public class CadastrodeProdutos extends javax.swing.JFrame {
private TelaPrincipal telaAnterior;
/**
* Creates new form TelaCadastro
*/
private CadastrodeProdutos() {
initComponents();
this.setLocationRelativeTo(null); // Centralizar Janela
}
public CadastrodeProdutos(TelaPrincipal telaAnterior){
this();
this.telaAnterior = telaAnterior;
}
/**
* 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">
private void initComponents() {
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jPanel1 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();

jTextField1 = new javax.swing.JTextField();


jLabel4 = new javax.swing.JLabel();
jTextField3 = new javax.swing.JTextField();
jTextField4 = new javax.swing.JTextField();
jLabel6 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jLabel3 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField();
jButton3 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Tela de Cadastro");
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosed(java.awt.event.WindowEvent evt) {
formWindowClosed(evt);
}
});
jButton1.setText("Salvar");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton2.setText("Cancelar");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Cadastro
de Produtos", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("sansserif",
1, 12), new java.awt.Color(153, 204, 255))); // NOI18N
jLabel2.setText("Nome:");
jTextField1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField1ActionPerformed(evt);
}
});
jLabel4.setText("Valor unitrio");
jTextField3.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {


jTextField3ActionPerformed(evt);
}
});
jLabel6.setText("Valor do Lote");
jLabel1.setText("Descrio");
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jScrollPane1.setViewportView(jTextArea1);
jLabel3.setText("Qtd");
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()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addComponent(jScrollPane1))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(41, 41, 41)
.addComponent(jTextField1))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField3,
javax.swing.GroupLayout.PREFERRED_SIZE, 69,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jTextField2,
javax.swing.GroupLayout.PREFERRED_SIZE, 89,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel6)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField4,
javax.swing.GroupLayout.PREFERRED_SIZE, 49,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(0, 26, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BA
SELINE)
.addComponent(jLabel2)
.addComponent(jTextField1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BA
SELINE)
.addComponent(jLabel4)
.addComponent(jTextField3,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6)
.addComponent(jTextField4,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3)
.addComponent(jTextField2,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
19, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addComponent(jLabel1)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE, 141,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);

jButton3.setText("Limpar ");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new
javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addComponent(jButton1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton3)
.addGap(131, 131, 131)
.addComponent(jButton2))))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE
)
.addComponent(jButton1)
.addComponent(jButton2)
.addComponent(jButton3))
.addContainerGap())
);
pack();
}// </editor-fold>
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
this.setVisible(false);// fecha janela de produto

telaAnterior.setVisible(true);// vizualiza a janela de cadastro


telaAnterior.setEnabled(true);// habilita a navegao na tela de cadastro
// TODO add your handling code here:
}
private void formWindowClosed(java.awt.event.WindowEvent evt) {
// TODO add your handling code here:
System.out.println("Tela de cadastro de Produto fechada");
this.setVisible(false);// fecha a janela de produtos
telaAnterior.setVisible(true);// vizualiza a janela de cadastro
telaAnterior.setEnabled(true);// habilita a navegao na tela de cadastro
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// tratamento do boto salvar
String nome = jTextField1.getText();
String valorUnitrio = jTextField3.getText ();
String valorLote = jTextField4.getText ();
String descricao = jTextArea1.getText();
String qtd = jTextField2.getText();
//Criar um objeto produto
Produto p = new Produto(nome,descricao,valorUnitrio,valorLote, qtd);
//criar controlador
ControladorCadastro controlador = new ControladorCadastro();
if (controlador.cadastrarProduto(p)) {
JOptionPane.showMessageDialog(this, "Cadastrado de Produtos efetuado");
this.dispose();
telaAnterior.setEnabled(true);
} else {
JOptionPane.showMessageDialog(this, "Existem campos que devem ser
preenchidos corretamente");
}
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
jTextField1.setText("");
jTextField2.setText("");
jTextField3.setText("");
jTextField4.setText("");
jTextArea1.setText("");
}
/**
* @param args the command line arguments

*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look
and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Windows".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(CadastrodeProdutos.class.getName()).log(java.util.l
ogging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(CadastrodeProdutos.class.getName()).log(java.util.l
ogging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(CadastrodeProdutos.class.getName()).log(java.util.l
ogging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(CadastrodeProdutos.class.getName()).log(java.util.l
ogging.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 CadastrodeProdutos().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;

private javax.swing.JButton jButton3;


private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel6;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField4;
// End of variables declaration
}

Pacote telas
Classe TelaPrincipal
package telas;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
public class TelaPrincipal extends javax.swing.JFrame {
/**
* Creates new form TelaPrincipal
*/
public TelaPrincipal() {
initComponents();
lookandfeel();// mtodo para implementar esse tema
this.setLocationRelativeTo(null); // Centralizar Janela
}
/**
* 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">
private void initComponents() {

jPanel1 = new javax.swing.JPanel();


jButton2 = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Sistema de Cadastro de Funcionarios");
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Cadastro",
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma",
1, 12), new java.awt.Color(102, 204, 255))); // NOI18N
jButton2.setText("Cadastro de Produtos");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jButton1.setText("Cadastro de Clientes");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton3.setText("Sair");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jLabel1.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/img/logo.jpg"))); // NOI18N
jPanel2.setBackground(new java.awt.Color(153, 204, 255));
jLabel2.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
jLabel2.setText("Bem vindo ao SCPI");
javax.swing.GroupLayout jPanel2Layout = new
javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(

jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel2Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 239,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(63, 63, 63))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel2)
.addContainerGap(20, 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(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TR
AILING)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jButton3))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jButton1,
javax.swing.GroupLayout.PREFERRED_SIZE, 153,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton2)))
.addContainerGap())
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 383,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(

jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BA
SELINE)
.addComponent(jButton1)
.addComponent(jButton2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 211,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton3))
);
javax.swing.GroupLayout layout = new
javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
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)
.addContainerGap(19, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
JOptionPane.showMessageDialog(this, "Obrigada por Utilizar o SCPI!");

System.exit(0);
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
this.setEnabled(false);
new CadastroCliente(this).setVisible(true);
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
this.setEnabled(false);
new CadastrodeProdutos(this).setVisible(true);
}
/**
* @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 {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsClassicLookA
ndFeel");
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Windows".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(TelaPrincipal.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(TelaPrincipal.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(TelaPrincipal.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(TelaPrincipal.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 TelaPrincipal().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
// End of variables declaration
public void lookandfeel() {
String Seta_Look = "javax.swing.plaf.nimbus.NimbusLookAndFeel"; // Defino um
tema para a aplicao - nosso caso foi o tema windows
try {
UIManager.setLookAndFeel(Seta_Look);// aplicando o tema windows
SwingUtilities.updateComponentTreeUI(this);
} catch (Exception erro) {
JOptionPane.showMessageDialog(null, "Erro ao alterar tema =" + erro); // caso
ele enao consiga aplicar o tema ele exibe um erro
}
}
}

RASCUNHO DAS TELAS

Tela Principal:

Tela Cadastro de Clientes:

Tela Produtos:

Você também pode gostar