Results 1 to 3 of 3
  1. #1
    zlloyd1 is offline Member
    Join Date
    Nov 2012
    Posts
    57
    Rep Power
    0

    Angry Class, interface, or enum expected??

    The following code is throwing back an annoying error at me that I thought I knew what it meant, but I am lost on this....
    Java Code:
    package zlloyd1;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public static void class NewClass{ //Class, interface or enum expected right here????
                 private JFrame f = new JFrame();
                 private JTextField t1 = new JTextField(24);
                 private JTextField t2 = new JTextField(24);
                 private JTextArea t3 = new JTextArea(8, 16);
                 private JButton b1 = new JButton("Write");
                 private JButton b2 = new JButton("Read");
                 private JButton b3 = new JButton("Clear");
                 private JButton b4 = new JButton("Exit");
                 static String one;
                 public NewClass(){
                 f.add(new JLabel("Input"));
                 f.add(t1);
                 f.add(new JLabel("input2"));
                 f.add(t2);
                 f.add(new JLabel("Readout"));
                 f.add(t3);             
                 //b1.addActionListener(this);
                 f.add(b1);
                 //b2.addActionListener(this);
                 f.add(b2);
                 //b3.addActionListener(this);
                 f.add(b3);
                 //b4.addActionListener(new ActionListener());
                 f.add(b4);
                 f.setTitle("Input / Output Script");
                 f.setLocationRelativeTo(null);                       
                 f.setSize(240, 240);
                 f.setVisible(true);
                                                      }
                 public static void main(String[] args){
                            new NewClass();  
                 } 
        public void actionPerformed(ActionEvent ae) {
            throw new UnsupportedOperationException("Not supported yet.");
        }
    }
    Please tell me what is happening here!!!!

  2. #2
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    787
    Rep Power
    5

    Default Re: Class, interface, or enum expected??


  3. #3
    zlloyd1 is offline Member
    Join Date
    Nov 2012
    Posts
    57
    Rep Power
    0

    Thumbs up Re: Class, interface, or enum expected??

    Quote Originally Posted by eRaaaa View Post
    I am assuming that you mean in the initial class declaration right?? public static void class NewClass{ I will set this to just public class NewClass, and see if that solves this, thanks!!

Similar Threads

  1. Replies: 3
    Last Post: 01-20-2013, 08:06 PM
  2. class, interface, or enum expected
    By CrazyTofu999 in forum New To Java
    Replies: 4
    Last Post: 01-12-2013, 08:31 PM
  3. Class Interface or enum expected
    By ankiit in forum New To Java
    Replies: 9
    Last Post: 12-22-2011, 09:10 AM
  4. Replies: 2
    Last Post: 10-02-2010, 02:13 AM
  5. class, interface or enum expected?
    By Addez in forum New To Java
    Replies: 2
    Last Post: 08-26-2009, 07:54 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •