I’m working on a sample project using a Java applet integration framework. I’ve added the required JAR files to my project but I keep running into compilation errors. Here’s my setup:
CounterAppletInterface.java
@ImplementingClass(com.myproject.impl.CounterAppletImplementation.class)
@Height("80")
@Width("400")
@Archive("AppletFramework.jar,CounterImpl.jar")
@Codebase("components")
public interface CounterAppletInterface extends AppletBase{
public void addOne();
public void subtractOne();
public Object getCounterValue();
}
CounterAppletImplementation.java
public class CounterAppletImplementation extends JApplet implements CounterAppletInterface {
JTextField counterDisplay = new JTextField(20);
String transactionKey = "";
JFileChooser fileSelector = new JFileChooser();
JPanel mainContainer = new JPanel();
FileWriter outputStream = null;
long dataSize = 0l;
@Override
public void init() {
JPanel containerPanel = new JPanel();
counterDisplay = new JTextField(25);
counterDisplay.setHorizontalAlignment(JTextField.CENTER);
counterDisplay.setText("0");
counterDisplay.setEditable(false);
containerPanel.add(new JLabel("Counter value: "));
containerPanel.add(counterDisplay);
containerPanel.setBorder(BorderFactory.createTitledBorder("Simple Counter"));
containerPanel.setBackground(Color.LIGHT_GRAY);
getContentPane().add(containerPanel);
}
public void addOne() {
int value = Integer.parseInt(counterDisplay.getText());
value++;
counterDisplay.setText(value + "");
}
public void subtractOne() {
int value = Integer.parseInt(counterDisplay.getText());
value--;
counterDisplay.setText(value + "");
}
public Object getCounterValue() {
return counterDisplay.getText();
}
}
MainAppPanel.java
private void buildInterface(){
PopupPanel dialogBox = new PopupPanel();
dialogBox.setPopupPosition(300, 300);
dialogBox.setHeight("500px");
dialogBox.setWidth("700px");
final CounterAppletInterface myCounter = (CounterAppletInterface) GWT.create(CounterAppletInterface.class);
VerticalPanel containerPanel = new VerticalPanel();
Button incrementBtn = new Button("Add One");
incrementBtn.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
myCounter.addOne();
}
});
Widget appletComponent = AppletUtility.buildAppletWidget(myCounter);
containerPanel.add(appletComponent);
containerPanel.add(incrementBtn);
dialogBox.add(containerPanel);
dialogBox.show();
}
I’m getting an IncompatibleClassChangeError during compilation. The error seems to be related to the proxy generator expecting a class but finding an interface instead. Has anyone dealt with this type of compatibility issue before? Any suggestions would be helpful.
Check your classpath - this usually means the framework can’t find the implementing class when compiling. Make sure CounterImpl.jar actually has the compiled CounterAppletImplementation class and both JARs are in the right components directory. Also check that your AppletBase interface is available during compilation, not just runtime. I’ve seen this before where the framework tries to create the proxy before dependencies load. Try explicitly importing all framework classes in your implementation file and make sure JAR versions match your compiler target.
This error usually happens when your compilation order is off or the framework tries to process annotations before all dependencies load. Had the same issue with a legacy financial applet system last year. Compile your CounterAppletImplementation class separately first, then package it into CounterImpl.jar before running main compilation. The proxy generator needs actual bytecode when it processes @ImplementingClass, not just source files. Double-check that your @Archive annotation path matches exactly where those JARs live. The framework’s classloader is picky about finding implementing classes at those locations. Try adding the full package path in @Archive: “components/AppletFramework.jar,components/CounterImpl.jar”. Also check if your build tool processes annotations in multiple passes. Maven and some IDEs create timing issues with proxy generation when annotation processing runs before dependency resolution finishes.
ur applet framework’s probably confused about proxy generation. try dropping the @ImplementingClass annotation temporarily - see if that kills the IncompatibleClassChangeError. the GWT compiler gets wonky with mixed interface/class references in applet setups sometimes.
Had this exact nightmare 3 years ago migrating an old applet system. Your proxy generator’s hitting a version mismatch between interface annotations and the actual implementation.
The real issue is your @ImplementingClass annotation - it’s pointing to a class that extends JApplet while your interface extends AppletBase. The framework’s proxy system can’t reconcile this inheritance chain.
Two fixes: make CounterAppletImplementation extend AppletBase directly instead of JApplet, then use composition for JApplet functionality. Or flip it - have your interface extend JApplet instead of AppletBase.
Also do a clean build before recompiling. The proxy generator sometimes caches bad metadata.
If that doesn’t work, check if your AppletFramework.jar version matches what your annotations expect. We’ve seen newer framework versions completely change the proxy generation logic.
You’re wrestling with dead tech. Java applets have been deprecated for years and browser support is basically nonexistent. You’ll keep hitting these compatibility issues.
Drop the applet frameworks and proxy generators. Build it as a modern web app instead. Your counter is simple enough for basic HTML/JS.
I just migrated dozens of applets doing form calculations last month. Used Latenode to connect frontend logic with backend services - no more JVM dependencies or browser headaches.
Your counter widget becomes a simple web interface. Use Latenode for data persistence or API calls. Way cleaner and actually maintainable.