Skip to content

Commit

Permalink
DivConGUI agora incorpora a nova tela de adicionar saldo individual
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro-V committed Oct 28, 2022
1 parent 411cbf6 commit 7eed8be
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions src/divcon/DivConGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,21 +212,10 @@ private void deslogarUsuario(){
* Cria uma janela para adicionar saldo no participante logado
*/
private void adicionarSaldo(){
JDialog janelaAddSaldo = new JDialog();
janelaAddSaldo.setBounds(100, 100, 400, 350);
janelaAddSaldo.getContentPane().setLayout(new BorderLayout());
JTextField txtFieldSaldo = new JTextField();
JButton btnAddSaldo = new JButton("Adicionar");
janelaAddSaldo.getContentPane().add(txtFieldSaldo, BorderLayout.CENTER);
janelaAddSaldo.getContentPane().add(btnAddSaldo, BorderLayout.SOUTH);
janelaAddSaldo.setVisible(true);
btnAddSaldo.addActionListener(e -> {
Float saldo = Float.valueOf(txtFieldSaldo.getText());
appDivCon.getParticipanteLogado().addSaldoIndividual(saldo);
janelaAddSaldo.dispose();
attInfoSaldo();
});
}
TelaSaldoIndividual telaSaldoIndividual = new TelaSaldoIndividual(appDivCon, appDivCon.getParticipanteLogado());
telaSaldoIndividual.setVisible(true);
attInfoSaldo();
}

/**
* Atualiza o label com o valor do saldo atual
Expand Down

0 comments on commit 7eed8be

Please sign in to comment.