Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   Display Array for user input (http://www.go4expert.com/forums/display-array-user-input-t21169/)

astrofaireknightess 2Mar2010 05:36

Display Array for user input
I'm trying to create a calendar program in Java. I am hoping to display an array of input fields for the user with each field corresponding to a given date. I want to allow the user to input appointments as strings. Since it is expected that some dates will contain no appointments (i.e. the array entry contains a null object) and the array is large I want the user to be able to select only the dates they want to fill. I've created the array:

String[][] march;
int i,j,a,b;
public void run()
march = new String[7][5];

But now I'm stuck how to display the array to the user.

virxen 2Mar2010 16:32

Re: Display Array for user input
because i can not understand what you want to do,do this.

imagine that you have the program ready as you want.
what would be the output?
simulate a simple execution of your program

for example

give me date:14/2/2010
give me description:xaxaxa
the appointment was set.
end of program.

theraptor 8Mar2010 19:05

Re: Display Array for user input
something like this?:


for (int row=0; row < march.length; row++) {
    for (int col=0; col < march[row].length; col++) {
        System.out.print(" " + march[row][col]);

All times are GMT +5.5. The time now is 14:25.