1st year uni student --- help...java's killing me!!

Hi there,

I have an assignment which I have to do that requires the user to be able to create rooms of two types, create persons that can make bookings, and make bookings of the rooms that are created chosing a person to book under and a date/time to book from and to.

I am using an application called BlueJ to develop - this is a custom app designed by my university.

I have most of the code written, however I'm coming across problems that I just don't seem to be able to figure out. Here's some of the problems:

1. I use a Hash Set for all my collections (rooms, bookings and persons). When I make a booking and then display it, the room information does not appear and I have found that the problem is because the information in the rooms set does not get passed over properly to the bookings area. I have checked various areas and I can't find out how to do this. I created a temporary set within bookings using the code: Set roomSet = (Set)(roomsDatabase.getSet());

Iterating through the roomSet however indicates that nothing gets put into it. We need to be able to use the Set within roomsDatabase so that we have access to what existing rooms data. We have the same issue with Persons. How can this be done?

2. Could not find code which allows me to clear the screen!! Equavelent to C++ clrscr()... Hence, the screen gets very clustered.

Any help will be IMMENSELY appreciated!!

Thanx heaps in advance.

StressedOut!!!

Comments

  • : Hi there,
    :
    : I have an assignment which I have to do that requires the user to be able to create rooms of two types, create persons that can make bookings, and make bookings of the rooms that are created chosing a person to book under and a date/time to book from and to.
    :
    : I am using an application called BlueJ to develop - this is a custom app designed by my university.
    :
    : I have most of the code written, however I'm coming across problems that I just don't seem to be able to figure out. Here's some of the problems:
    :
    : 1. I use a Hash Set for all my collections (rooms, bookings and persons). When I make a booking and then display it, the room information does not appear and I have found that the problem is because the information in the rooms set does not get passed over properly to the bookings area. I have checked various areas and I can't find out how to do this. I created a temporary set within bookings using the code: Set roomSet = (Set)(roomsDatabase.getSet());
    :
    : Iterating through the roomSet however indicates that nothing gets put into it. We need to be able to use the Set within roomsDatabase so that we have access to what existing rooms data. We have the same issue with Persons. How can this be done?
    :
    : 2. Could not find code which allows me to clear the screen!! Equavelent to C++ clrscr()... Hence, the screen gets very clustered.
    :
    : Any help will be IMMENSELY appreciated!!
    :
    : Thanx heaps in advance.
    :
    : StressedOut!!!
    :
    :

    Hmmm... So you're either from the Monash University or the University of Southern Denmark. Like most people in my college (I'm from Brazil), I've been using BlueJ since I started learning Java, and I didn't find any software that could be a decent replacement for it so far, since BlueJ is apparently the only development environment that lets you run methods without depending on the 'public static void main(String args[])' method. BlueJ rules. :)

    As for clearing the screen, I don't know how it's done if you're referring to the console, but it's a GUI component, just do something like '.setText("")'.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion