Tenho as seguinte duvida como faço para preencher um campo altomaticamente, tenho um campo preço, sinal faço a conta (preço-sinal) e coloco na variavel total, como faço para o resultado dessa conta aparecer diretamente no total :oops: :lol: :lol:
E quando estou convertendo os valores para float aparece o seguinte erro:
Exception in thread “AWT-EventQueue-0” java.lang.ClassCastException
at java.lang.Class.cast(Class.java:2990)
at org.jdesktop.beansbinding.Binding.convertForward(Binding.java:1312)
at org.jdesktop.beansbinding.Binding.getSourceValueForTarget(Binding.java:844)
at org.jdesktop.beansbinding.Binding.refreshUnmanaged(Binding.java:1222)
at org.jdesktop.beansbinding.Binding.refresh(Binding.java:1207)
at org.jdesktop.beansbinding.AutoBinding.tryRefreshThenSave(AutoBinding.java:162)
at org.jdesktop.beansbinding.AutoBinding.bindImpl(AutoBinding.java:199)
at org.jdesktop.beansbinding.Binding.bindUnmanaged(Binding.java:959)
at org.jdesktop.beansbinding.Binding.bind(Binding.java:944)
at org.jdesktop.beansbinding.BindingGroup.bind(BindingGroup.java:143)
at zinn.os.initComponents(os.java:927)
at zinn.os.(os.java:40)
at zinn.os$4.run(os.java:999)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
CONSTRUÍDO COM SUCESSO (tempo total: 2 segundos)