Last assignment, very tired  easy rep points for an easy question....
I have to make a class that checks validity of an ISBN number.

I am exhausted from all of this work.

I cannot think straight, and I can't even get started.  I have to create a class called ISBNTextField that inherits from a JTextField.  Then, I write a default arg constructor that calls the superclass constructor fo teh TextField object to instantiate a TextField with 20 cols.  Then, I am to create a public method (getter) to retrieve the ISBN entered in the textfied, and store it as a class variable.  It will then call a later method called validatISBN() that accepts and ISBN string and returns a valid ISBN string number.


I have written the following code, but continually get a 'non-static method getText() can not be referenced from a static context' error.

Could someone help get me on the right track here?

        public class ISBNText extends JTextField
    {  
       protected static String bookNum;
       protected JTextField  bookText; 
       public ISBNText() 
       {
           super(20);
           bookText = new JTextField();
       }   
       public String getISBN()
       {           
          String bookNum = ISBNText.getText();
          return bookNum;
       }
       private String validateISBN(String bookNum)


Last assignment, very tired  easy rep points for an easy question....
===

I have to make a class that checks validity of an ISBN number.

I am exhausted from all of this work.

I cannot think straight, and I can't even get started.  I have to create a class called ISBNTextField that inherits from a JTextField.  Then, I write a default arg constructor that calls the superclass constructor fo teh TextField object to instantiate a TextField with 20 cols.  Then, I am to create a public method (getter) to retrieve the ISBN entered in the textfied, and store it as a class variable.  It will then call a later method called validatISBN() that accepts and ISBN string and returns a valid ISBN string number.


I have written the following code, but continually get a 'non-static method getText() can not be referenced from a static context' error.

Could someone help get me on the right track here?

        public class ISBNText extends JTextField
    {  
       protected static String bookNum;
       protected JTextField  bookText; 
       public ISBNText() 
       {
           super(20);
           bookText = new JTextField();
       }   
       public String getISBN()
       {           
          String bookNum = ISBNText.getText();
          return bookNum;
       }
       private String validateISBN(String bookNum)

