title: JAVA - Calling a method Inside a jframe from another class
body: <p>I have a Jframe with a method that clear text of a text area : </p>
  
  <pre><code>//in  bgui.java(jframe)
  public void clear_log(){
      JOptionPane.showMessageDialog(ui, "foo");
      terminal.setText("");
  } 
  </code></pre>
  
  <p>and also i have method in another package in a class that call <code>clear_log</code> method:</p>
  
  <pre><code>//in Bcommsnd.java
  public int parse_command(String cmd){
       Bgui ui = new Bgui();
       ui.clear_log();
  }
  </code></pre>
  
  <p>the message shown but <code>setText()</code> command not working.
  any sugestion please</p>