SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Oct 2001
    Posts
    359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Any help with JAVA?

    Does anyone know why i keep getting the position as 0 in the applet? (it works in the menu one though)

    [applet]
    totNum = printerQueue.newJobs();
    System.out.println(totNum);
    newTotNum = Integer.toString(totNum);
    numberBox.setText(newTotNum);

    [main code]
    public int newJobs()
    {
    QueueNode temp = new QueueNode();
    int position = 0;
    temp = start;
    while(temp != null)
    {
    position = position + 1;
    temp = temp.previous;//previous;
    }
    return position;
    }

    [menu]
    case 7: System.out.println(printerQueue.newJobs());

  2. #2
    I'm NOT an Addict ! TheRock's Avatar
    Join Date
    Jul 2001
    Location
    Earth ... maybe
    Posts
    401
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you check the value of "start" that newJobs function is getting?
    -*-
    B-School Forums - GMAT / MBA / Admissions discussions
    -*-

  3. #3
    SitePoint Addict
    Join Date
    Oct 2001
    Posts
    359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's ok the code is workin, thought I somehow have to rename the applet to have the changes take affect.. weird.


Bookmarks

Posting Permissions

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