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. Program using session tracking capability of Servlets, which displays information of current user session by HttpServletRequest object

  2. Program to show the use of Conditional AND Operator (&&) in If Statements

  3. Program to show an example of searching Strings for subStrings

  4. RMI application for getting the final total price of the shopping list with some of the following items and quantities chosen by the user

  5. Biological Sequence Allignment Using Dynamic Programing

  6. Program to search an element in an array using Linear Search

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

  8. An applet program to draw Polygon Graph with given data

  9. Program to show the use of some Math Methods

  10. File handling program to count number of characters in a file

  11. Program to display triangle of numbers

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

  13. An application that combines several classes and interface

  14. GUI application in java, which enter the details of a student and on the submit display the details of the student

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

  16. File handling program to copy characters from one file to another

  17. Program to display following things on the client machine a)date and time of the server machine b)date and time of the client machine and difference

  18. Program to show an example of creating a class and using its object

  19. Program which simulate the dictionary in java

  20. Program to show an example of Polymorphism

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