Computer problems,Computer help
*AX SOFT>>>Programming & Design

Whats the code for making a java applet (picture) which uses: a semi-oval, oval, circle, rectangle, and line?


It can be a car, house, or anything else.

I use jcreator to compile the files. I need a code please.

There are a number of ways to accomplish this. The solution depends on if you're wanting to use AWT, Graphics2D, JFC Swing, or even a non-standard library.

The shortest number of code lines would be using the AWT Graphics context but superior results are achieved via Graphics2D. We'll assume an AWT applet below:

import java.awt.*;
import java.applet.*;
public class graphicsApplet extends Applet {
public void paint(Graphics g) {
g.setColor(Color.black);
g.drawRect(92, 13, 20, 76); // draw Rectangle
g.drawOval(100,100,40,40); // draw Circle
g.drawOval(100,100,30,20); // draw Oval
g.drawArc(30,140,40,20,0,180); // draw Semi-Oval
g.drawLine(23, 20, 66, 20); // draw Horizontal Line
} }

Good luck with your homework assignment...

Tags
  General - Computers & Internet   Software   Security   Programming & Design   Facebook   Flickr   Google   MSN   MySpace
Related information
  • Image storage?

    I dont know in coldFusion but in i know in PHP. Just save image location in your server to Mysql. For example i have me.jpg, in my localhost field "location" and the value is c://windows/...

  • Need help with designing a flash website, anyone up for it?

    You can post your project requirement at freelance website like ...

  • Can i extract the code of a program even if it is in the .exe form?? if yes then how can i do it??

    Yes you can... You can extract the code from the executable files or binary files by using programs called decompilers... They do the reverse job of Compilers... Ofcourse most of the readabi...

  • Can i extract the code of a program in vb6 even if it is in the .exe form?? if yes then how can i do it??

    The code in the exe isn't VB, it's machine code. You can extract the assembly version of the machine code by using a disassembler, but it won't do you any good unless you understand...

  • Running JAVA games on computer!?

    have a look at these search results ...

  • Can any one tell me how I can do a program for my dental clinic database?

    i dont think you are a programmer. If not, please dont try it. Out source your work to some offshore programmer in india. you will get high quality software in low price. I am asoftware developer. ...

  • What are the Active directory componente?

    I am not sure what you mean by components but active directory is Microsoft proprietary and runs on DNS. It stores network information. You can also access the directory and manipulate network re...

  • Background... help?

    Here is the link: ...

  •  

    Categories--Copyright/IP Policy--Contact Webmaster