AWT Graphics in Java

The Graphics class is the abstract super class for all graphics contexts which allow an application to draw onto components that can be realized on various devices, or onto off-screen images as well.AWT Graphics in Java

Java Draw Circles Graphics Applets

No special or predefined method exists with Graphics class to draw circles. But still, circles can be drawn in three styles using other methods. Using drawRoundRect() Using drawOval() – most preferred Using drawArc() All the earlier programs like drawing rectangles are illustrated with Frame. Now let us go for applet. Applet includes init(), start() and …

Java Draw Circles Graphics Applets Read More »

Java Draw 3 D Rectangles

Drawing Rectangles Java graphics supports 3 types drawing rectangles. Right-angled rectangles Round-cornered rectangles 3-D Rectangles Java requires width and height of the rectangle and x and y coordinates where rectangle is be drawn. Java does not include a special method, something like drawSquare(), to draw a square. Square can be drawn with rectangle method only …

Java Draw 3 D Rectangles Read More »

Java Drawing Arrays Graphics

Java Drawing Arrays Graphics Summary: By the end of this tutorial "Java Drawing Arrays Graphics", you will be comfortable in drawing arrays with graphics. Apart other graphics, Java also supports drawing characters from character and byte arrays. Java comes with an option of drawing complete array or part of the array. Supporting methods from java.awt.Graphics …

Java Drawing Arrays Graphics Read More »

Java Drawing Strings Colors Fonts

Java Drawing Strings Colors Fonts Summary: By the end of this tutorial "Java Drawing Strings Colors Fonts", you will come to know to draw strings in different colors and fonts in graphics. In the "Drawing Strings" program, the strings are drawn in default black color and with font Dialog. Now, let us redraw the strings …

Java Drawing Strings Colors Fonts Read More »