/    Sign up×
Community /Pin to ProfileBookmark

Java Project code.Any help is greatly appreciated.

Does any1 know how to draw a circle inside a rectangle.The circle should be a different colour from the rectangle. Also, the word ‘Welcome’ should be neatly inside the circle. Thanks for any help in advance.

to post a comment
Java

2 Comments(s)

Copy linkTweet thisAlerts:
@NokraMay 08.2006 — g.drawCircle(x,x,x,x);

g.setColor(new Color.someColor);
Copy linkTweet thisAlerts:
@agent_x91May 18.2006 — [code=php]
g.setColor(Color.RED); //replace with any colour you want
g.fillOval(x,y,w,h); //replace with dimensions for circle
g.setColor(Color.WHITE); //writing will be in this colour
g.drawString("Welcome",x,y); //replace with dimensions
[/code]


If the drawString parameters are in the wrong order, sorry I haven't use drawString in a while. it's either String,int,int or int,int,String anyway.
×

Success!

Help @gmcvey1 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...