Skip to content
← Back to Community
Using JAVA AWT graphics
Profile icon
technomustang

When introducing methods and method calls, we do a Smiley Face

I would like to figure out how to set up the files to allow code like this to run in Repl

public void smileyFace( Graphics window )
{
window.setColor(Color.WHITE);
window.fillRect(0,0,800,600);

window.setColor(Color.BLUE); window.drawString("SMILEY FACE LAB ", 35, 35 ); window.setColor(Color.YELLOW); window.fillOval(210,100,400,400); window.setColor(Color.GREEN); window.fillOval(275,220,60,40);

}

So far all I have seen is attempts that were unsuccessful. I have heard people have Jframe and GUI working but been unable to find a working example of being able to use the AWT draw and fill commands.

Voters
Profile icon
Jannelcepe
Profile icon
Louden123
Profile icon
Gravelle
Profile icon
MrsTru
Profile icon
HeatherLuman
Profile icon
kwood
Profile icon
x1xxBOBxx1x
Profile icon
technomustang