Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

loading asteroids code into jbuilder

  • 06-02-2004 1:00pm
    #1
    Closed Accounts Posts: 7,134 ✭✭✭


    hi folks

    i got some code which i want to load into jbuilder 9. its from a asteroids game, i cant get a main class loaded. ?

    +-

    here is a snap shot of the files i got in winzip unpacked.

    your help is appreciated!

    Ezza

    :)


Comments

  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Its probably an embedded applet not an application.


  • Registered Users, Registered Users 2 Posts: 2,013 ✭✭✭lynchie


    There is no main method because it is an applet. Look at Sun's website for information on applets.

    You should be able to add your own main method within the code to instanciate the applet and call its init method.


  • Closed Accounts Posts: 7,134 ✭✭✭x in the city


    sorry but ihave no idea how to implement a main method onto an applet,. sound rather too much for me.....!



    can anyone give some basic steps how i could do this?


  • Registered Users, Registered Users 2 Posts: 885 ✭✭✭clearz


    At the beginning of the class if it says extends Applet change it to extends Frame. if it says extends JApplet change it to extends JFrame

    the method called public void init() should be changed to public Asteroids() without the void bit. Inside this method at the end add setSize(500,500); setVisible(true);

    add this method to the class :

    public static void main(String[] args)
    {
    new Asteroids()'
    }


Advertisement