Forum     

Go Back   Digit Technology Discussion Forum > Portables, Peripherals and Electronics > QnA (read only)
Register FAQ Calendar Mark Forums Read

QnA (read only) Mods please help transfer the contents of this forum to proper sections. :)


 
 
LinkBack Thread Tools Search this Thread Display Modes
Old 24-10-2007, 04:01 AM   #1 (permalink)
Beware of the innocent
 
ilugd's Avatar
 
Join Date: Dec 2005
Posts: 1,024
Default java program not working in eclipse


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);}
});
}
}
__________________
Life is too short. Have fun.
ilugd is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 27-10-2007, 10:44 PM   #2 (permalink)
Beware of the innocent
 
ilugd's Avatar
 
Join Date: Dec 2005
Posts: 1,024
Default Re: java program not working in eclipse

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?
__________________
Life is too short. Have fun.
ilugd is offline  
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java programming..how can I distribute java program....? Manojap Programming 5 16-05-2009 02:46 PM
Eclipse not working in centos ilugd Open Source 3 22-10-2007 09:41 AM
Eclipse & Opera Complaining about Java-Eclipse fails to load unni Open Source 8 03-12-2006 09:04 PM
please help in java program shivi4 QnA (read only) 10 24-08-2005 06:56 PM
Eclipse-Java IDE Manojap QnA (read only) 2 18-10-2004 01:30 PM

 
Latest Threads
- by clmlbx
- by tkin

Advertisement




All times are GMT +5.5. The time now is 05:32 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2