Hello
My names Harry, and im a beginner in Java programming, i have taken a few courses so know some of the terms and lingo and how to build a basic program.
i am currently working on a GUI app, which is why im here, i have managed to make this App button less, so that the information i want to display just does, without having to do anything apart from run it, the information is displayed in 'JTextFields' ontop of a 'JLabel' there are 20 so TextFields, each of these display a line of writing, however the lines of writing are in seperate notepad files, i would like to code it so that it will read the first line of a notepad and then put it in a textfield and then read the 2nd line of writing and display it in a different textfield, and the same for the other 18 or so. i am working my way up to being able to take information from a CSV(comma seperated file).
Is there a way to display information in the same CSV file in different textfields, and if these numbers get changed, how would i go about making it automatically update?
Any help/Soruce code etc., would be very helpful.
================================================== ==============================
Example of my code.(if this helps)
================================================== ==============================
This part of my code creates and puts the textfield in a certain location, and then goes into "MyFile" to read the information and display it into the "TxtCardiff" JTextFieldThis works fine, and i have this same code repeated 20 times, and have 20 different notepad files, i need to put all information into one file, and still display it into the different textfields!)
================================================== ==============================txtCardiff = new JTextField(); try { FileReader MyFileReader = new FileReader( "MyFile"); int character = MyFileReader.read(); while (character != -1) { output += (char) character; character = MyFileReader.read(); } MyFileReader.close(); } catch (IOException e1) { System.out.println(e1.getMessage()); } txtCardiff.setText(output); txtCardiff.setText(output); txtCardiff.setBackground(Color.GREEN); txtCardiff.setBounds(305, 699, 102, 20); frame.getContentPane().add(txtCardiff); txtCardiff.setColumns(10);
Regards,
Harry