import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
public class GridDrawingApplet extends Applet {
public void paint (Graphics g)
{
// Draw the vertical lines:
g.drawLine (0,0, 0,240);
}
}
public static void main(String []args)
{
// now i want to call the above function here how do i do it ....
// the void paint (Graphics g) function
}
an applet do not require main method
to run your code include the following method
public void init()
{
}
and one comment
//<applet code=GridDrawingApplet height=300 width=300></applet>
and run this code after compiling by writing
appletviewer GridDrawingApplet
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.