0

this is the source code http://www.bennychow.com/download/pacman_eclipse_project.zip
works as an applet
but I want to create tests (its due tomorrow :/) for this app and in order to do that I need to run it as an application
so I created a main method:

public static void main(String[] args) {
			PacMan pacMan = new PacMan();
			pacMan.init();
			pacMan.start();
			JFrame window = new JFrame("Sample Applet and Application");
	        window.setContentPane(pacMan);
	        window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	        window.pack();              // Arrange the components.
	        //System.out.println(theApplet.getSize());
	        window.setVisible(true);    // Make the window visible.
		}

but with this main method i get exceptions that i didnt get when i was running it as an applet any ideas what I need to do in order to solve this?

thanks to all helpers.

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by james chaco
0

to accomplish your task instead of extending your class to Applet go for Frame(in PackMan.java)....
this will do .....

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.