Tutorial by Examples

This is an Example which print rectangle and fill color in the rectangle. https://i.stack.imgur.com/dlC5v.jpg Most methods of the Graphics class can be divided into two basic groups: Draw and fill methods, enabling you to render basic shapes, text, and images Attributes setting methods, whic...
import javax.swing.*; import java.awt.*; public class MyPanel extends JPanel { @Override public void paintComponent(Graphics g){ // clear the previous painting super.paintComponent(g); Graphics2D g2 = (Graphics2D)g; g2.setColor(Co...

Page 1 of 1