Program to use control loops in Applets
Here, we have shown four circle one below other using "for" loop with two different colors. The methods used are drawOval( ), fillOval( ) and setColor( ). Details of these methods are given in previous programs.
PROGRAM
OUTPUT
C:\>javac ControlLoopApplet.java
C:\>appletviewer ControlLoopApplet.java
PROGRAM
import java.awt.*;
import java.applet.*;
public class ControlLoopApplet extends Applet
{
public void paint(Graphics g)
{
for(int i=1;i<=4;i++)
{
if(i%2==0)
{
g.fillOval(90,i*50+10,50,50);
g.setColor(Color.black);
}
else
{
g.drawOval(90,i*50+10,50,50);
g.setColor(Color.red);
}
}
}
}
/* <applet code=ControlLoopApplet width=300 height=300>
</applet> */
OUTPUT
C:\>javac ControlLoopApplet.java
C:\>appletviewer ControlLoopApplet.java
I like your post very much. It is very useful for my research. I hope you can share more info about this. Keep posting Mulesoft Developer Certification
ReplyDeleteservicenow developer Certification
Workday training
Workday financial training
Workday HCM Online training
Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website Workday HCM Online Training
ReplyDeletebest Workday HCM Online Training
top Workday HCM Online Training
Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website sap lumira online training
ReplyDeletebest sap lumira online training
top sap lumira online training
Wow, amazing block structure! How long
ReplyDeleteHave you written a blog before? Working on a blog seems easy.
The overview of your website is pretty good, not to mention what it does.
In the content!
Loop Email Crack
Kontakt Crack
Plex Media Server Crack
ManicTime Pro Crack
Samepage Crack
Wow, amazing block structure! How long
ReplyDeleteHave you written a blog before? Working on a blog seems easy.
The overview of your website is pretty good, not to mention what it does.
In the content!
Loop Email Crack
Kontakt Crack
Plex Media Server Crack
ManicTime Pro Crack
Samepage Crack