Results 1 to 2 of 2
  1. #1
    Javalover14 is offline Member
    Join Date
    Mar 2009
    Rep Power

    Wink JavaLover Terrified

    Assalaam O Alaykym(Peace) to Brothers and Hi to rest!

    My name is ...i would like to make many Java friends of all know me you can add me - my email

    Just started learning Java. Im making an Applet of a calculator. I have to make functions like normal arithmetic, factorial and generating random numbers and Log function. I have to use NetBeans IDE 6, that is what is being taught in University.

    I dont have much time, busy in FYP, otherwise, i would learn from Notepad.

    Can anyone give me some reference of sample code to Calculator JavaApplet?
    Well appreciated!

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Rep Power


    No, but I can give you a couple of suggestion.

    First, use the Matisse form designer to create your user interface. That will save you a ton of time. Look at the code it generates to understand what it is doing.

    Instead of starting with JApplet, start with JFrame. You can turn it into an applet later, and you can run JFrame on your PC without the browser headaches.

    Add a JPanel to the JFrame, and put your components in there. Then, you can just move the JPanel to a JApplet. In fact, you can make the JPanel an external class and use it as a component in both (when you get more experienced).

    Don't add any logic to the GUI. Create a controller to run the application and a model to handle all your calculations. The controller should create the GUI and the model and pass values back and forth between them. Have the controller listen to events generated by the GUI.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts