RayTracerGUI

RayTracerGUI - import import import import import import import javax.swing java.awt javax.imageio.ImageIO java.awt.image java.awt.event java.io

Info iconThis 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();
Background image of page 1

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

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

This note was uploaded on 02/19/2010 for the course CS 390 taught by Professor Hu during the Spring '10 term at Westminster UT.

Page1 / 3

RayTracerGUI - import import import import import import import javax.swing java.awt javax.imageio.ImageIO java.awt.image java.awt.event java.io

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online