0

i have one Applet seperately without any main class,now i want to create one java main class(LIKE LOGIN PAGE) from that i want to the call applet

This is Applet main class i want call

public class Appletmain extends Applet
{

    public Appletmain()
    {
        canvas = new Canvas(this);
        option = new Option(this);
        docu = new Docu(this);
        route = new Route();
    }

    public void init()
    {
        setLayout(new BorderLayout(10, 10));
        add("Center", canvas);
        add("North", docu);
        add("East", option);
        add("South", route);
    }

    public Insets insert()
    {
        return new Insets(10, 10, 10, 10);
    }

    public void lock()
    {
        canvas.lock(); 
        option.lock();
    }

    public void unlock()
    {
        canvas.unlock();
        option.unlock();
    }

    Canvas canvas;
    Option option;
    Docu docu;
    Route route;
}

This my java main method

public class main {
    public static void main(String[] args) {
        Appletmain b=new Appletmain();

    }
}
mKorbel
  • 109,525
  • 20
  • 134
  • 319
Ganesh Rengarajan
  • 2,006
  • 13
  • 26
  • While it is possible to embed an applet in an app., it is not recommended. It would be better to convert the applet code to panel code, then add the panel to whatever container (e.g. `JApplet`, `JFrame`, another `JPanel`, `JWindow`..) is needed. – Andrew Thompson Jun 15 '13 at 07:01
  • 1
    Some examples are cited [here](http://stackoverflow.com/q/12449889/230513). – trashgod Jun 15 '13 at 10:19
  • how to convert applet code to panel code help me – Ganesh Rengarajan Jun 15 '13 at 10:27
  • 2
    Tip: Add @trashgod (or whoever - the `@` is important) to notify a person of a new comment. As to how to convert it, start looking over the examples linked in the 2nd comment, and if you fail, post an [SSCCE](http://sscce.org/) of your best effort. – Andrew Thompson Jun 15 '13 at 15:48

0 Answers0