title: How to get a variable from another GUI class?
body: <p>I'm trying to access data from a text field in another class. 
  currently, it's like this.</p>
  
  <pre><code>public class Search(){
  String txtfield = "Something";
   }
  public class GetSomething(){
  String name;
  Search s = new Search();
  
  name = s.txtfield();
  </code></pre>
  
  <p>I've tried multiple ways to try and do this but none has proved to be useful or just work.
  Please leave me some solutions. Thanks!</p>