java calc

Discussion in 'Java' started by Pradyut Bhattacharya, Nov 11, 2006.

  1. Hi,
    A java calculator
    a jar file in dist_calc.zip
    double click in windows, or run java -jar javaapplication7.jar
    source files in javaapplication7.zip, unzipped will open as a netbeans
    directory

    Files here at: -
    http://myjavaserver.com/~pradyut/files/java_calc/

    reply ur comments n suggestions

    --
    Pradyut
    http://pradyut.tk
    http://oop-edge.blogspot.com/
    http://pradyutb.blogspot.com/
    http://praddy-photos.blogspot.com/
    http://oop-edge.spaces.live.com/
    http://www.flickr.com/photos/praddy
    http://groups.google.com/group/oop_programming
    India
    Pradyut Bhattacharya, Nov 11, 2006
    #1
    1. Advertising

  2. Pradyut Bhattacharya writes:

    > java -jar javaapplication7.jar


    I clicked ">" and following happened...

    $ java -jar JavaApplication7.jar
    Exception in thread "AWT-EventQueue-0" java.util.NoSuchElementException
    at java.util.Vector.lastElement(Vector.java:461)
    at javaapplication7.NewJFrame.jButton2MouseClicked(NewJFrame.java:141)
    at javaapplication7.NewJFrame.access$500(NewJFrame.java:16)
    at javaapplication7.NewJFrame$6.mouseClicked(NewJFrame.java:82)
    at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:212)
    at java.awt.Component.processMouseEvent(Component.java:5491)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
    at java.awt.Component.processEvent(Component.java:5253)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3901)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Window.dispatchEventImpl(Window.java:1778)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

    --
    -- Jhair
    Jhair Tocancipa Triana, Nov 12, 2006
    #2
    1. Advertising

  3. Pradyut Bhattacharya

    Pradyut Guest

    Jhair Tocancipa Triana wrote:
    > Pradyut Bhattacharya writes:
    >
    > > java -jar javaapplication7.jar

    >
    > I clicked ">" and following happened...
    >


    upgrade to the latest jre... then try

    > $ java -jar JavaApplication7.jar
    > Exception in thread "AWT-EventQueue-0" java.util.NoSuchElementException
    > at java.util.Vector.lastElement(Vector.java:461)
    > at javaapplication7.NewJFrame.jButton2MouseClicked(NewJFrame.java:141)
    > at javaapplication7.NewJFrame.access$500(NewJFrame.java:16)
    > at javaapplication7.NewJFrame$6.mouseClicked(NewJFrame.java:82)
    > at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:212)
    > at java.awt.Component.processMouseEvent(Component.java:5491)
    > at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
    > at java.awt.Component.processEvent(Component.java:5253)
    > at java.awt.Container.processEvent(Container.java:1966)
    > at java.awt.Component.dispatchEventImpl(Component.java:3955)
    > at java.awt.Container.dispatchEventImpl(Container.java:2024)
    > at java.awt.Component.dispatchEvent(Component.java:3803)
    > at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    > at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3901)
    > at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    > at java.awt.Container.dispatchEventImpl(Container.java:2010)
    > at java.awt.Window.dispatchEventImpl(Window.java:1778)
    > at java.awt.Component.dispatchEvent(Component.java:3803)
    > at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    > at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    > at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    > at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    > at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    > at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    >
    > --
    > -- Jhair
    Pradyut, Nov 13, 2006
    #3
  4. Pradyut wrote:
    > Jhair Tocancipa Triana wrote:
    > > Pradyut Bhattacharya writes:
    > >
    > > > java -jar javaapplication7.jar

    > >
    > > I clicked ">" and following happened...

    >
    > upgrade to the latest jre... then try


    I took one look at your original link and thought
    'should suggest web-start' before surfing straight
    out of there.

    Now that you are making suggestions to your
    potential end-users, and the people who were kind
    enough to actually download and try the application
    (of which, I wasn't), I will suggest..

    'web-start'
    - could forewarn the end user the minimum Java version
    required (and prompt for download).
    - sandbox this calculator (so it cannot do anything
    harmful to the user's computer).

    But while we are on the subject of minimum Java version,
    a quick perusal of your GUI* did not suggest it requires
    a high level of Java (I would guess Java 1.2) - what is in
    your code that sets the minimum Java version? Generics?

    * http://myjavaserver.com/~pradyut/files/java_calc/java_calc.JPG
    BTW - the screenshot was a nice touch - good work.

    Andrew T.
    Andrew Thompson, Nov 13, 2006
    #4
  5. Pradyut Bhattacharya

    Pradyut Guest

    Andrew Thompson wrote:
    > Pradyut wrote:
    > > Jhair Tocancipa Triana wrote:
    > > > Pradyut Bhattacharya writes:
    > > >
    > > > > java -jar javaapplication7.jar
    > > >
    > > > I clicked ">" and following happened...

    > >
    > > upgrade to the latest jre... then try

    >
    > I took one look at your original link and thought
    > 'should suggest web-start' before surfing straight
    > out of there.
    >
    > Now that you are making suggestions to your
    > potential end-users, and the people who were kind
    > enough to actually download and try the application
    > (of which, I wasn't), I will suggest..
    >


    you didn't try the app...
    why are you kind enough to waste your replying to this thread...

    > 'web-start'
    > - could forewarn the end user the minimum Java version
    > required (and prompt for download).
    > - sandbox this calculator (so it cannot do anything
    > harmful to the user's computer).
    >
    > But while we are on the subject of minimum Java version,
    > a quick perusal of your GUI* did not suggest it requires
    > a high level of Java (I would guess Java 1.2) - what is in
    > your code that sets the minimum Java version? Generics?
    >


    As from the exceptions raised... it seems that there was a exception in
    Vector class.
    java.util.NoSuchElementFound exception...

    > * http://myjavaserver.com/~pradyut/files/java_calc/java_calc.JPG
    > BTW - the screenshot was a nice touch - good work.


    Thanks...
    >
    > Andrew T.
    Pradyut, Nov 13, 2006
    #5
  6. Pradyut Bhattacharya

    Lew Guest

    > Andrew Thompson wrote:
    >> But while we are on the subject of minimum Java version,
    >> a quick perusal of your GUI* did not suggest it requires
    >> a high level of Java (I would guess Java 1.2) - what is in
    >> your code that sets the minimum Java version? Generics?


    This is a good question. What is the answer?

    Pradyut wrote:
    > As from the exceptions raised... it seems that there was a exception in
    > Vector class.
    > java.util.NoSuchElementFound exception...

    NoSuchExceptionFound.

    Do you mean java.util.NoSuchElementException?

    Have you read
    http://java.sun.com/j2se/1.4.2/docs/api/java/util/NoSuchElementException.html?

    Under what circumstances does your code attempt to call
    Enumeration.nextElement() after there are no more elements in the enumeration?

    Would ArrayList and Iterator perhaps suit your algorithm better than Vector
    and Enumeration?

    - Lew
    Lew, Nov 13, 2006
    #6
  7. Pradyut wrote:
    ....
    > you didn't try the app...
    > why are you kind enough to waste your replying to this thread...
    >
    > > 'web-start'


    Perhaps because more people (such as myself) might click
    a link pointing to a sand-boxed web start application, which
    is less effort than downloading, compiling and running code,
    and a lot safer than running a jar from 'some guy on usenet'.

    But then ..I do wonder why I am bothering to justify my
    interest to you, since it (my interest) is fading quickly..

    Andrew T.
    Andrew Thompson, Nov 14, 2006
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tat
    Replies:
    0
    Views:
    354
  2. Niv
    Replies:
    7
    Views:
    4,883
    OutputLogic
    May 22, 2009
  3. Sven K?hne

    pBuf[i++] = Calc(pBuf, i);

    Sven K?hne, Oct 22, 2003, in forum: C Programming
    Replies:
    2
    Views:
    324
    Mark McIntyre
    Oct 22, 2003
  4. Andy

    Menu printed twice in calc prog

    Andy, Nov 6, 2003, in forum: C Programming
    Replies:
    5
    Views:
    482
    Sheldon Simms
    Nov 7, 2003
  5. Kaye Ng

    ruby calc.rb or just calc.rb

    Kaye Ng, Jul 26, 2010, in forum: Ruby
    Replies:
    7
    Views:
    383
    Kaye Ng
    Jul 28, 2010
Loading...

Share This Page