Something
public text v1 · immutableimport java.awt.Graphics;
import javax.swing.JComponent;
import javax.swing.JFrame;
public class Test extends JComponent
{
int width, height;
public Test()
{
width = 100;
height = 100;
JFrame f = new JFrame("Memory");
f.setDefaultCloseOperation(f.EXIT_ON_CLOSE);
f.setVisible( true );
f.setSize(width,height);
f.add(this);
}
public void paint(Graphics g)
{
g.drawRect(0, 0, width, height);
}
public static void main(String[] args)
{
Test test = new Test();
}
}