Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

loading asteroids code into jbuilder

  • 06-02-2004 02:00PM
    #1
    Closed Accounts Posts: 7,132 ✭✭✭


    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, Paid Member Posts: 2,032 ✭✭✭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,132 ✭✭✭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