Project GUI studentsNotes java

2

I'm new to the forum. They recommended it for programming topics. I am developing a small project with a GUI made with swing which is able to assign an array of String to a student object and an array of doubles to the same object.

When the window is executed, there is a button to show notes, which instantiates a JPanel and should create the JLabel and JTextField automatically, depending on the subjects and notes that each student has, but the only thing I get is that I get back the reference to where my object is pointing, or at least that's what I think. I attach code to see if you can lend me a hand. Thanks in advance.

Window class:

ublic void ponComponentes(Contenedor contenedor){
    for(int i=0; i<contenedor.getSize(); i++){
        JLabel lbAsignatura = new JLabel();
        lbAsignatura.setBounds(100, 150, 250, 20);
        lbAsignatura.setLocation(i*135, 50);
        lbAsignatura.setText(String.valueOf(contenedor.getAlumnos().get(indice).getNotas().get(indice).getAsignaturas()[i]));

        JTextField tfNotas = new JTextField();
        jpPanelNotas.add(tfNotas);
        tfNotas.setBounds(200, 100, 40, 20);
        tfNotas.setLocation(i*100, 110);
        tfNotas.setText(String.valueOf(contenedor.getAlumnos().get(indice).getNotas().get(indice).getNotas()[i]));

        jpPanelNotas.add(lbAsignatura);
        jpPanelNotas.add(tfNotas);
    }
}

Thank you very much in advance. I have put all the code susceptible to have an error

    
asked by daviserraalonso 30.01.2018 в 23:42
source

0 answers