Title: Java Eclipse - JFrame 2
Description: In this video we continue our discussion of frames. We completed the previous example by adding a panel to the frame. Inside the panel, we draw a string at location (25, 25). Then we move into drawing shapes on the frame. Our example starts with the basics of creating a frame and setting its properties (like size, location, title, and resizable). Then, we create a new component, and add the component on the frame. Within the component, we draw graphics objects. Within a loop we create rectangles and ellipses at different locations on the frame.
Methodology: Good coding standards and object-oriented design.
Technologies: Java, object-oriented programming
Examples constructed: In the first part of this video, we continued the previous example by creating a JPanel. We draw a string on the panel and added the panel to the frame. In the second part, we started the process of drawing objects onto the frame. We show how to draw ellipses and rectangles.
Keywords: class, JFrame, EventQueue, Runnable, Dimension, Toolkit, main, EXIT_ON_CLOSE, JComponent, paintComponent, Graphics, drawString.