Results 1 to 5 of 5
  1. #1
    ppkkyaw is offline Member
    Join Date
    Jun 2008
    Posts
    2
    Rep Power
    0

    Red face How to save name in Array and Print saved Name

    Hi to everyone,
    I am learning Java and I had some problem to write in Java code.
    I would like to create a new array and want to Save there what I typed. After that I would like to Display. But I don't know how to write to accept array in what I typed. Can anyone help me by writing code.
    Last edited by ppkkyaw; 06-12-2008 at 06:20 AM.

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    If I get correctly, you want to save some text in an array and display(read) them later. Right?

    Arrays are different. You should know the size of it at the time of initialization. It depends on how many time you want to save. Say you want to save 5 items and display them each time, it's not a case. If it is not, you are in a trouble.

    In such a case you have different options. List. If you want to learn more better to read the documentation.

  3. #3
    ppkkyaw is offline Member
    Join Date
    Jun 2008
    Posts
    2
    Rep Power
    0

    Default

    Thinks, now I realize my topic is not complete with facts. Truely, I want to enter name and want to save in array until I press one button(example- OK button). After that I want to display them. That is my plan. I am just a student and learning java programming. I want to ask a lot of question in this forum. By the way can you reply this question?

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    I think that you need to greatly clarify your question here. It's still very confusing (at least to me).

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    It's confused me too. What you mean "save in array until I press one button"

    I'm sure within a few second you are dead. :) You need a huge memory to do it.

    What is the purpose of saving and display that entered name. If you want to display the name directly, no need to save it anymore. Until you exit the application you can hold it in a global variable.

    So, it's much better to give more details on your question.

Similar Threads

  1. Hwlp with "Open", "Save", "Save as..."
    By trill in forum New To Java
    Replies: 3
    Last Post: 11-02-2010, 10:26 AM
  2. How can i save the data Internally(auto save)
    By Rama Koti Reddy in forum AWT / Swing
    Replies: 2
    Last Post: 11-01-2010, 09:31 PM
  3. Repaint panel after open saved serialized array
    By King8654 in forum AWT / Swing
    Replies: 1
    Last Post: 04-24-2008, 10:37 AM
  4. How can I save my XML
    By FrankyDee in forum XML
    Replies: 1
    Last Post: 03-27-2008, 04:59 PM
  5. returning to a previously saved view
    By gojava in forum Advanced Java
    Replies: 0
    Last Post: 11-09-2007, 06:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •