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);}
});
}
}
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);}
});
}
}