TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
To Change The Font Style And Background, Foreground Color Using Font Class, Color Class In Applet Using Java Program
Senthilvelan Sambamoorthy
Aug 20
2016
Code
7.3
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
colo.rar
import
java.awt.*;
import
java.applet.*;
public
class
colo
extends
Applet
{
Font f1,f2,f3;
public
void
init()
{
f1 =
new
Font(
"Arial"
,Font.BOLD,
18
);
f2 =
new
Font(
"Forte"
,Font.PLAIN,
24
);
f3 =
new
Font(
"Elephant"
,Font.ITALIC,
28
);
}
public
void
paint(Graphics g)
{
setBackground(Color.yellow);
g.setColor(Color.red);
g.drawString(
"Senthil"
,
50
,
50
);
g.setColor(Color.blue);
g.setFont(f1);
g.drawString(
"Velan"
,
50
,
80
);
g.setColor(Color.green);
g.setFont(f2);
g.drawString(
"Vicky"
,
50
,
110
);
g.setColor(Color.magenta);
g.setFont(f3);
g.drawString(
"Vignesh"
,
50
,
140
);
}
}
/* <applet code = "colo.class" height = 500 width =500>
</applet> */
Color Class In Applet Using Java
Java