code for applet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chetanpatel
    New Member
    • Mar 2008
    • 1

    code for applet

    i want connect client to server,because i want to access database of sever and display information on gadget(i already make some gadget on Vista) using Applet in java,so how can i do this?Please Send me Applet Code for it.
  • Navdip
    New Member
    • Mar 2008
    • 22

    #2
    Originally posted by chetanpatel
    i want connect client to server,because i want to access database of sever and display information on gadget(i already make some gadget on Vista) using Applet in java,so how can i do this?Please Send me Applet Code for it.
    import java.io.*;
    import java.applet.*;
    import java.awt.*;

    public class ap1 extends Applet
    {
    //Applet component declarations...
    TextField t1,t2;
    Label lab1;
    Label lab2;
    Button b1;

    public void init()
    {
    //Intialization of components
    t1=new TextField(8);
    t2=new TextField(8);
    lab1= new Label("first number");
    lab2= new Label("Second number");

    add(lab1);
    add(t1);
    add(lab2);
    add(t2);
    }

    public void paint(Graphics g)
    {
    //things u want to disply in applet area
    int x,y,s=0;

    }
    public Boolean action (Event e1,Object ob1)
    {
    repaint();
    return true;
    }

    }

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by Navdip
      import java.io.*;
      import java.applet.*;
      import java.awt.*;

      public class ap1 extends Applet
      {
      //Applet component declarations...
      TextField t1,t2;
      Label lab1;
      Label lab2;
      Button b1;

      public void init()
      {
      //Intialization of components
      t1=new TextField(8);
      t2=new TextField(8);
      lab1= new Label("first number");
      lab2= new Label("Second number");

      add(lab1);
      add(t1);
      add(lab2);
      add(t2);
      }

      public void paint(Graphics g)
      {
      //things u want to disply in applet area
      int x,y,s=0;

      }
      public Boolean action (Event e1,Object ob1)
      {
      repaint();
      return true;
      }

      }
      1.) Use code tags when posting code.
      2.) Do not attempt to spoonfeed. It is against site rules.

      Comment

      Working...