Hi Capp,
I don't really know what you are trying to do but it looks terrible. The first error is easy to fix because "Class" is not a reserved
word in
java but "class" is. If you are coming from a Windows background keep in mind that Java is case sensitive just like UNIX is.
You seem to be creating a customized MenuBar. If that is the case then you can't use setJMenuBar from inside of it. That method is to be used by the JFrame that wants to use your customized MenuBar. That means that in your code the call should be moved to your main method:
myframe.setJMenuBar( new MyBar() );
Another error you have is that you are trying to call your constructor from within an actionPerformed method. In java you can't directly call any constructor you must use the new operator.
This is where I get lost because why would a MenuListener want to keep creating new MenuBars everytime any menu item is chosen?
Regards,
Manfred.