import java.awt.Graphics; import java.awt.Color; import javax.swing.*; public class ruut_funktsioon extends JFrame { Graphics g; public ruut_funktsioon() { g = getGraphics(); g.setColor(Color.blue); } public static void main(String args[]) { JFrame frame = new JFrame("Image Label"); ruut_funktsioon handler = new ruut_funktsioon(); frame.add(handler); frame.setSize(400,400); frame.setLocation(0,0); frame.setVisible(true); } }