Computer Science, asked by aryapooja301, 1 month ago

write a java program to draw an oval and rectangle. Display the title as shaped . use font name,font size of your choice

please its urgents please​

Answers

Answered by Anukrati12
2

Answer:

OVAL

// java program to draw a ellipse

// using drawOval function.

import java.awt.*;

import javax.swing.*;

  

public class ellipse extends JApplet {

      public void init()

    {

        // set size

        setSize(400, 400);

        repaint();

    }

    // paint the applet

    public void paint(Graphics g)

    {

        // set Color for rectangle

        g.setColor(Color.red);

         // draw a ellipse

        g.drawOval(100, 100, 150, 100)

    

_____________________________________________________________

RECTANGLE

// Java Program to  Draw a rectangle

// Java Program to  Draw a rectangle// using drawRect(int x, int y, int width, int height)

// Java Program to  Draw a rectangle// using drawRect(int x, int y, int width, int height)import java.awt.*;

// Java Program to  Draw a rectangle// using drawRect(int x, int y, int width, int height)import java.awt.*;import javax.swing.*;

// Java Program to  Draw a rectangle// using drawRect(int x, int y, int width, int height)import java.awt.*;import javax.swing.*;public class rectangle extends JApplet {

// Java Program to  Draw a rectangle// using drawRect(int x, int y, int width, int height)import java.awt.*;import javax.swing.*;public class rectangle extends JApplet {      public void init()

// Java Program to  Draw a rectangle// using drawRect(int x, int y, int width, int height)import java.awt.*;import javax.swing.*;public class rectangle extends JApplet {      public void init()    {

// Java Program to  Draw a rectangle// using drawRect(int x, int y, int width, int height)import java.awt.*;import javax.swing.*;public class rectangle extends JApplet {      public void init()    {        // set size

// Java Program to  Draw a rectangle// using drawRect(int x, int y, int width, int height)import java.awt.*;import javax.swing.*;public class rectangle extends JApplet {      public void init()    {        // set size        setSize(400, 400);

// Java Program to  Draw a rectangle// using drawRect(int x, int y, int width, int height)import java.awt.*;import javax.swing.*;public class rectangle extends JApplet {      public void init()    {        // set size        setSize(400, 400);          repaint();

// Java Program to  Draw a rectangle// using drawRect(int x, int y, int width, int height)import java.awt.*;import javax.swing.*;public class rectangle extends JApplet {      public void init()    {        // set size        setSize(400, 400);          repaint();    }

// Java Program to  Draw a rectangle// using drawRect(int x, int y, int width, int height)import java.awt.*;import javax.swing.*;public class rectangle extends JApplet {      public void init()    {        // set size        setSize(400, 400);          repaint();    }    // paint the applet

// Java Program to  Draw a rectangle// using drawRect(int x, int y, int width, int height)import java.awt.*;import javax.swing.*;public class rectangle extends JApplet {      public void init()    {        // set size        setSize(400, 400);          repaint();    }    // paint the applet    public void paint(Graphics g)

// Java Program to  Draw a rectangle// using drawRect(int x, int y, int width, int height)import java.awt.*;import javax.swing.*;public class rectangle extends JApplet {      public void init()    {        // set size        setSize(400, 400);          repaint();    }    // paint the applet    public void paint(Graphics g)    {

// Java Program to  Draw a rectangle// using drawRect(int x, int y, int width, int height)import java.awt.*;import javax.swing.*;public class rectangle extends JApplet {      public void init()    {        // set size        setSize(400, 400);          repaint();    }    // paint the applet    public void paint(Graphics g)    {        // set Color for rectangle

// Java Program to  Draw a rectangle// using drawRect(int x, int y, int width, int height)import java.awt.*;import javax.swing.*;public class rectangle extends JApplet {      public void init()    {        // set size        setSize(400, 400);          repaint();    }    // paint the applet    public void paint(Graphics g)    {        // set Color for rectangle        g.setColor(Color.red);

// Java Program to  Draw a rectangle// using drawRect(int x, int y, int width, int height)import java.awt.*;import javax.swing.*;public class rectangle extends JApplet {      public void init()    {        // set size        setSize(400, 400);          repaint();    }    // paint the applet    public void paint(Graphics g)    {        // set Color for rectangle        g.setColor(Color.red);          // draw a rectangle

// Java Program to  Draw a rectangle// using drawRect(int x, int y, int width, int height)import java.awt.*;import javax.swing.*;public class rectangle extends JApplet {      public void init()    {        // set size        setSize(400, 400);          repaint();    }    // paint the applet    public void paint(Graphics g)    {        // set Color for rectangle        g.setColor(Color.red);          // draw a rectangle        g.drawRect(100, 100, 200, 200);

// Java Program to  Draw a rectangle// using drawRect(int x, int y, int width, int height)import java.awt.*;import javax.swing.*;public class rectangle extends JApplet {      public void init()    {        // set size        setSize(400, 400);          repaint();    }    // paint the applet    public void paint(Graphics g)    {        // set Color for rectangle        g.setColor(Color.red);          // draw a rectangle        g.drawRect(100, 100, 200, 200);    

Similar questions