title: Why can't I call a private variable in main method?
body: <p>this code is supposed to receive a full name string example "Billy Bob Smith" in an input dialog box and output the initials as a monogram example "BBS" in a message dialog box. but for some reason the main method won't let me acces the fullName variable.</p>
  
  <pre><code>import javax.swing.*;
  
  public class HardMonogram {
       //---------- ATTRIBUTES ----------//
       private String fullName;
       private String monogram;
       private String first;
       private String middle;
       private String last;
  
  
       //---------- METHODS ----------//
       public String getInitial(String seperateName) {
             return seperateName.substring(0, 1);
       }
  
       public void getSeperateName(String fullName) {
             first  = fullName.substring(0, fullName.indexOf(" "));
             middle = fullName.substring(fullName.indexOf(" ") + 1, fullName.length());
             last   = middle.substring(middle.indexOf(" ") + 1, middle.length());
             middle = middle.substring(0, middle.indexOf(" "));
       }
  
      public void setMonogram() {
            monogram = getInitial(first)  +
                       getInitial(middle) +
                       getInitial(last);
  
      JOptionPane.showMessageDialog(null, monogram);
      }
  
      public static void main(String[] args) {
             myMono.fullName = JOptionPane.showInputDialog(null, "Type in you full name");
  
             HardMonogram myMono = new HardMonogram();
             myMono.getSeperateName(myMono.fullName);
             myMono.setMonogram();
  
      }
  
  
  }
  </code></pre>
  
  <p>gives me this build error</p>
  
  <pre><code>/Users/aaron/School/Fall 2012/CSCI-C 201/Labs/LB08/HardMonogram.java:33: error: cannot find symbol
      myMono.fullName = JOptionPane.showInputDialog(null, "Type in you full name");
      ^
  symbol:   variable myMono
  location: class HardMonogram
  1 error
  [Finished in 1.2s with exit code 1]
  </code></pre>
  
  <p>it's for my intro to java class but I don't know why I can't acces the variable. I'm obviously overlooking something. any ideas?</p>