I’ve been googling all day, just trying to figure out how to show an image. My code is distilled from a dozen diferent web pages, only using things I think I might understand. Obviously, I don’t really understand any of it. How do I make this work?
import java.awt.*;
import java.awt.geom.*;
import java.awt.event.*;
import javax.swing.*;
public class sigil
{
public static void main(String[]args)
{
Frame f = new JFrame("ZV's Sigil");
Jf.addWindowListener(new WindowAdapter()
{public void windowClosing(WindowEvent e){System.exit(0);}});
f.setSize(new Dimension(750,400));
f.setVisible(true);
Graphics2D g = (Graphics2D)f.getGraphics();
drawMyEllipse(g);
}
public static void drawMyEllipse(Graphics2D g)
{
Ellipse2D myEllipse = new Ellipse2D.Double(10.0, 10.0, 200.0, 100.0);
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g.setStroke(new BasicStroke(5));
g.setPaint(Color.white);
g.fill(myEllipse);
g.setPaint(Color.red);
g.draw(myEllipse);
}
}
