java program not working in eclipse

Status
Not open for further replies.

ilugd

Beware of the innocent
For those who were involved in this issues, thanks. I got eclipse to work with sun java jre finally. But eclipse still doesnot work with local user. I am still working on that.
However I made a program in java since i am just learning. There are three files.
justawindow.java
mywindow.java
mycanvas.java

the program doesn't run, i mean i don't get any errors in eclipse, just some warnings on serialization, but basically it should work. No errors at all, but now window opens. What am i doing wrong?

Here is the code.
----------------------------------------
import java.awt.*;
public class justawindow{

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
new mywindow();
}

}
--------------------------------------------------------------------------------
import java.awt.*;


public class mycanvas extends Canvas {
public void paint(Graphics g){
g.drawString("Helloworld!",100,100);
}
}
-------------------------------------------------------------------------------------
import java.awt.*;
import java.awt.event.*;


public class mywindow extends Frame {
mywindow(){
add("Center", new mycanvas());
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e)
{System.exit(0);}
});
}
}
 
OP
ilugd

ilugd

Beware of the innocent
i just saw the programming section. How do i move this to the programming section? and please could someone help me out in this by copying and making the necessary java files, compiling and letting me know if this is a prob with my eclipse installation or with my code?
Please?
 
Status
Not open for further replies.
Top Bottom