Skip to main content
Hide Sidebar
Show Sidebar
<Progzoo Sections>
ProgZoo
Tutorials
How to...
Assessments
Help
<Other>
To do list
Recent changes
Random page
Personal
Log in / create account
Views
Page
Discussion
View source
History
Toolbox
What links here
Related changes
Special pages
Printable version
Tutorials
SET07102
Guides
Log in
Java
C#
C++
Perl
PHP
Python
Ruby
VB
Drawing Dice Tutorial
From Progzoo
Flags Tutorials
Rectangles
Lines
Polygons
Stars
Repeats
Hard Problems
Dice
Contents
1
One
2
Two
3
Three
4
Four
5
Five
6
Six
One
The square is 32 by 32
The dot has radius 4
.
static void drawFlag(Graphics2D g){ g.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); int w=32;int h=32; g.setColor(new Color(128,128,128)); g.fillRect(0,0,w,h); g.setColor(new Color(255,64,64)); int r = 4; g.setColor(Color.red); g.fillOval(w/2-r,h/2-r,2*r,2*r); g.setColor(Color.black); g.drawOval(w/2-r,h/2-r,2*r,2*r); }
[
Font
] [
Default
] [
Show
] [
Resize
] [
History
] [
Profile
]
test text
Two
.
static void drawFlag(Graphics2D g){ g.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); int w=32;int h=32; g.setColor(new Color(128,128,128)); g.fillRect(0,0,w,h); int r = 4; g.setColor(Color.red); g.fillOval(w/4-r,h/4-r,2*r,2*r); g.setColor(Color.black); g.drawOval(w/4-r,h/4-r,2*r,2*r); }
[
Font
] [
Default
] [
Show
] [
Resize
] [
History
] [
Profile
]
test text
Three
.
static void drawFlag(Graphics2D g){ g.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); int w=32;int h=32; g.setColor(new Color(128,128,128)); g.fillRect(0,0,w,h); int r = 4; g.setColor(Color.red); g.fillOval(w/4-r,h/4-r,2*r,2*r); g.setColor(Color.black); g.drawOval(w/4-r,h/4-r,2*r,2*r); }
[
Font
] [
Default
] [
Show
] [
Resize
] [
History
] [
Profile
]
test text
Four
.
static void drawFlag(Graphics2D g){ g.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); int w=32;int h=32; g.setColor(new Color(128,128,128)); g.fillRect(0,0,w,h); int r = 4; g.setColor(Color.red); g.fillOval(w/4-r,h/4-r,2*r,2*r); g.setColor(Color.black); g.drawOval(w/4-r,h/4-r,2*r,2*r); }
[
Font
] [
Default
] [
Show
] [
Resize
] [
History
] [
Profile
]
test text
Five
.
static void drawFlag(Graphics2D g){ g.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); int w=32;int h=32; g.setColor(new Color(128,128,128)); g.fillRect(0,0,w,h); int r = 4; g.setColor(Color.red); g.fillOval(w/4-r,h/4-r,2*r,2*r); g.setColor(Color.black); g.drawOval(w/4-r,h/4-r,2*r,2*r); }
[
Font
] [
Default
] [
Show
] [
Resize
] [
History
] [
Profile
]
test text
Six
.
static void drawFlag(Graphics2D g){ g.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); int w=32;int h=32; g.setColor(new Color(128,128,128)); g.fillRect(0,0,w,h); int r = 4; g.setColor(Color.red); g.fillOval(w/4-r,h/4-r,2*r,2*r); g.setColor(Color.black); g.drawOval(w/4-r,h/4-r,2*r,2*r); }
[
Font
] [
Default
] [
Show
] [
Resize
] [
History
] [
Profile
]
test text
Categories
:
Tutorial
Graphics