Display Array for user input

Discussion in 'Java' started by astrofaireknightess, Mar 2, 2010.

  1. astrofaireknightess

    astrofaireknightess New Member

    Joined:
    Mar 1, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    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.
     
  2. virxen

    virxen Active Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    28
    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.
     
  3. theraptor

    theraptor New Member

    Joined:
    Mar 8, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    something like this?:

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

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice