Search:

Type: Posts; User: nautilusz

Search: Search took 0.22 seconds.

  1. Replies
    0
    Views
    587

    Open JSON file with Jfilechooser

    I have problem when reading multiple lines from json.
    Problem is when i start it, it calls out chooser to pick file to read, and after i click open, it reads only first value from file, and after...
  2. Replies
    0
    Views
    539

    Save JSON obj via Jfilechooser

    I have my textfields which contains numbers, and i collected that numbers and place them into my json object.

    JSONObject obj = new JSONObject();
    String prvi = textField.getText();
    int prvi1 =...
  3. Replies
    25
    Views
    1,361

    Re: reading and witing to txt file

    thx, i will do that, this upper was just testing, i'm going to do some changes later also
  4. Replies
    25
    Views
    1,361

    Re: reading and witing to txt file

    thx so much .. i finally got it, one of the problems was that my reader was written under void main,
    so i created separate method called reader, made it string and taking one argument so i can use...
  5. Replies
    25
    Views
    1,361

    Re: reading and witing to txt file

    ok, it's done in a method. when i call it it will do the reading from the file, and create my variable.
    i still don't know how to connect that variable with a textfield. any concrete suggestion, or...
  6. Replies
    25
    Views
    1,361

    Re: reading and witing to txt file

    I don't get it.
    because my reading class at the end creates variable "age", and that variable has to be written into textfiled which
    is created on my main class.
    so i suppose i need add after...
  7. Replies
    25
    Views
    1,361

    Re: reading and witing to txt file

    can you write me a code, e.g. this is my textfield

    textField = new JTextField();
    textField.setBounds(142, 9, 127, 20);
    Link_P.add(textField);
    textField.setColumns(10);
    ...
  8. Replies
    25
    Views
    1,361

    Re: reading and witing to txt file

    change of plans ... i decided it is easier to use json not plain txt.
    import java.io.FileReader;
    import java.io.IOException;
    import org.json.simple.JSONObject;
    import...
  9. Replies
    25
    Views
    1,361

    Re: reading and witing to txt file

    ok, i'll try something tonight, is there a way to make a class which will be doing all of this, and when i call the class i give to it argument which line to use, because i will be needing to call...
  10. Replies
    25
    Views
    1,361

    Re: reading and witing to txt file

    I haven't worked before with I/O from txtfile, so i have problem with everything. I hate working with lines, but i have to. If you know code that will help me with my program that would be great, if...
  11. Replies
    25
    Views
    1,361

    Re: reading and witing to txt file

    I just posted my problem post earlier.
    I have no clue how to read numbers from same txt file, to different textfields, and each number is on different line in txt. e.g. How to specify that in first...
  12. Replies
    25
    Views
    1,361

    Re: reading and witing to txt file

    The point is this.
    978
    On the picture, you can see what i have to do.
    Numbers have to be written in txt file, and automaticly loaded when i open that instance of program.
    When numbers are...
  13. Replies
    25
    Views
    1,361

    Re: reading and witing to txt file

    it's not the problem to pick number from the string. i could use it by simple reader, i was planing to use something like this


    import java.util.*;
    import java.io.*;

    public class...
  14. Replies
    25
    Views
    1,361

    Re: reading and witing to txt file

    ok, thx
    i will try something and post progress
    First problem.
    i know how to read whole txt, but how to read single item form line
    e.g.
    my txt file has 30 lines
    line1 100
    line2 200
    .......
  15. Replies
    25
    Views
    1,361

    reading and witing to txt file

    i have created a gui interface with 4-5 textfields ...
    In txt file i have for example set to default
    number1 100
    number2 101
    number3 10
    i have to import numbers to textfield
    100 to...
Results 1 to 15 of 15