Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java GUI
|
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 14th, 2007, 01:49 AM
Authorized User
 
Join Date: May 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Applet Drawing oval inside rectangle

hi there..im really battlin gwith this question..if any one could pleqse help me..thanx:(


Class Graphics contains method drawOval, wich takes as arguments the sam e four arguments as method drawRect. The arguments for method drawOval specify the “bounding box for the oval-the sides of the bounding box are the boundaries of the oval. Write a java applet that draws an oval and a rectangle with the same four arguments. The oval will touch the rectangle at the centre of each side.

 
Old June 14th, 2007, 07:09 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

Try the following code

Code:
import java.awt.Graphics;

import javax.swing.JApplet;

public class Test extends JApplet{
    public void paint(Graphics g){
        g.drawOval(10, 10, 100, 100);
        g.drawRect(10, 10, 100, 100);
    }
}
Regards,
Rakesh
 
Old June 22nd, 2007, 02:47 PM
Registered User
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

was wondering what the full program of this was.. it has no main class?






Similar Threads
Thread Thread Starter Forum Replies Last Post
client Rectangle angelboy C# 2005 0 July 27th, 2007 08:13 AM
Filling a Oval in a Excel Cell with Color sinajs Excel VBA 0 January 22nd, 2007 01:47 PM
setting codebase for applet inside jsp file picky Java Basics 0 December 12th, 2006 08:12 AM
highlighting a rectangle area galatea C# 2 February 10th, 2005 06:20 AM
Dragging a rectangle Dhodie Pro VB 6 0 February 20th, 2004 04:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.