{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

RayTracerGUI - import import import import import import...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
import javax.swing.*; import java.awt.*; // import javax.imageio.ImageIO; // import java.awt.image.*; // import java.awt.event.*; // import java.io.*; import raytracer.world.World; public class RayTracerGUI extends JPanel implements Runnable { private static final long serialVersionUID = 1L; private Image screen; private static JFrame frame; private int width, height; private boolean finished = false; private World world; private Thread raytracer; public RayTracerGUI () { world = new World(); int[] dimensions = world.build(); width = dimensions[0]; height = dimensions[1]; frame = new JFrame("Java Ray Tracer"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setResizable(false); // frame.setJMenuBar(createMenu()); Container pane = frame.getContentPane(); pane.add(BorderLayout.CENTER, this); frame.setSize(width,height); // initialize the off-screen rendering buffer screen = frame.createImage(width, height); frame.setVisible(true); raytracer = new Thread(this); raytracer.start(); } /* // from http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html private JMenuBar createMenu() { //Create the menu bar.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}