Estou criando um Sistema de Vendas no NetBeans 5.5.1 ,porém o programa tem alguns erros,e não pode ser compilado e executado,ficarei grato se alguém puder me ajudar,será de grande ajuda se existir alguém que já está acostumado a trabalhar no Netbeans
Esse programa está dentro de um Projeto chamado Vendas dividido em 6 arquivos.
Main.java
//devemos definir aqui o nome do pacote
package devlog;
//importamos,em seguida,todos os pacotes Java,responsáveis por eventos e objetos
import javax.swing.*;
import java.awt.*;
import java.awt.Event.*;
//agora definimos informações relacionadas à identidade do programa,como nome do autor,por exemplo
/**
*<p>Título:Sistema de Vendas</p>
*<p>Descrição:Programa ideal para as empresas</p>
*<p>Copyright:Copyright (c)2007 </p>
*<p>Grupo:Java
*/
//a partir daqui,começamos a construir a base gráfica do programa,utilizando as ferramentas de desenho de objetos do Java
public class Accueil extends JFrame {
JPanel JPanel1=new JPanel();
JPanel Main=new JPanel();
JPanel JPanel3=new JPanel();
GridLayout GridLayout1=new GridLayout(2,2);
JButton Client=new JButton ();
JButton Produit=new JButton();
JButton itineraire=new JButton();
JButton Commande=new JButton();
JButton Sair=new JButton();
BorderLayout BorderLayout1=new BorderLayout();
JButton Admin=new JButton();
BorderLayout borderLayout2=new BorderLayout();
//a partir daqui devemos definir uma classe pública para o programa.As classes públicas são assim chamadas porque pode ser acessadas por todos os programas Java presentes no sistema
public Accueil(){
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[]args){
Accueil accueil=new Accueil();
accueil.setVisible(true);
}
private void jbInit() throws Exception {
Main.setLayout(gridLayout1);
Client.setFont(new java.awt.Font("Dialog",1,14));
Client.setText("CLIENTE");
Cliente.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
Client_actionPerformed(e);
}
});
Produit.setFont(new java.awt.Font("Dialogo",1,14));
Produit.setText("PRODUTO");
Produit.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
Produit_actionPerformed(e);
}
});
Itineraire.setFont(new java.awt.Font("Dialog",1,14));
Itineraire.setText("ITINERARIO");
Itineraire.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Itin_actionPerformed(e);
}
});
Commande.setFont(new javaawt.Font("DIALOG",1,14));
Commande.setText("COMANDO");
Commande.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
Commande_actionPerformed(e);
}
});
Sair.setFont(new java.awt.Font("Dialog",1,15));
Sair.setForeground(Color.red);
Sair.setToolTipText("");
Sair.setVerifyInputWhenFocusTarget(true);
Sair.setText("SAIR");
Sair.addActionListener(new ActionLIstener()
{
public void actionPerformed(ActionEvent e){
System.exit(0);
}
});
JPanel1.setLayout(borderLayout1);
Admin.setText("ADMINISTRACAO");
Admin.addActionListener(new ActionLIstener(){
public void actionPerformed(ActionEvent e){
Admin_actionPerformed(e);
}
});
JPanel3.setLayout(borderLayout2);
this.getContentPane().add(JPanel1,borderLayout.SOUTH);
JPanel1.add(Sair,borderLayout.CENTER);
this.getContentPane().add(Main,borderLayout.CENTER);
Main.add(Client,null);
Main.add(commande,null);
Main.add(Produit,null);
this.getContentPane().add(JPanel3,borderLayout.NORTH);
JPanel3.add(Admin,borderLayout.CENTER);
this.setSize(600.200);
}
//Client
public void Client_actionPerformed(ActionEvent e){
this.dispose();
AfficheClient cadre=new AfficheClient();
cadre.show();
}
//Login
public void Admin_actionPerformed(ActionEvent e) {
this.dispose();
log cadre=new Log();
cadre.show();
}
//Client
public void Comando_actionPerformed(ActionEvent e){
this.dispose();
Commande cadre=new Commando();
cadre.show();
}
//Client
public void Produto_actionPerformed(ActionEvent e){
this.dispose();
IncluirProduto cadre=new InserirProduto();
cadre.show();
}
//Client
public void Itin_actionPerformed(ActionEvent e){
Parcours p=new Percurso();
}
//definimos aqui que a janela deve ser fechada assim que todos os dados forem preenchidos {
super.processWindowEvent(e);
if (e.get() == WindowEvent.WINDOW_CLOSING){
System.exit(0);
}
}
Admin.java
package devlog;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
//criamos a classe pública admin e seus respectivos objetos
public class Admin extends JFrame {
JPanel JPanel1=new JPanel();
JPanel JPanel2=new JPanel();
JPanel JPanel3=new JPanel();
Jbutton EsteProduto=new JButton();
JButton EsteCliente=new JButton();
JButton EsteCatalogo=new JButton();
GridLayout gridlayout1=new GridLayout(10,1);
JButton EsteAdmin=new JButton();
JButton Sair=new JButton();
JButton Fechar=new JBUtton();
GridLayout gridLayout2=new GridLayout();
public Admin() {
try {
jbInit();
}
catch(Exception e) {
eprintStackTrace();
}
}
private void jbInit() throws Exception {
this.setResizable(false);
this.setSize(new Dimension(600,373));
this.setTitle("ADMINISTRAÇÃO");
EsteProdutosetText("ESCOLHA DE PRODUTO");
EsteProduto.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
EsteProduto(e);
}
});
EsteCatalogo.setText("ESCOLHA DE CATALOGO");
EsteCatalogo.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
EsteAdministrador(e);
}
});
Sair.setText("SAIR");
Sair.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
Fechar.setText("FECHAR");
Fechar.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Fechar_actionPerformed(e);
}
});
JPanel1.setLayout(gridLayout2);
this.getContentPane().add(JPanel1,BorderLayout.SOUTH);
JPanel1.add(Fechar,null);
JPanel1.add(Sair,null);
this.getContentPane().add(JPanel2,BorderLayout.CENTER);
JPanel2.add(EsteProduto,null);
JPanel2.add(EsteCliente,null);
JPanel2.add(EsteCatalogo,null);
this.getContentPane().add(JPanel3,BorderLayout.NORTH);
JPanel2.add(EsteAdministrador,null);
}
public Font getFont() {
}
//Fechar
public void Fechar_actionPerformed(ActionEvent e) {
this.dispose();
}
//Este Produto
public void EsteProduto(ActionEvent e){
EsteProduto sprod=new EsteProduto();
sprod.show();
}
//Este Catalogo
public void EsteCatalogo(ActionEvent e){
Catalogue cata=new Catalogue();
cata.show;
}
//Este CLiente
public void EsteClient(ActionEvent e){
client c=new Client();
c.show();
}
//Estre Admin
public void EsteAdministrador(ActionEveent e){
}
}
InserirCliente.java
package devlog;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class InserirCliente extends JFrame {
JPanel jPanel1=new JPanel();
JPanel jPanel2=new JPanel();
JScrollPane aff=new JScrollPane();
GridLayout gridLayout1=new GridLayout();
JButton NovoCliente=new JButton();
JButton Fechar=new JButton();
JButton Sair=new JButton();
GridLayout gridLayout2=new GridLayout();
public InserirCliente() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
affi();
aff.setDebugGraphicOption(0);
jPanel1.setLayout(gridLayout1);
NovoCliente.setText("NOVO CLIENTE");
NovoCliente.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
NovoCliente(e);
}
});
Fechar.setText("FECHAR");
Fechar.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Fechar(e);
}
});
Sair.setToolTipText("");
Sair.setText("SAIR");
Sair.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
JPanel2.setLayout(gridLayout2);
this.setSize(new Dimension(841,462));
this.setResizable(false);
this.setTitle("LISTA DE CLIENTES");
this.getContentPane().add(jPanel1,BorderLayout.CENTER);
jPanel1.add(aff,null);
this.getContentPane().add(jPanel2,BorderLayout.SOUTH);
jPanel2.add(Fechar,null);
jPanel2.add(NovoCliente,null);
jPanel2.add(SAIR,null);
}
public void Fechar(ActionEvent e) {
this.dispose();
}
//Novo Cliente
public void NovoCliente(ActionEvent e) {
this.dispose();
Client cl=new Client();
cl.show();
}
private void affi(){
String nom="";
Vector v1=new Vector();
v1.addElement("Referencia do Cliente");
v1.addElement("Nome do Cliente");
v1.addElement("Sobrenome do Cliente");
v1.addElement("Endereço do Cliente");
v1.addElement("Estado Civil");
v1.addElement("Tipo de Cliente");
v1.addElement("Numero de telefone do Cliente");
v1.addElement("numero de fax do Cliente");
v1.addElement("E-mail do Cliente");
v1.addElement("data");
v1.addElement("hora");
LerEescrever li=new LerEescrever();
//vector v=li.ListeLecture("Produto.xls");
//System.out.println(texto +"Conteúdo"+"hora" +"minuto" +"segundo");
//JTable Table=new JTable(v.v1);
aff=new JScrollPane(li.tableLecture("Client.xls",v1));
}
}
CadastroProdutos.java
package devlog;
import javax.swing.*;
import java.awt.*;
import java.awt.Event.*;
//import com.borland.jbcl.layout.*;
import java.applet.*;
import java.util.*;
public class IncluirProduto extends JFrame {
JPanel jPanel1=new JPanel();
JPanel jPanel2=new JPanel();
JPanel jPanel3=new JPanel();
JPanel jPanel4=new JPanel();
BorderLayout borderLayout1=new BorderLayout();
JLabel jLabel1=new JLabel();
JComboBox NomProduit=new JComboBox();
JButton Affiche=new JButton();
BorderLayout borderLayout2=new BorderLayout();
JScrollPane aff;
GridLayout gridLayout1=new GridLayout();
public IncluirProduto() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
jPanel2.setLayout(borderLayout1);
jLabel1.setText("NOME DO PRODUTO");
jPanel4.setLayout(gridLayout1);
Affiche.setText("DEMONSTRACAO");
Affiche.addActionListener(new ActionListener() {
public void actionPerforme(ActionEvent e) {
Affiche_actionPerformed(e);
}
});
this.setSize(new Dimension(770,376));
this.setResizable(false);
this.setTitle("LISTA DOS PRODUTOS");
lecombo();
jPanel1.setLayout(borderLayout2);
this.getContentPane().add(jPanel1,BorderLayout.CENTER);
aff();
jPanel1.add(aff,BorderLayout.CENTER);
this.getContentPane().add(jPanel2,BorderLayout.SOUTH);
jPanel2.add(jPanel4.BorderLayout.CENTER);
jPanel4.add(jLabel1,null);
jPanel4.add(NomeProduto,null);
jPanel4.add(Incluir,null);
this.getContentPane().add(jPanel3,BorderLayout.NORTH);
}
//String de Inclusão
public String lacle(){
String lcl;
lcl=(String)NomeProduto.getSelectedItem();
return lcl;
}
public void Incluir_actionPerformed(ActionEvent e) {
this.dispose();
Produto prod=new Produto();
prod.show();
}
private void aff(){
String nom="";
Vector v1=new Vector();
v1.addElement("Referencia do Produto");
v1.addElement("Nome do Produto");
v1.addElement("Quantidade do Produto");
v1.addElement("Referencia do Catalogo");
v1.addElement("Imagem do Produto");
v1.addElement("Apresentação do Produto");
v1.addElement("Tipo do Produto");
v1.addElement("Descrição");
v1.addElement("Data");
v1.addElement("Hora");
LerEescrever li=new LerEescrever();
//vector v=li.ListeLeitura("Produto.xls");
//System.out.println(texto+"conteudo"+hora+minuto+segundo);
//JTable Table=new JTable(v,v1));
aff=new JScrollPane(li.tableLeitura("Produto.xls",v1));
}
//Estabelecendo Lecombo
public void lecombo(){
LerEescrever le= new LerEescrever();
int a=0;
int i=0;
String mot="";
while(a<le.ListeLeitura("Produto.xls").size()){
NomeProduto.addItem(le.ListeLeitura("Produto.xls").elementAt(i));
a++;
i++;
}
NomeProduto.revalidate();
}
}
}
Pergunta
sl@ckw@re
Estou criando um Sistema de Vendas no NetBeans 5.5.1 ,porém o programa tem alguns erros,e não pode ser compilado e executado,ficarei grato se alguém puder me ajudar,será de grande ajuda se existir alguém que já está acostumado a trabalhar no Netbeans
Esse programa está dentro de um Projeto chamado Vendas dividido em 6 arquivos.
Main.java
//devemos definir aqui o nome do pacote package devlog; //importamos,em seguida,todos os pacotes Java,responsáveis por eventos e objetos import javax.swing.*; import java.awt.*; import java.awt.Event.*; //agora definimos informações relacionadas à identidade do programa,como nome do autor,por exemplo /** *<p>Título:Sistema de Vendas</p> *<p>Descrição:Programa ideal para as empresas</p> *<p>Copyright:Copyright (c)2007 </p> *<p>Grupo:Java */ //a partir daqui,começamos a construir a base gráfica do programa,utilizando as ferramentas de desenho de objetos do Java public class Accueil extends JFrame { JPanel JPanel1=new JPanel(); JPanel Main=new JPanel(); JPanel JPanel3=new JPanel(); GridLayout GridLayout1=new GridLayout(2,2); JButton Client=new JButton (); JButton Produit=new JButton(); JButton itineraire=new JButton(); JButton Commande=new JButton(); JButton Sair=new JButton(); BorderLayout BorderLayout1=new BorderLayout(); JButton Admin=new JButton(); BorderLayout borderLayout2=new BorderLayout(); //a partir daqui devemos definir uma classe pública para o programa.As classes públicas são assim chamadas porque pode ser acessadas por todos os programas Java presentes no sistema public Accueil(){ try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } public static void main(String[]args){ Accueil accueil=new Accueil(); accueil.setVisible(true); } private void jbInit() throws Exception { Main.setLayout(gridLayout1); Client.setFont(new java.awt.Font("Dialog",1,14)); Client.setText("CLIENTE"); Cliente.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e){ Client_actionPerformed(e); } }); Produit.setFont(new java.awt.Font("Dialogo",1,14)); Produit.setText("PRODUTO"); Produit.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { Produit_actionPerformed(e); } }); Itineraire.setFont(new java.awt.Font("Dialog",1,14)); Itineraire.setText("ITINERARIO"); Itineraire.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Itin_actionPerformed(e); } }); Commande.setFont(new javaawt.Font("DIALOG",1,14)); Commande.setText("COMANDO"); Commande.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e){ Commande_actionPerformed(e); } }); Sair.setFont(new java.awt.Font("Dialog",1,15)); Sair.setForeground(Color.red); Sair.setToolTipText(""); Sair.setVerifyInputWhenFocusTarget(true); Sair.setText("SAIR"); Sair.addActionListener(new ActionLIstener() { public void actionPerformed(ActionEvent e){ System.exit(0); } }); JPanel1.setLayout(borderLayout1); Admin.setText("ADMINISTRACAO"); Admin.addActionListener(new ActionLIstener(){ public void actionPerformed(ActionEvent e){ Admin_actionPerformed(e); } }); JPanel3.setLayout(borderLayout2); this.getContentPane().add(JPanel1,borderLayout.SOUTH); JPanel1.add(Sair,borderLayout.CENTER); this.getContentPane().add(Main,borderLayout.CENTER); Main.add(Client,null); Main.add(commande,null); Main.add(Produit,null); this.getContentPane().add(JPanel3,borderLayout.NORTH); JPanel3.add(Admin,borderLayout.CENTER); this.setSize(600.200); } //Client public void Client_actionPerformed(ActionEvent e){ this.dispose(); AfficheClient cadre=new AfficheClient(); cadre.show(); } //Login public void Admin_actionPerformed(ActionEvent e) { this.dispose(); log cadre=new Log(); cadre.show(); } //Client public void Comando_actionPerformed(ActionEvent e){ this.dispose(); Commande cadre=new Commando(); cadre.show(); } //Client public void Produto_actionPerformed(ActionEvent e){ this.dispose(); IncluirProduto cadre=new InserirProduto(); cadre.show(); } //Client public void Itin_actionPerformed(ActionEvent e){ Parcours p=new Percurso(); } //definimos aqui que a janela deve ser fechada assim que todos os dados forem preenchidos { super.processWindowEvent(e); if (e.get() == WindowEvent.WINDOW_CLOSING){ System.exit(0); } }Admin.javapackage devlog; import javax.swing.*; import java.awt.*; import java.awt.event.*; //criamos a classe pública admin e seus respectivos objetos public class Admin extends JFrame { JPanel JPanel1=new JPanel(); JPanel JPanel2=new JPanel(); JPanel JPanel3=new JPanel(); Jbutton EsteProduto=new JButton(); JButton EsteCliente=new JButton(); JButton EsteCatalogo=new JButton(); GridLayout gridlayout1=new GridLayout(10,1); JButton EsteAdmin=new JButton(); JButton Sair=new JButton(); JButton Fechar=new JBUtton(); GridLayout gridLayout2=new GridLayout(); public Admin() { try { jbInit(); } catch(Exception e) { eprintStackTrace(); } } private void jbInit() throws Exception { this.setResizable(false); this.setSize(new Dimension(600,373)); this.setTitle("ADMINISTRAÇÃO"); EsteProdutosetText("ESCOLHA DE PRODUTO"); EsteProduto.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { EsteProduto(e); } }); EsteCatalogo.setText("ESCOLHA DE CATALOGO"); EsteCatalogo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { EsteAdministrador(e); } }); Sair.setText("SAIR"); Sair.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.exit(0); } }); Fechar.setText("FECHAR"); Fechar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Fechar_actionPerformed(e); } }); JPanel1.setLayout(gridLayout2); this.getContentPane().add(JPanel1,BorderLayout.SOUTH); JPanel1.add(Fechar,null); JPanel1.add(Sair,null); this.getContentPane().add(JPanel2,BorderLayout.CENTER); JPanel2.add(EsteProduto,null); JPanel2.add(EsteCliente,null); JPanel2.add(EsteCatalogo,null); this.getContentPane().add(JPanel3,BorderLayout.NORTH); JPanel2.add(EsteAdministrador,null); } public Font getFont() { } //Fechar public void Fechar_actionPerformed(ActionEvent e) { this.dispose(); } //Este Produto public void EsteProduto(ActionEvent e){ EsteProduto sprod=new EsteProduto(); sprod.show(); } //Este Catalogo public void EsteCatalogo(ActionEvent e){ Catalogue cata=new Catalogue(); cata.show; } //Este CLiente public void EsteClient(ActionEvent e){ client c=new Client(); c.show(); } //Estre Admin public void EsteAdministrador(ActionEveent e){ } }InserirCliente.javapackage devlog; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class InserirCliente extends JFrame { JPanel jPanel1=new JPanel(); JPanel jPanel2=new JPanel(); JScrollPane aff=new JScrollPane(); GridLayout gridLayout1=new GridLayout(); JButton NovoCliente=new JButton(); JButton Fechar=new JButton(); JButton Sair=new JButton(); GridLayout gridLayout2=new GridLayout(); public InserirCliente() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { affi(); aff.setDebugGraphicOption(0); jPanel1.setLayout(gridLayout1); NovoCliente.setText("NOVO CLIENTE"); NovoCliente.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { NovoCliente(e); } }); Fechar.setText("FECHAR"); Fechar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Fechar(e); } }); Sair.setToolTipText(""); Sair.setText("SAIR"); Sair.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.exit(0); } }); JPanel2.setLayout(gridLayout2); this.setSize(new Dimension(841,462)); this.setResizable(false); this.setTitle("LISTA DE CLIENTES"); this.getContentPane().add(jPanel1,BorderLayout.CENTER); jPanel1.add(aff,null); this.getContentPane().add(jPanel2,BorderLayout.SOUTH); jPanel2.add(Fechar,null); jPanel2.add(NovoCliente,null); jPanel2.add(SAIR,null); } public void Fechar(ActionEvent e) { this.dispose(); } //Novo Cliente public void NovoCliente(ActionEvent e) { this.dispose(); Client cl=new Client(); cl.show(); } private void affi(){ String nom=""; Vector v1=new Vector(); v1.addElement("Referencia do Cliente"); v1.addElement("Nome do Cliente"); v1.addElement("Sobrenome do Cliente"); v1.addElement("Endereço do Cliente"); v1.addElement("Estado Civil"); v1.addElement("Tipo de Cliente"); v1.addElement("Numero de telefone do Cliente"); v1.addElement("numero de fax do Cliente"); v1.addElement("E-mail do Cliente"); v1.addElement("data"); v1.addElement("hora"); LerEescrever li=new LerEescrever(); //vector v=li.ListeLecture("Produto.xls"); //System.out.println(texto +"Conteúdo"+"hora" +"minuto" +"segundo"); //JTable Table=new JTable(v.v1); aff=new JScrollPane(li.tableLecture("Client.xls",v1)); } }CadastroProdutos.javapackage devlog; import javax.swing.*; import java.awt.*; import java.awt.Event.*; //import com.borland.jbcl.layout.*; import java.applet.*; import java.util.*; public class IncluirProduto extends JFrame { JPanel jPanel1=new JPanel(); JPanel jPanel2=new JPanel(); JPanel jPanel3=new JPanel(); JPanel jPanel4=new JPanel(); BorderLayout borderLayout1=new BorderLayout(); JLabel jLabel1=new JLabel(); JComboBox NomProduit=new JComboBox(); JButton Affiche=new JButton(); BorderLayout borderLayout2=new BorderLayout(); JScrollPane aff; GridLayout gridLayout1=new GridLayout(); public IncluirProduto() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { jPanel2.setLayout(borderLayout1); jLabel1.setText("NOME DO PRODUTO"); jPanel4.setLayout(gridLayout1); Affiche.setText("DEMONSTRACAO"); Affiche.addActionListener(new ActionListener() { public void actionPerforme(ActionEvent e) { Affiche_actionPerformed(e); } }); this.setSize(new Dimension(770,376)); this.setResizable(false); this.setTitle("LISTA DOS PRODUTOS"); lecombo(); jPanel1.setLayout(borderLayout2); this.getContentPane().add(jPanel1,BorderLayout.CENTER); aff(); jPanel1.add(aff,BorderLayout.CENTER); this.getContentPane().add(jPanel2,BorderLayout.SOUTH); jPanel2.add(jPanel4.BorderLayout.CENTER); jPanel4.add(jLabel1,null); jPanel4.add(NomeProduto,null); jPanel4.add(Incluir,null); this.getContentPane().add(jPanel3,BorderLayout.NORTH); } //String de Inclusão public String lacle(){ String lcl; lcl=(String)NomeProduto.getSelectedItem(); return lcl; } public void Incluir_actionPerformed(ActionEvent e) { this.dispose(); Produto prod=new Produto(); prod.show(); } private void aff(){ String nom=""; Vector v1=new Vector(); v1.addElement("Referencia do Produto"); v1.addElement("Nome do Produto"); v1.addElement("Quantidade do Produto"); v1.addElement("Referencia do Catalogo"); v1.addElement("Imagem do Produto"); v1.addElement("Apresentação do Produto"); v1.addElement("Tipo do Produto"); v1.addElement("Descrição"); v1.addElement("Data"); v1.addElement("Hora"); LerEescrever li=new LerEescrever(); //vector v=li.ListeLeitura("Produto.xls"); //System.out.println(texto+"conteudo"+hora+minuto+segundo); //JTable Table=new JTable(v,v1)); aff=new JScrollPane(li.tableLeitura("Produto.xls",v1)); } //Estabelecendo Lecombo public void lecombo(){ LerEescrever le= new LerEescrever(); int a=0; int i=0; String mot=""; while(a<le.ListeLeitura("Produto.xls").size()){ NomeProduto.addItem(le.ListeLeitura("Produto.xls").elementAt(i)); a++; i++; } NomeProduto.revalidate(); } } }Catalogo.javapackage devlog; import java.awt.*; import javax.swing.*; import java.awt.Event.*; public class Catalogo extends JDIalog { JPanel jPanel1=new JPanel(); JPanel jPanel2=new JPanel(); JPanel jPanel3=new JPanel(); JPanel jPanel4=new JPanel(); GridLayout gridLayout1=new GridLayout(1.2); JLabel jLabel1=new JLabel(); JLabel jLabel2=new JLabel(); JLabel jLabel3=new JLbel(); JTextField RefCata=new JTextField(); JTextField NomCata=new JTextField(); JTextField TypeCata=new JTextField(); GridLayout gridLayout2=new GridLayout(3,1); GridLyout gridLayout3=new GridLayout(3,1); JPanel jPanel5=new JPanel(); JButton Fermer=new JButton(); JButton Annuler=new JButton(); JButton Enregistrer=new JButton(); JButton Quitter=new JButton(); GridLayout gridLayout4=new GridLayout(); public Catalogo Frame frame,String title,boolean modal){ super(frame,title,modal); try{ jbInit(); pack(); } catch(exception ex) { ex.printStackTrace(); } } public Catalogo() { this(null,"",false); } private void jbInit() throws Exception { jPanel2.setLayout(gridLayout1); jLabel1.setText("Referencia do Catalogo"); jLabel2.setText("Nome do Catalogo"); NomCata.setSelectionStart(11); NomCata.setText(""); jPanel3.setLayout(gridLayout2); jPanel4.setLayout(gridLayout3); Fechar.setText("Fermer"); Fechar.addActionListener(new ActionListener() { public void actionPerfomed(ActionEvent e) { Fermer)(e); } }); Registrar.setText("Registrar"); Registrar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.exit(0); } }); jPanel1.setLayout(gridLayout4); RefCata.setText(""); this.setResizable(false); this.setSize(new Dimension(579,185)); this.getContentPane().add(jPanel1,BorderLayout.SOUTH); jPanel1.add(Sair,null); jPanel1.add(Registrar,null); jPanel1.add(Anular,null); jPanel1.add(Fechar,null); this.getContentPane().add(jPanel2,BorderLayout.CENTER); jPanel2.add(jPanel3,null); jPanel3.add(jLabel1,null); jPanel3.add(jLabel2,null); jPanel3.add(jLabel3,null); jPanel2.add(jPanel4,null); jPanel4.add(RefCata,null); JPanel4.add(NomCata,null); jPanel4.add(TypeCata,null); this.getContentPane().add(jPane5,BorderLayout.NORTH); } //Comandos para Fechar public void Fechar(ActionEVent e) { this.dispose(); } //Comandos para anular public void Anular(ACtionEvent e) { RefCata.setText(""); NomCataq.setText(""); TypeCata.setText(""); } //Comandos para registrar... public void Registrar(ActionEvent e) { LireEtEcrire et=new LireEtEcrire(); Format fr=new Format(); String message; message=fr.devFormat(RefCata.getText()+"\t"+fr.devFormat(NomCata. getText())+"\t"+br.devFormatr(TypeCata.getText()); et.escrever(message,"Catalogo.xls"); Anular(e); } //Pulando Linha,salve agora... } } }Cliente.javapublic class Client extends JFrame { JPanel jPanel1=new JPanel(); JPanel jPanel2=new JPanel(); JPanel jPanel3=new JPanel(); GridLayout gridLayout1=new GridLayout(1,2); JLabel jLabel1=new JLabel(); JLabel jLabel2=new JLabel(); JLabel jLabel3=new JLabel(); JLabel jLabel4=new JLabel(); JLabel jLabel5=new JLabel(); JLabel jLabel6=new JLabel(); JLabel jLabel7=new JLabel(); JLabel jLabel8=new JLabel(); JLabel jLabel9=new JLabel(); JTextField RefCliente=new JTextField(); JTextFIeld NomeCliente=new JTextField(); JTextField PreCliente=new JTextField(); JTextField AdreCliente=new JTextField(); Object[] civ={"Sra","Srta","Sr"}; JComboBox Civil=new JComboBox(civ); Object[] type={"CLIENTE PARTICULAR","EMPRESA"}; JComboBox Type=new JComboBox(type); JTextField NumTelClient=new JTextField(); JTextField NumFaxClient=new JTextField(); JTextField EmailClient=new JTextField(); GridLayout gridlayout2=new GridLayout(10,1); GridLayout gridLayout3=new GridLayout(10,1); JPanel jPanel4=new JPanel(); Jpanel jPanel5=new JPanel(); JPanel jPanel6=new JPanel(); GridLayout gridLayout4=new GridLayout(2,1); JButton Annuler=new JButton(); JButton Valider=new JButton(); JButton Quitter=new JButton(); JButton Fermer=new JButton(); GridLayout gridLayout5=new GridLayout(); GridLayout gridLayout6=new GridLayout(); public Cliente() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { this.setSize(new Dimension(600,256)); JPanel1.setLayout(gridLayout); JLabel1.setText("REFERENCIA DO CLIENTE"); jLabel2.setText("NOME DO CLIENTE"); jLabel3.setText("SOBRENOME DO CLIENTE"); jLabel4.setText("ENDEREÇO"); jLabel5.setText("ESTADO CIVIL"); jLabel6.setText("TIPO"); jLabel7.setText("NUMERO DO TELEFONE"); jLabel8.setText("NUMERO DO FAX"); jLabel9.setText("E-MAIL"); jPanel2.setLayout(gridLayout2); jPanel3.setLayout(gridLayout3); RefClient.setText(""); NomClient.setText(""); PreClient.setText(""); AdreClient.setText(""); NumTelClient.setText(""); NumFaxClient.setText(""); JPanel4.setLayout(gridLayout4); Annuler.setText("ANULAR"); Annuler.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Annuler(e); } }); Quitter.setToolTipText(""); Quitter.setText("SAIR"); Quitter.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { System.exit(0); } }); Fermer.setText("FECHAR"); Fermer.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { Fermer(e); } }); jPanel6.setLayout(gridLayout5); jPanel5.setLayout(gridLayout6); this.getContentPane().add(jPanel1,BorderLayout.CENTER); jPanel1.add(jPanel2,null); jPanel2.add(jLabel1,null); jPanel2.add(jLabel2,null); jPanel2.add(jLabel3,null); jPanel2.add(jLabel4,null); jPanel1.add(jPanel3,null); jPanel2.add(jLabel5,null); jPanel2.add(jLabel6,null); jPanel2.add(jLabel7,null); jPanel2.add(jLabel8,null); jPanel2.add(jLabel9,null); jPanel3.add(RefClient,null); jPanel3.add(NomClient,null); jPanel3.add(PreClient,null); jPanel3.add(AdreClient,null); jPanel3.add(Civil,null); jPanel3.add(Type,null); jPanel3.add(NumTelClient,null); jPanel3.add(NumFaxClient,null); jPanel3.add(EmailClient,null); this.getContentPane().add(jPanel4,BorderLayout.SOUTH); jPanel4.add(jPanel6,null); jPanel6.add(Valider,null); jPanel6.add(Anular,null); jPanel4.add(jPanel5,null); jPanel5.add(Fechar,null); jPanel5.add(Sair,null); } //Anular... public void Annuler(ActionEvent e) { RefClient.setText(""); NomClient.setText(""); Preclient.setText(""); AdreClient.setText(""); Civil.setSelectedIndex(0); Type.setSelectedIndex(0); NumTelClient.settText(""); NumFaxClient.setText(""); EmailClient.setText(""); //Validar.... public void Valider(ActionEvent e) { LireEtEcrire et=new LireEtEcrire(); Format fr=new Format(); String message; message=fr.devFormat(RefCliente. getText())+"\t"+fr.devFormat(NomClient. getText())+"\t"+fr.devFormat(PreClient. getText())+"\t"+fr.devFormat(AdreClient. getText())+"\t"+fr.devFormat((String)Civil.getSelectedItem())+"\t"+fr. devFormat((String)Type.getSelectedItem())+"\t"+fr.devFormat(NumTelClient.getText()) +"\t"+fr.devFormat(NumFaxClient.getText())+"\t"+fr.devFormat(EmailClient.getText()); et.escrever(message,"Cliente.xls"); Anular(3); } //Fechar... public void Fechar(ActionEvent e){ this.dispose(); InserirCliente afc=new InserirCliente(); afc.show(); } }Alguém pode me ajudar
Editado por sl@ckw@reLink para o comentário
Compartilhar em outros sites
1 resposta a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.