Gostei muito da explicação, mas esto precisando de implementar a mesma coisa usando Javafx e não to conseguindo, por favor me ajudem!!!
Olá, sei que não deveria ressucitar um tópico escrito a muito tempo, porem fiz uma calculadora, e gostaria que ela funcionasse atraves do teclado, e tentei implementar esse codigo, não obtive exito, será que alguem pode me ajudar? Segue meu código abaixo
private BotaoNumericoAction acaoBotao1 = new BotaoNumericoAction(1);
/*
Antonio Augusto
Daniel Brandão
Rérison Augusto
Ricardo Mendes
Calculadora em Java
3º Módulo Informática - 2015
Quatá - SP
*/
package br.com.etec.Calculadora;
import java.awt.event.KeyEvent;
public class JFCalculadora extends javax.swing.JFrame {
char operacao;
String temp;
double num1, num2, resultado;
boolean click = false;
public JFCalculadora() {
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">
private void initComponents() {
jButton21 = new javax.swing.JButton();
jButton24 = new javax.swing.JButton();
jPanel1 = new javax.swing.JPanel();
jVisor = new javax.swing.JTextField();
jBBsp = new javax.swing.JButton();
jB7 = new javax.swing.JButton();
jB4 = new javax.swing.JButton();
jB1 = new javax.swing.JButton();
jB0 = new javax.swing.JButton();
jBCE = new javax.swing.JButton();
jB8 = new javax.swing.JButton();
jB5 = new javax.swing.JButton();
jB2 = new javax.swing.JButton();
jBPonto = new javax.swing.JButton();
jBC = new javax.swing.JButton();
jB9 = new javax.swing.JButton();
jB6 = new javax.swing.JButton();
jB3 = new javax.swing.JButton();
jBIgual = new javax.swing.JButton();
jBMaisMenos = new javax.swing.JButton();
jBDiv = new javax.swing.JButton();
jBMult = new javax.swing.JButton();
jBMenos = new javax.swing.JButton();
jBMais = new javax.swing.JButton();
jBRaiz = new javax.swing.JButton();
jBPorc = new javax.swing.JButton();
jButton21.setText("jButton21");
jButton24.setText("jButton24");
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jPanel1.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
jPanel1KeyPressed(evt);
}
});
jVisor.setEditable(false);
jVisor.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
jBBsp.setText("<");
jBBsp.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBBspActionPerformed(evt);
}
});
jB7.setText("7");
jB7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jB7ActionPerformed(evt);
}
});
jB4.setText("4");
jB4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jB4ActionPerformed(evt);
}
});
jB1.setText("1");
jB1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jB1ActionPerformed(evt);
}
});
jB0.setText("0");
jB0.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jB0ActionPerformed(evt);
}
});
jBCE.setText("CE");
jBCE.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBCEActionPerformed(evt);
}
});
jB8.setText("8");
jB8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jB8ActionPerformed(evt);
}
});
jB5.setText("5");
jB5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jB5ActionPerformed(evt);
}
});
jB2.setText("2");
jB2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jB2ActionPerformed(evt);
}
});
jBPonto.setText(".");
jBPonto.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBPontoActionPerformed(evt);
}
});
jBC.setText("C");
jBC.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBCActionPerformed(evt);
}
});
jB9.setText("9");
jB9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jB9ActionPerformed(evt);
}
});
jB6.setText("6");
jB6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jB6ActionPerformed(evt);
}
});
jB3.setText("3");
jB3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jB3ActionPerformed(evt);
}
});
jBIgual.setText("=");
jBIgual.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBIgualActionPerformed(evt);
}
});
jBMaisMenos.setText("+/-");
jBMaisMenos.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBMaisMenosActionPerformed(evt);
}
});
jBDiv.setText("/");
jBDiv.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBDivActionPerformed(evt);
}
});
jBMult.setText("*");
jBMult.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBMultActionPerformed(evt);
}
});
jBMenos.setText("-");
jBMenos.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBMenosActionPerformed(evt);
}
});
jBMais.setText("+");
jBMais.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBMaisActionPerformed(evt);
}
});
jBRaiz.setText("√¯");
jBRaiz.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBRaizActionPerformed(evt);
}
});
jBPorc.setText("%");
jBPorc.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBPorcActionPerformed(evt);
}
});
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.LEADING)
.addComponent(jVisor)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jBBsp)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jBCE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jBC)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jBRaiz))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jB7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jB8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jB9)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jBDiv))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jB4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jB5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jB6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jBMult))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jB1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jB2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jB3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jBMenos))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jB0)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jBPonto)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jBMaisMenos)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jBPorc)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jBIgual)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jBMais)))))
.addContainerGap())
);
jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jB0, jB1, jB2, jB3, jB4, jB5, jB6, jB7, jB8, jB9, jBBsp, jBC, jBCE, jBDiv, jBIgual, jBMais, jBMaisMenos, jBMenos, jBMult, jBPonto, jBPorc, jBRaiz});
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jVisor, 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.LEADING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jBBsp)
.addComponent(jBCE)
.addComponent(jBC)
.addComponent(jBRaiz))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jB7)
.addComponent(jB8)
.addComponent(jB9)
.addComponent(jBDiv)))
.addComponent(jBMais, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jB4)
.addComponent(jB5)
.addComponent(jB6)
.addComponent(jBMult))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jB1)
.addComponent(jB2)
.addComponent(jB3)
.addComponent(jBMenos))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jB0)
.addComponent(jBPonto)
.addComponent(jBMaisMenos)
.addComponent(jBPorc))
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(jBIgual, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
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(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
private void jB0ActionPerformed(java.awt.event.ActionEvent evt) {
temp = jVisor.getText();
temp = temp + "0";
jVisor.setText(temp);
}
private void jB1ActionPerformed(java.awt.event.ActionEvent evt) {
temp = jVisor.getText();
temp = temp + "1";
jVisor.setText(temp);
}
private void jB2ActionPerformed(java.awt.event.ActionEvent evt) {
temp = jVisor.getText();
temp = temp + "2";
jVisor.setText(temp);
}
private void jB3ActionPerformed(java.awt.event.ActionEvent evt) {
temp = jVisor.getText();
temp = temp + "3";
jVisor.setText(temp);
}
private void jB4ActionPerformed(java.awt.event.ActionEvent evt) {
temp = jVisor.getText();
temp = temp + "4";
jVisor.setText(temp);
}
private void jB5ActionPerformed(java.awt.event.ActionEvent evt) {
temp = jVisor.getText();
temp = temp + "5";
jVisor.setText(temp);
}
private void jB6ActionPerformed(java.awt.event.ActionEvent evt) {
temp = jVisor.getText();
temp = temp + "6";
jVisor.setText(temp);
}
private void jB7ActionPerformed(java.awt.event.ActionEvent evt) {
temp = jVisor.getText();
temp = temp + "7";
jVisor.setText(temp);
}
private void jB8ActionPerformed(java.awt.event.ActionEvent evt) {
temp = jVisor.getText();
temp = temp + "8";
jVisor.setText(temp);
}
private void jB9ActionPerformed(java.awt.event.ActionEvent evt) {
temp = jVisor.getText();
temp = temp + "9";
jVisor.setText(temp);
}
private void jBPontoActionPerformed(java.awt.event.ActionEvent evt) {
// o primeiro número é zero(0) e o segundo não é ponto ?
if((jVisor.getText().length() == 1) && (jVisor.getText().substring(0,1).equals("0")) && (!jVisor.getText().substring(1,1).equals(".")))
{
jVisor.setText(jVisor.getText().replace("0",""));
}
// pressionou o botão ponto ?
if(evt.getSource() == jBPonto)
{
// é o segundo valor ?
if(click)
{
jVisor.setText(null);
// tem ponto ?
if(jVisor.getText().indexOf(".") < 0)
{
// é o primeiro caracter ?
if(jVisor.getText().length() < 1)
{
jVisor.setText("0.");
}
else
{
jVisor.setText(".");
}
}
}
else
{
// tem ponto ?
if(jVisor.getText().indexOf(".") < 0)
{
// é o primeiro caracter ?
if(jVisor.getText().length() < 1)
{
jVisor.setText("0.");
}
else
{
jVisor.setText(jVisor.getText()+".");
}
}
}
click = false;
}
}
private void jBMaisActionPerformed(java.awt.event.ActionEvent evt) {
try {
operacao = '+';
num1 = Double.parseDouble(jVisor.getText());
jVisor.setText("");
} catch (Exception e) {
jVisor.setText("");
}
}
private void jBMenosActionPerformed(java.awt.event.ActionEvent evt) {
try{
operacao = '-';
num1 = Double.parseDouble(jVisor.getText());
jVisor.setText("");
} catch (Exception e) {
jVisor.setText("");
}
}
private void jBMultActionPerformed(java.awt.event.ActionEvent evt) {
try {
operacao = '*';
num1 = Double.parseDouble(jVisor.getText());
jVisor.setText("");
} catch (Exception e) {
jVisor.setText("");
}
}
private void jBDivActionPerformed(java.awt.event.ActionEvent evt) {
try {
operacao = '/';
num1 = Double.parseDouble(jVisor.getText());
jVisor.setText("");
} catch (Exception e) {
jVisor.setText("");
}
}
private void jBMaisMenosActionPerformed(java.awt.event.ActionEvent evt) {
try {
if(temp.startsWith("-")){
temp = temp.replace("-", "+");
} else if(temp.startsWith("+")){
temp = temp.replace("+", "-");
} else {
temp = "-" + temp;
}
jVisor.setText(temp);
} catch (Exception e) {
jVisor.setText("PRESSIONE C E TENTE NOVAMENTE");
}
}
private void jBRaizActionPerformed(java.awt.event.ActionEvent evt) {
try {
String raiz = jVisor.getText();
Double solucao;
solucao = Math.sqrt(Double.parseDouble(raiz));
double armazenado = solucao;
double mostrar;
mostrar = (double)armazenado;
jVisor.setText(String.valueOf(mostrar));
} catch (Exception e) {
jVisor.setText("PRESSIONE C E TENTE NOVAMENTE");
}
}
private void jBPorcActionPerformed(java.awt.event.ActionEvent evt) {
try {
num2=Double.parseDouble(jVisor.getText());
jVisor.setText(null);
double calc = num1*(num2/100);
calc = num1 + calc;
jVisor.setText(String.valueOf(calc));
} catch (Exception e) {
jVisor.setText("PRESSIONE C E TENTE NOVAMENTE");
}
}
private void jBIgualActionPerformed(java.awt.event.ActionEvent evt) {
try {
num2 = Double.parseDouble(jVisor.getText());
switch (operacao){
case '+':
resultado = num1 + num2;
num1 = resultado;
resultado = num1 + num2;
break;
case '-':
resultado = num1 - num2;
break;
case '*':
resultado = num1 * num2;
break;
case '/':
resultado = num1 / num2;
break;
case '%':
resultado = (num1 * num2)/100;
break;
}
jVisor.setText(String.valueOf(resultado));
} catch (Exception e) {
jVisor.setText("PRESSIONE C E TENTE NOVAMENTE");
}
}
private void jBCEActionPerformed(java.awt.event.ActionEvent evt) {
num2 = 0;
jVisor.setText(String.valueOf(num1));
}
private void jBCActionPerformed(java.awt.event.ActionEvent evt) {
num1 = 0;
num2 = 0;
jVisor.setText("");
}
private void jBBspActionPerformed(java.awt.event.ActionEvent evt) {
try{
jVisor.setText(jVisor.getText().substring(0, jVisor.getText().length() - 1));
} catch (Exception e) {
jVisor.setText("PRESSIONE C E TENTE NOVAMENTE");
}
}
private void jPanel1KeyPressed(java.awt.event.KeyEvent evt) {
// TODO add your handling code here:
}
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(JFCalculadora.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(JFCalculadora.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(JFCalculadora.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(JFCalculadora.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 JFCalculadora().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton jB0;
private javax.swing.JButton jB1;
private javax.swing.JButton jB2;
private javax.swing.JButton jB3;
private javax.swing.JButton jB4;
private javax.swing.JButton jB5;
private javax.swing.JButton jB6;
private javax.swing.JButton jB7;
private javax.swing.JButton jB8;
private javax.swing.JButton jB9;
private javax.swing.JButton jBBsp;
private javax.swing.JButton jBC;
private javax.swing.JButton jBCE;
private javax.swing.JButton jBDiv;
private javax.swing.JButton jBIgual;
private javax.swing.JButton jBMais;
private javax.swing.JButton jBMaisMenos;
private javax.swing.JButton jBMenos;
private javax.swing.JButton jBMult;
private javax.swing.JButton jBPonto;
private javax.swing.JButton jBPorc;
private javax.swing.JButton jBRaiz;
private javax.swing.JButton jButton21;
private javax.swing.JButton jButton24;
private javax.swing.JPanel jPanel1;
private javax.swing.JTextField jVisor;
// End of variables declaration
}
Desde já Agradeço.
Siga as dicas do post original. Você nem sequer usou o objeto KeyStroke, nesse caso, não tem como funcionar mesmo.
Ok, então você poderia ensinar um usuário que está aprendendo Java agora, e não sabe quase nada a fazer isso?
Ok, então você poderia ensinar um usuário que está aprendendo Java agora, e não sabe quase nada a fazer isso? [/quote]
Execute o exemplo do primeiro post e entenda-o, depois replique.
Parabens vini… vejo que ajudou muitos, mas estou com uma duvida: eu posso usar os mesmos códigos para as operações.
obrigado, sei que faz tempo desde o ultimo a escrever, mas espero que atenda.
vlwww.
Sim, é só adaptar.
private BotaoNumericoAction acaoBotao+ = new BotaoNumericoAction(+);
mas esta dando erro, existe algo diferente para as operações.
OBGDÃO
alguem poderia me responder???
E funfa com JavaFX? Só passando pra perguntar e tudo mais.