Quero ajuda a selecionar esse erro!

4 respostas
java
J
Exception in thread AWT-EventQueue-0 java.lang.NumberFormatException: empty String

at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1842)

at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)

at java.lang.Double.parseDouble(Double.java:538)

at java.lang.Double.valueOf(Double.java:502)

at calculadora_programador.Principal.RadioBtn_BinActionPerformed(Principal.java:689)

at calculadora_programador.Principal.access$2600(Principal.java:15)

at calculadora_programador.Principal$27.actionPerformed(Principal.java:325)

at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)

at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)

at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)

at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:308)

at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)

at java.awt.Component.processMouseEvent(Component.java:6533)

at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)

at java.awt.Component.processEvent(Component.java:6298)

at java.awt.Container.processEvent(Container.java:2237)

at java.awt.Component.dispatchEventImpl(Component.java:4889)

at java.awt.Container.dispatchEventImpl(Container.java:2295)

at java.awt.Component.dispatchEvent(Component.java:4711)

at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)

at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)

at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)

at java.awt.Container.dispatchEventImpl(Container.java:2281)

at java.awt.Window.dispatchEventImpl(Window.java:2746)

at java.awt.Component.dispatchEvent(Component.java:4711)

at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)

at java.awt.EventQueue.access$500(EventQueue.java:97)

at java.awt.EventQueue$3.run(EventQueue.java:709)

at java.awt.EventQueue$3.run(EventQueue.java:703)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)

at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)

at java.awt.EventQueue$4.run(EventQueue.java:731)

at java.awt.EventQueue$4.run(EventQueue.java:729)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)

at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)

at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

OBS: estou tentando bloquear buttons do jframe para um programa, com o metodo mas fica dando esse erro!

4 Respostas

jallisson_jallis

Manda o método

J
public double bloquearButtons(){

btn_2.setEnabled(false);

btn_3.setEnabled(false);

btn_4.setEnabled(false);

btn_5.setEnabled(false);

btn_6.setEnabled(false);

btn_7.setEnabled(false);

btn_8.setEnabled(false);

btn_9.setEnabled(false);

return 0;

}

J
onde eu to chamando:

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

bloquearButtons();

Text_Bin.setText("");

String n=Text_box.getText();

double d = Double.valueOf(n).doubleValue();

int num=(int) d;

Text_Bin.setText(Integer.toBinaryString(num));

}
J

estou fazendo o comando binario, na vdd ja fiz mas precisa bloquear os dms botões e deixar so o 0 e 1!
consegue bloquear mas aparece o erro e bagunça tudo

Criado 30 de dezembro de 2017
Ultima resposta 31 de dez. de 2017
Respostas 4
Participantes 2