I'm trying to create an example window with Eclipse WindowBuilder. The code is the following:
import javax.swing.JFrame;
import javax.swing.JLabel;
//import statements
//Check if window closes automatically. Otherwise add suitable code
public class HelloWorldFrame extends JFrame {
public static void main(String args[]) {
new HelloWorldFrame();
}
HelloWorldFrame() {
JLabel jlbHelloWorld = new JLabel("Hello World");
add(jlbHelloWorld);
this.setSize(100, 100);
// pack();
setVisible(true);
}
}
As I understand, running this code should display a window. Nevertheless, it shows the following error:
Error: Could not find or load main class HelloWorldFrame
Is there anything that should be configured before running the code? I'm using the execution environment JavaSE-1.7 and Eclipse Mars.1 Release (4.5.1) on Ubuntu 64-bits.
--------------------------------------------------------------------------------------------------------------------------------
Update 1
In my Package Explorer I have the following:
I have checked that the runtime classpath is the same:
Is there anything which is still misconfigurated?