I'll post here what I have so far, the only problem is that according to what one of the mentors was telling me, the definition class should have ALL the work, the controller class should be a simple message just to show the results, is that correct or even possible?
As an example we referenced one of my professor's controller classes. It is a program where you create an object (a car) assign it parameters and show it which looks as simple as this:
//Create a new object and pass the information
//through the constructor instead of getters/setters
Car bmw = new Car("BMW", "M6", "RED", 20, 200000.00);
//print the object summary
JOptionPane.showMessageDialog(null,bmw.toString());
The problem is for the professor's program he is not asking for input, so following his instructions according to what he wants I got this code so far but I believe it is not correct because I dont have a class to reference in the controller code.
public class ProjectDefinition
{
final int USER_EXPOSURES = 1;
public static void main(String[] args)
{
String input = JOptionPane.showInputDialog
(
"Welcolme to Photo Express" +
"Please enter the following seperated by spaces:\n\n"
+ "First Name:" + "\n"
+ "Last Name:" + "\n"
+ "Phone Number:" + "\n"
+ "Number of Rolls" + "\n"
+ "Number of Prints" + "\n" + "\n"
+ "Example:Monkey Luffy 6265554321 5 8"
);
StringTokenizer st = new StringTokenizer(input);
String result;
String userFirst = st.nextToken();
String userLast = st.nextToken();
String userPhone = st.nextToken();
String userRolls = st.nextToken();
String userPrints = st.nextToken();
result ="Thank you for choosing Photo Express, Here is your Summary:" + "\n\n"
+ "First Name:" + " " + userFirst + "\n"
+ "Last Name:"+ " " + userLast + "\n"
+ "Phone number:" + " " + userPhone + "\n"
+ "Number of Rolls:" + " " + userRolls + "\n"
+ "Number of Prints:" + " " + userPrints;
JOptionPane.showMessageDialog(null, result);
}
}
That is my definition, but how would I reference that in the controller class to get it to show up from there?