Skip to content
Advertisement

Tag: class

Problem with Inner Class. Illegal Start of Expression error

I am practicing using inner classes but am having difficulty with a homework question: It is as follows: Create a Swing component class BetterButtons that extends JPanel and has three Jbutton instances labelled “One”, “Two”, and “Three”. In the constructor of BetterButtons, write a local class ButtonListener that implements ActionListener. This local class has a field String name and a

.class vs .java

What’s the difference between a .class file and a .java file? I am trying to get my applet to work but currently I can only run it in Eclipse, I can’t yet embed in HTML. Thanks **Edit: How to compile with JVM then? Answer A .class file is a compiled .java file. .java is all text and is human readable.

Advertisement