The Artima Developer Community
Sponsored Link

Java Answers Forum
position staying at 0

1 reply on 1 page. Most recent reply: May 13, 2002 8:17 AM by neil

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
neil

Posts: 5
Nickname: neil
Registered: May, 2002

position staying at 0 Posted: May 12, 2002 6:06 PM
Reply to this message Reply
Advertisement
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());


neil

Posts: 5
Nickname: neil
Registered: May, 2002

Re: position staying at 0 Posted: May 13, 2002 8:17 AM
Reply to this message Reply
sorry this actually works.. i have to rename the applet to get the changes to take affect.. weird

Flat View: This topic has 1 reply on 1 page
Topic: no return value Previous Topic   Next Topic Topic: Wt is J2EE is about?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use