When I create a Swing GUI class, I can change from one JFrame to the other via a jButton using the following code:
private void btnChangeClassActionPerformed(java.awt.event.ActionEvent evt) {
ClassA ca = new ClassA();
ca.setVisible(true);
this.dispose();
}
But when I create a blank java class (hard coding), this code does not work as the .setVisible(true);
does not work. In fact when I press ctrl + space to bring up suggestions, nothing is listed after ca.
. This only occurs when I try to change jFrames with hard coded applications.
The stacktrace produces this error:
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException:
Uncompilable source code - Erroneous sym type: classPackage.ClassB.setVisible
How can I correct this error?