Results 1 to 5 of 5

Thread: Gui

  1. #1
    since'50 is offline Member
    Join Date
    Oct 2013
    Posts
    4
    Rep Power
    0

    Default Gui

    Hello,

    I am a beginner at Java and I have problems with GUI assignment.
    My assignment is to make GUI to calculate orders and to save the calculation to .csv file.
    I have solved "save" button and it really does save my input to .csv file.

    But, my problem is "Load button" When I press it, how to load .csv file to my existing JTextFields?

    Bellow is the picture.


  2. #2
    milovan is offline Senior Member
    Join Date
    Jan 2011
    Location
    Belgrade, Serbia
    Posts
    292
    Rep Power
    4

    Default Re: Gui

    Do you have problem with loading csv file or mapping it with text fields.
    Could you show your load method?

  3. #3
    since'50 is offline Member
    Join Date
    Oct 2013
    Posts
    4
    Rep Power
    0

    Default Re: Gui

    Thank you for quick response!

    Well, the problem is mapping it with text fields. I don't know how to read the file and implement it to my textfields.

  4. #4
    since'50 is offline Member
    Join Date
    Oct 2013
    Posts
    4
    Rep Power
    0

    Default Re: Gui

    To be more precise, lower row (load , prev,next )of my JButtons doesn't work, above row (calculate,save,clear,exit) works fine.

  5. #5
    milovan is offline Senior Member
    Join Date
    Jan 2011
    Location
    Belgrade, Serbia
    Posts
    292
    Rep Power
    4

    Default Re: Gui

    Assuming that your file has multiple entries (lines) you also have to determine what concrete entry you want to display in text fields.
    For loading file I would go with BufferReader and then read line by line (even separate string from one line) and store it in the list of Strings.
    You can then easily iterate the list for data you want to display. Adding that data to text fields would not be so hard then.

Posting Permissions

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