Java Tutorial

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

public class LineRect extends Applet
{
      public void paint(Graphics g)
      {
           g.drawLine(10,10,50,50);
           g.drawRect(10,60,40,30);
              g.setColor(Color.blue);
           g.fillRect(60,10,30,80);
              g.setColor(Color.green);
           g.drawRoundRect(10,100,80,50,10,10);
           g.setColor(Color.yellow);
           g.fillRoundRect(20,110,60,30,5,5);
           g.setColor(Color.red);
           g.drawLine(100,10,230,140);
           g.drawLine(100,140,230,10);
           g.drawString(\"Line Rectangles Demo\",65,180);
           g.drawOval(230,10,200,150);
           g.setColor(Color.blue);
           g.fillOval(245,25,100,100);
      }
};

    Related Post:
  1. CORBA based application for addition of two mathematical expressions of the form (ax + by) and displaying the result on client side

  2. File handling program to copy bytes from one file to another

  3. Even number ,Prime no. ,Factorial of a number

  4. Program to change characters in a StringBuffer objects and to reverse its contents

  5. Program to show the use of For Loop

  6. 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

  7. CORBA program for displaying the date and time of the server machine, client machine and the difference between these two date and time

  8. Program of an applet to illustrate BarChart

  9. Program to show the use of If-Else Statement

  10. Program to show the use of Conditional OR Operator (||) in If Statements

  11. Program of concatenating and Buffering files

  12. Program to show an example of extraction of characters from a StringBuffer objects

  13. Do the following for the Array Insert the element in the array,delete an element from the array,search for a particular element Create multiple thread

  14. Program to show the use of operator (<<) Shift Left filling with zero from the right

  15. An applet program to perform merge sort

  16. Program to show the use of Bitwise Operator (|) OR

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

  18. Program to compare Strings by compring successive corresponding characters, starting with the first character in each String

  19. Socket program of HTTP Server

  20. Program of inventory management and demonstrating interactive input and output

 
 
Didn't find what you were looking for? Find more on An applet program to draw different shapes