title: Changing text on JComponent
body: <p>I need to change text inside Jcomponents, which are arranged at the coordinates x and y on JPanel.
  But if I change the text everywhere, except in the TextFields or PasswordFields, the location and dimensions of the elements slipping.</p>
  
  <p>Listener, that changes parameters of elements</p>
  
  <pre><code>private TextListener textListener = new TextListener() {
  
      @Override
      public void textValueChanged(TextEvent e) {
          if (comp.getClass() == JButton.class) {
              ((JButton)comp).setText(ttext.getText());
          }else{
              if(comp.getClass() == JTextField.class){
                  ((JTextField)comp).setText(ttext.getText());
              }else{
                  if(comp.getClass() == JPasswordField.class){
                      ((JPasswordField)comp).setText(ttext.getText());
                  }else{
                      if(comp.getClass() == JTextArea.class){
                          ((JTextArea)comp).setText(ttext.getText());
                      }else{
                              if(comp.getClass() == JCheckBox.class){
                                  ((JCheckBox)comp).setText(ttext.getText());
                              }else{
                                  ((JRadioButton)comp).setText(ttext.getText());
                              }
                          }
                      }
                  }
              }
          try{
              comp.setBounds(tx,ty,Integer.valueOf(twidth.getText()),Integer.valueOf(theight.getText()));
          }catch(NumberFormatException ex){
              JOptionPane.showMessageDialog(null,"Error","Error",JOptionPane.ERROR_MESSAGE);
          }
          comp.repaint();         
      }
  };
  </code></pre>
  
  <p>What can I do? Thanks!</p>