Java Blog

 
 
 
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 to extract a portion of a character string and print the extracted string

  2. Program to declare and initialize Integer variables and print them on the Standard Output Device

  3. Program to show an example of getting at characters in a String

  4. Program in CORBA which takes a long sentence from the client (at least 7 words), passes to the server, server separates out each word

  5. program which takes a long sentence from the client passes to the server,server separates out each word and sends them back to client in reverse order

  6. Program which simulate the dictionary in java

  7. Program to show the use of For Loop

  8. Program to show the use of operator (>>) Shift Right, propagating the sign bit from the left

  9. corba program of client and a DNS server where given a URL the server sends back an IP address

  10. Develop a game application in CORBA for which the player will guess a number between 1 to 100, which will be compared to the random number generated b

  11. Program to make directory

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

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

  14. An applet program that concatenates two string entered in TextField

  15. Program to read the price of an item in decimal form (like 75.95) and print the output in paise (like 7595 paise).

  16. Program to show an example of Arrays of String

  17. Develop a CORBA based application for addition of two complex numbers and displaying the result on client side

  18. An applet program to add two numbers where data is entered in TextField

  19. Program to show the use of Logical or Boolean Negation i.e. NOT (!)

  20. Program to append a StringBuffer by StringBuffer, String objects and other Basic Data Types

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