Hi guys
Im trying to write an application even after i close it it should still hold the text in the text area and also code a button that will clear which ever field i want to im am hitting dead walls and noting is going my way please HELP!!!!!!!
here is the code the first set books the rooms
CODE
public class Rooms
{
//declare class variables
int numSmoking;
int numNonSmoking;
boolean occupied[];
public Rooms(int non, int sm)
{
occupied = new boolean[sm+non];
for(int i=0; i<(sm+non); i++)
occupied[i] = false;
numSmoking = sm;
numNonSmoking = non;
}
public int bookRoom(boolean smoking)
{
int begin, end, roomNumber=0;
if(!smoking)
{
begin = 0;
end = numNonSmoking;
}
else
{
begin = numNonSmoking;
end = numSmoking+numNonSmoking;
}
for(int i=begin; i<end; i++)
{
if(!occupied[i])
{
occupied[i] = true;
roomNumber = i+1;
i = end;
}
}
return roomNumber;
}
}
this code is for the application itself please guys your help will be really appreciated
regards
Cameron
*1lacca: inserted code tags, next time please use them