I used these two links for reference:
http://www.tech-recipes.com/java_pro..._tips1265.html
http://forum.java.sun.com/thread.jsp...rt=15&tstart=0
Here is my situation: trying to turn a 3000 line main class into an applet, or create an applet that calls it. whatever works.
in a nut shell, here is the structure:
Expand|Select|Wrap|Line Numbers
- import javax.swing.*;
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.border.*;
- import java.applet.*;
- public class project4 extends JFrame implements ActionListener, ItemListener{
- /**bunch of static elements and data types*/
- public project4() { /**stipulating variables - panel/card layout*/ }
- /** Main method */
- public static void main(String[] args) {
- project4 frame = new project4();
- frame.setSize(800, 700);
- frame.setLocation(100,60);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setTitle("Project Video");
- frame.setVisible(true);
- }
- /**handle button action*/
- public void actionPerform (ActionEvent e){}
- public void itemStateChanged (ItemEvent e){}
- /**various class void and string methods (11 or so) like:*/
- public void addVideoGameItems () {}
- public String gameRentalDescriptionMethod () {}
- }// end project4
Expand|Select|Wrap|Line Numbers
- import javax.swing.*;
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.border.*;
- import java.applet.*;
- public class applet extends JApplet{
- public static class project4 extends JFrame implements ActionListener, ItemListener{
- /**bunch of non-static private elements and data types*/
- public project4() { /**stipulating variables - panel/card layout*/ }
- /**handle button action*/
- public void actionPerform (ActionEvent e){}
- public void itemStateChanged (ItemEvent e){}
- /**various class void and string methods (11 or so) like:*/
- public void addVideoGameItems () {}
- public String gameRentalDescriptionMethod () {}
- }// end project4
- public void init() {
- System.out.println("Applet initializing");
- project4test d = new project4test();
- getContentPane().add(d);
- }
- /** Main method */
- public static void main(String[] args) {
- project4test frame = new project4test();
- frame.setSize(800, 700);
- frame.setLocation(100,60);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setTitle("Project Video");
- frame.setVisible(true);
- applet a = new applet();
- a.init();
- frame.getContentPane().add(a);
- }
- }//end applet class
thanks very much.
J