Problem Running Application on NetBeans 5.5 Problem!!

Discussion in 'Java' started by ajaywadhwani@gmail.com, Dec 27, 2006.

  1. Guest

    Hi

    I am a newbie to the NetBeans and have recently downloaded the NetBeans
    5.5.

    However, I am facing one problem.

    For example: for calculating the lowest of a given set of numbers,
    please go thru the code below


    /**
    *EXERCISE 5.11: WRITE AN APPLICATION THAT FINDS THE SMALLEST OF
    SEVERAL
    * INTEGERS. ASSUME THAT THE FIRST VALUE READ SPECIFIES
    * THE NUMBER OF VALUES TO INPUT FROM THE USER.
    * @author ajay
    */
    import java.util.Scanner;
    public class lowest {

    public static void main(String[] args) {
    int number;
    int lowest = 1000;
    int count;
    Scanner input = new Scanner (System.in);

    System.out.print("Enter the number of entries: ");
    count = input.nextInt();

    for (int i = 1; i <= count; i++) {
    System.out.print("Enter the number: ");
    number = input.nextInt();

    if(number < lowest)
    lowest = number;
    }

    System.out.printf("Lowest number among %d entries: %d", count,
    lowest);
    }

    }


    Building the project is fine... but when I run this program, it just
    displays these lines...
    init:
    deps-jar:
    compile:
    run:

    There is no display asking for the number of entries.

    In which ever case where the input from the computer has to be given
    first, it just shows this message and displays a "Building Message" at
    the bottom
    WHAT SHALL BE DONE???
     
    , Dec 27, 2006
    #1
    1. Advertising

  2. wrote:
    > Hi
    >
    > I am a newbie to the NetBeans and have recently downloaded the NetBeans
    > 5.5.


    I am using Eclipse.

    >
    > However, I am facing one problem.
    >
    > For example: for calculating the lowest of a given set of numbers,
    > please go thru the code below
    >
    >
    > /**
    > *EXERCISE 5.11: WRITE AN APPLICATION THAT FINDS THE SMALLEST OF
    > SEVERAL
    > * INTEGERS. ASSUME THAT THE FIRST VALUE READ SPECIFIES
    > * THE NUMBER OF VALUES TO INPUT FROM THE USER.
    > * @author ajay
    > */
    > import java.util.Scanner;
    > public class lowest {
    >
    > public static void main(String[] args) {
    > int number;
    > int lowest = 1000;
    > int count;
    > Scanner input = new Scanner (System.in);
    >
    > System.out.print("Enter the number of entries: ");
    > count = input.nextInt();
    >
    > for (int i = 1; i <= count; i++) {
    > System.out.print("Enter the number: ");
    > number = input.nextInt();
    >
    > if(number < lowest)
    > lowest = number;
    > }
    >
    > System.out.printf("Lowest number among %d entries: %d", count,
    > lowest);
    > }
    >
    > }
    >
    >
    > Building the project is fine... but when I run this program, it just
    > displays these lines...
    > init:
    > deps-jar:
    > compile:
    > run:


    When I run this program, it just displays these lines ...

    Enter the number of entries: 3
    Enter the number: 1
    Enter the number: 6
    Enter the number: 2
    Lowest number among 3 entries: 1

    >
    > There is no display asking for the number of entries.
    >
    > In which ever case where the input from the computer has to be given
    > first, it just shows this message and displays a "Building Message" at
    > the bottom
    > WHAT SHALL BE DONE???
    >


    Firstly please stop SHOUTING.

    Since your program works in Eclipse, I imagine that you don't have
    Netbeans installed correctly. Hopefully a Netbeans user will recognise
    the symptoms and suggest something.
     
    RedGrittyBrick, Dec 27, 2006
    #2
    1. Advertising

  3. Juha Laiho Guest

    said:
    >I am a newbie to the NetBeans and have recently downloaded the NetBeans
    >5.5.
    >
    >However, I am facing one problem.
    >
    >For example: for calculating the lowest of a given set of numbers,
    >please go thru the code below
    >

    ....
    >
    >Building the project is fine... but when I run this program, it just
    >displays these lines...
    >init:
    >deps-jar:
    >compile:
    >run:
    >
    >There is no display asking for the number of entries.


    NetBeans seems to have a problem with the System.out handling; note that
    there is an "Input" box in the bottom of the screen (bottom of the Output
    window), and you can feed numbers into this box (first the number of entries,
    then each number you're feeding in for comparision, one at a time).

    For some reason NetBeans will output your text prompts only when
    printing out the result.

    >In which ever case where the input from the computer has to be given
    >first, it just shows this message and displays a "Building Message" at
    >the bottom
    >WHAT SHALL BE DONE???


    Looks like filing a bug against NetBeans would be in order. Unless this
    bug is already reported.
    --
    Wolf a.k.a. Juha Laiho Espoo, Finland
    (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
    PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
    "...cancel my subscription to the resurrection!" (Jim Morrison)
     
    Juha Laiho, Dec 28, 2006
    #3
    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. Pimousse
    Replies:
    2
    Views:
    3,645
    Roedy Green
    Apr 21, 2004
  2. Ilias Lazaridis
    Replies:
    0
    Views:
    918
    Ilias Lazaridis
    Dec 12, 2004
  3. Thomas G. Marshall
    Replies:
    2
    Views:
    836
    Thomas G. Marshall
    Oct 16, 2006
  4. casperbang
    Replies:
    3
    Views:
    739
    casperbang
    Oct 3, 2007
  5. Enter The
    Replies:
    9
    Views:
    2,399
    Roedy Green
    Feb 25, 2010
Loading...

Share This Page