Check java component is empty
<p>Why if doesn' work when check if component is equal to ""     </p>

<pre><code>  private boolean ControllaCampi(){
        boolean verifica = true;
        for (Component component : pMain.getComponents()){
        if ((component.getClass().equals(JTextField.class)) ||  component.getClass().equals(JFormattedTextField.class))){
            if (component.equals("")){
                verifica = false;
                break;
            }
        }
    }
    return verifica;
}
</code></pre>