Note that there are some explanatory texts on larger screens.

plurals
  1. PONumberFormatException in String.Format("%05.2f", 8.00)
    primarykey
    data
    text
    <p>I'm using italian locale for my program so <code>Float.parseFloat("8,00")</code> must function well. But I have encountered a very bad NFE in the following line:</p> <pre><code>this.cuSurfaceJTextField1.setValue( String.format("%05.2f",info.getCuSurface())); </code></pre> <p>I note that the above code used to work well up to some changes I made to the listeners that don't look to be related to this line of the code.(Now I have a propertyChangeListener that updates the model when the value is changed.</p> <pre><code>this.cuSurfaceJTextField1.addPropertyChangeListener("value", new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { info.setCuSurface(Float.parseFloat( (String)cuSurfaceJTextField1.getValue())); updateCuSurface(); } }); </code></pre> <p>The useful part of the exception:</p> <pre><code>Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For input string: "08,00" at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1241) at java.lang.Float.parseFloat(Float.java:452) at View.bars.QuadrateJPanel$11.propertyChange(QuadrateJPanel.java:348) at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:328) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263) at java.awt.Component.firePropertyChange(Component.java:8382) at javax.swing.JFormattedTextField.setValue(JFormattedTextField.java:799) at javax.swing.JFormattedTextField.setValue(JFormattedTextField.java:502) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload