Random Hero
04-06-2005, 03:56 PM
I'm stuck on some homework.
I have to create a database for a video shop in java. With a GUI front end to it. The 'database' is just a .data file which contains a list of Video titles, actors, rating.
I need the program to save user input fields to the .data file, but I dont know how.
So far for the add part of the class I have:
public void addVideo( Video newVideo ) {
if (arrayOfVideos = DEFAULT_SIZE) {
arrayHasChanged = false;
}
else {
//arrayOfVideos[10]= VideoInputWindow.newVideo;
arrayOfVideos.add (VideoInputWindow.newVideo(newTitle));
numberOfVideos++;
arrayHasChanged = true; //this gives the user option to save
}
Anyways I cant figure out how to import the data the user inputs from one class to another. And I also cant figure out how to store that data in the array. I'm only a beginner at java, so help/shove in the right direction would be much appreciated. Thanks.
Edit: I have the main GUI and input GUI down fine. Did that in classes a little while back. But I dont know what to do here, tried a few things and a few sources, books (Java J2SE 5 Edition) but I dont truly know what I'm looking for to help me. Such a java noob.
I have to create a database for a video shop in java. With a GUI front end to it. The 'database' is just a .data file which contains a list of Video titles, actors, rating.
I need the program to save user input fields to the .data file, but I dont know how.
So far for the add part of the class I have:
public void addVideo( Video newVideo ) {
if (arrayOfVideos = DEFAULT_SIZE) {
arrayHasChanged = false;
}
else {
//arrayOfVideos[10]= VideoInputWindow.newVideo;
arrayOfVideos.add (VideoInputWindow.newVideo(newTitle));
numberOfVideos++;
arrayHasChanged = true; //this gives the user option to save
}
Anyways I cant figure out how to import the data the user inputs from one class to another. And I also cant figure out how to store that data in the array. I'm only a beginner at java, so help/shove in the right direction would be much appreciated. Thanks.
Edit: I have the main GUI and input GUI down fine. Did that in classes a little while back. But I dont know what to do here, tried a few things and a few sources, books (Java J2SE 5 Edition) but I dont truly know what I'm looking for to help me. Such a java noob.