Uncompilable source code error?

Caporegime
Joined
12 Mar 2004
Posts
29,962
Location
England
This makes no sense,
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code
at Main.main(Main.java:24)
netbeans keeps coming up with this exception despite not showing any errors when editing the code and the code runs without problems when I run it using the command line.

Code:
import javax.swing.*;

public class Main {

    public static void main(String args[]) {
            String message = "";

            message = JOptionPane.showInputDialog(null, "Enter a message");
            Encoder.transformation1(message);
    }
}

Code:
import javax.swing.*;

public class Encoder {
    static int[] numberArray;

    public static void transformation1(String message) {
        char[] charArray = message.toCharArray();
        numberArray = new int[message.length()];

        for(int i = 0; i < message.length(); i++) {
            numberArray[i] = charArray[i];
            JOptionPane.showMessageDialog(null, numberArray[i]);
        }
    }
}
 
Back
Top Bottom