Java Swing/AWT (2 Simple questions)
Posted on 2006-06-15
Okay, I have these two source files:
public class SwingApp2
public static void main(String args)
SwingApp2Form Form = new SwingApp2Form("Test Project",280,400);
public class SwingApp2Form extends JFrame
SwingApp2Form(String Title,int Width,int Height)
Container App = getContentPane(); //Get content pane
JPanel DrawPanel = new JPanel()
public void paintComponent(Graphics Draw)
My first question is, why am I using two files for this? From what I read it says I should use a separate class file
for this, I don't understand why since there is very little I can actually change from the main class.. I don't see in
which way this class is reusable, and if not reusable I don't understand the point of separating it.
My second question is, how do I fill the oval so that it is no longer just an outline?