Java Tutorial

 
 
 
 
/* <applet code=\"MaxOf3No\" height=150 width=400>
   </applet> */

import java.awt.*;
import java.applet.*;

public class MaxOf3No extends Applet
{
     TextField T1,T2,T3;

      public void init(){
          T1 = new TextField(10);
          T2 = new TextField(10);
          T3 = new TextField(10);

          add(T1);
          add(T2);
          add(T3);

          T1.setText(\"0\");
          T2.setText(\"0\");
          T3.setText(\"0\");
        }

        public void paint(Graphics g){
             int a, b, c,result;
             String str;

             g.drawString(\"Enter value to Check the Maximum of 3 \",10,50);

             str=T1.getText();
             a=Integer.parseInt(str);
             str=T2.getText();
             b=Integer.parseInt(str);
             str=T3.getText();
             c=Integer.parseInt(str);

              g.setColor(Color.blue);
              if (a>b) {
                  if (a>c)
                      result=a;
                  else
                      result=c;
                }
            else{
                  if (b>c) 
                      result=b;
                  else
                      result=c;
              }
              g.drawString(\"Maximnum of 3 No is \"+result,10,70);
              showStatus(\"MAXIMUM OF 3 NUMBERS\");
            }

            public boolean action(Event e, Object o){
                  repaint();
                  return true;
            }
}

    Related Post:
  1. Pass the marks of 10 students from the client side design a servlet, which takes these marks and returns the number of students who obtained first cls

  2. Dialog Boxes

  3. Program that enabled applet that takes name of the user. Server returns back the number in uppercase clubbed with “HELLO” and display it on applet

  4. Program to show an example of modifying String objects

  5. Program that maintains employee database of an education system

  6. Program to read command line arguments

  7. File handling program to display directory contents

  8. Program to print triangle of numbers

  9. An applet program to display moving banner

  10. Program that will read real number from the keyboard and print the following output in one line: small Integer not less The Given Number Largest Int

  11. Program of linear search

  12. File Handling- JAVA

  13. Program to show the use of Nested Loops

  14. Program to show an example of Multiple Levels of Inheritance

  15. Program to show insertion of StringBuffer, String objects and other Basic Data Types into a StringBuffer object

  16. Program to show an example of using multiple classes in a program

  17. Program to show an example of creating a String object from a StringBuffer Object

  18. Program to find the number of and sum of all integers greater than 100 and less than 200 that are divisible by 7

  19. RMI based application, which reads a file with list of marks of student from a client, send it to server and find how many students having distinct

  20. Program of storing and retrieving integers using data streams on a single file

 
 
Didn't find what you were looking for? Find more on An applet program to find maximum of three numbers using textField