Bookmark Topic Watch Topic
  • New Topic

need help with a display method for an applet

 
stephen Headin
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Report post to moderator
i have my applet made and the code all wrote for it..
i have a separate peice of code that allows info to be added to simulate a print queue on the applet...
when i add all the info in and hit the display button to display the details of the queue in the display box on the applet it is only showing one result.. if i enter 3 sets of data it only shows the middle set.. i need it to show all the data..

heres the code for the main display method..
(CODE)
public String displayQueueApplet()
{
// Pointer to access the queue
QueueNode nextQueueNode = new QueueNode();

String statement;

// Test if queue is empty
if (start == null)
{
statement = "\n\nThe queue is empty!";
return statement;
}
else
{
// Start at the front of the queue
nextQueueNode = start;

// Output the next data value in the queue
statement = "\nQueue Contains:\n";

// Loop through all the details in queue
while (nextQueueNode != null)
{
// Update the pointer
nextQueueNode = nextQueueNode.next;

// Output the next data value in the queue
statement = "\nQueue Contains:\n" + "Document Name: " + nextQueueNode.string1 + "\n" + "Document Owner: " + nextQueueNode.string2 + "\n" + "Document Size(KB): " + nextQueueNode.number +"\n";
return statement;
}
return statement;
}
}
(END CODE)

and heres the code that calls it for the applet
(CODE)
// Test for Display Queue button
else if (arg.equals("Display Queue"))
{
displayWindow.setText(appletQueue.displayQueueApplet());
}
(END CODE)
 
Joe Ess
Bartender
Posts: 9295
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Welcome to the JavaRanch, Stephen.
Please do not post the same question to more than one forum. Most everyone here reads more than one forum so you aren't increasing your audience, and the community may duplicate effort answering your question twice.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
CLosing this copy.
 
    Bookmark Topic Watch Topic
  • New Topic