Examples of JActButton


Examples of org.swingBean.gui.JActButton

      JOptionPane.showMessageDialog(panelFormulario, e.getMessage());
    }
  }
 
  private void adicionarBotoes() {
    botaoLimpa = new JActButton("Limpar Formul�rio",
           new ApplicationAction() {
              public void execute() {
                panelFormulario.cleanForm();
                try {
              model.setBeanList(iefInfoTelaDAO.getList());
            } catch (ApplicationException e) {
              JOptionPane.showMessageDialog(panelFormulario, e.getMessage());
            }
                botaoLimpa.setEnabled(true);
                botaoInsereLinha.setEnabled(true);
              botaoAtualizaLinha.setEnabled(false);
              botaoExcluiLinha.setEnabled(false);
              botaoQuery.setEnabled(true);
              }
           });

    botaoInsereLinha = new JActButton("Inserir Linha",
           new ApplicationAction() {
              public void execute() {
                iefInfoTelaAtual=new IefInfoTela();
                panelFormulario.populateBean(iefInfoTelaAtual);
                try {                 
                  iefInfoTelaDAO.insert(iefInfoTelaAtual);
                  model.setBeanList(iefInfoTelaDAO.getList());
                  panelFormulario.cleanForm();
                } catch (ApplicationException e) {
                  JOptionPane.showMessageDialog(panelFormulario, e.getMessage());
                }
                botaoLimpa.setEnabled(true);
              botaoInsereLinha.setEnabled(true);
              botaoAtualizaLinha.setEnabled(false);
              botaoExcluiLinha.setEnabled(false);
              botaoQuery.setEnabled(true);
              }
           });
   
    botaoExcluiLinha = new JActButton("Excluir Linha",
           new ApplicationAction() {
              public void execute() {
                iefInfoTelaAtual= model.getBeanAt(table.getSelectedRow());
                panelFormulario.populateBean(iefInfoTelaAtual);
                try {
              iefInfoTelaDAO.delete(iefInfoTelaAtual);
              model.setBeanList(iefInfoTelaDAO.getList());
              panelFormulario.cleanForm();
            } catch (ApplicationException e) {
              JOptionPane.showMessageDialog(panelFormulario, e.getMessage());
            }
            botaoLimpa.setEnabled(true);
            botaoInsereLinha.setEnabled(true);
              botaoAtualizaLinha.setEnabled(false);
              botaoExcluiLinha.setEnabled(false);
              botaoQuery.setEnabled(true);
              }
           });
   
    botaoAtualizaLinha = new JActButton("Atualizar Linha",
           new ApplicationAction() {
              public void execute() {
              //Popula um objeto com as informa��es do form
                iefInfoTelaAtual=model.getBeanAt(table.getSelectedRow());
                panelFormulario.populateBean(iefInfoTelaAtual);
                //System.out.println(iefInfoTelaAtual.getNome()+iefInfoTelaAtual.getSigla()+iefInfoTelaAtual.getCidade()+iefInfoTelaAtual.getEstado());
                if(iefInfoTelaAtual.isValid()){
                  try {
                    iefInfoTelaDAO.update(iefInfoTelaAtual);
                    model.setBeanList(iefInfoTelaDAO.getList());
                    panelFormulario.cleanForm();
                  } catch (ApplicationException e) {
                    JOptionPane.showMessageDialog(panelFormulario, e.getMessage());
                  }
                  botaoLimpa.setEnabled(true);
                  botaoInsereLinha.setEnabled(true);
                  botaoAtualizaLinha.setEnabled(false);
                botaoExcluiLinha.setEnabled(false);
                botaoQuery.setEnabled(true);
                }
                else {
                  System.out.println("Algum campo ainda eh nulo\n");
                }
              }
           });
   
    botaoQuery = new JActButton("I'm Feeling Lucky",
        new ApplicationAction() {
            public void execute() {
              iefInfoTelaAtual=new IefInfoTela();
              panelFormulario.populateBean(iefInfoTelaAtual);
              iefInfoTelaAtual.setInsertWildcards(true);
View Full Code Here

Examples of org.swingBean.gui.JActButton

      JOptionPane.showMessageDialog(panelFormulario, e.getMessage());
    }
  }
 
  private void adicionarBotoes() {
    botaoLimpa = new JActButton("Limpar Formul�rio",
           new ApplicationAction() {
              public void execute() {
                panelFormulario.cleanForm();
                try {
              model.setBeanList(ProfessorTelaDAO.getList());
            } catch (ApplicationException e) {
              JOptionPane.showMessageDialog(panelFormulario, e.getMessage());
            }
                botaoLimpa.setEnabled(true);
                botaoInsereLinha.setEnabled(true);
              botaoAtualizaLinha.setEnabled(false);
              botaoExcluiLinha.setEnabled(false);
              botaoQuery.setEnabled(true);
              }
           });

    botaoInsereLinha = new JActButton("Inserir Linha",
           new ApplicationAction() {
              public void execute() {
                professorTelaAtual=new ProfessorTela();
                panelFormulario.populateBean(professorTelaAtual);
                try {                 
                  ProfessorTelaDAO.insert(professorTelaAtual);
                  model.setBeanList(ProfessorTelaDAO.getList());
                  panelFormulario.cleanForm();
                } catch (ApplicationException e) {
                  JOptionPane.showMessageDialog(panelFormulario, e.getMessage());
                }
                botaoLimpa.setEnabled(true);
              botaoInsereLinha.setEnabled(true);
              botaoAtualizaLinha.setEnabled(false);
              botaoExcluiLinha.setEnabled(false);
              botaoQuery.setEnabled(true);
              }
           });
   
    botaoExcluiLinha = new JActButton("Excluir Linha",
           new ApplicationAction() {
              public void execute() {
                professorTelaAtual= model.getBeanAt(table.getSelectedRow());
                panelFormulario.populateBean(professorTelaAtual);
                if(professorTelaAtual==null) System.out.println("Fudeu");
                else System.out.println("bizu");
                try {
              ProfessorTelaDAO.delete(professorTelaAtual);
              model.setBeanList(ProfessorTelaDAO.getList());
              panelFormulario.cleanForm();
            } catch (ApplicationException e) {
              JOptionPane.showMessageDialog(panelFormulario, e.getMessage());
            }
            botaoLimpa.setEnabled(true);
            botaoInsereLinha.setEnabled(true);
              botaoAtualizaLinha.setEnabled(false);
              botaoExcluiLinha.setEnabled(false);
              botaoQuery.setEnabled(true);
              }
           });
   
    botaoAtualizaLinha = new JActButton("Atualizar Linha",
           new ApplicationAction() {
              public void execute() {
              //Popula um objeto com as informa��es do form
                professorTelaAtual=model.getBeanAt(table.getSelectedRow());
                panelFormulario.populateBean(professorTelaAtual);
                //System.out.println(ProfessorTelaAtual.getNome()+ProfessorTelaAtual.getSigla()+ProfessorTelaAtual.getCidade()+ProfessorTelaAtual.getEstado());
                if(professorTelaAtual.isValid()){
                  try {
                    ProfessorTelaDAO.update(professorTelaAtual);
                    model.setBeanList(ProfessorTelaDAO.getList());
                    panelFormulario.cleanForm();
                  } catch (ApplicationException e) {
                    JOptionPane.showMessageDialog(panelFormulario, e.getMessage());
                  }
                  botaoLimpa.setEnabled(true);
                  botaoInsereLinha.setEnabled(true);
                  botaoAtualizaLinha.setEnabled(false);
                botaoExcluiLinha.setEnabled(false);
                botaoQuery.setEnabled(true);
                }
                else {
                  System.out.println("Algum campo ainda eh nulo\n");
                }
              }
           });
   
    botaoQuery = new JActButton("I'm Feeling Lucky",
        new ApplicationAction() {
            public void execute() {
              professorTelaAtual=new ProfessorTela();
              panelFormulario.populateBean(professorTelaAtual);
              try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.