0

I am new to programming and I am using a mvc format for my java assignment. I am not sure how to make the XML data load unto the graphic table. When I run the program the table appears but the data is not in the headers and lines. It seems I am missing something in either the controller or view class...

public class Controller
{

    Model model;
    View view;

    public Controller(Model m, View v)
    {
        model = m;
        view = v;
        
        
        FootballPlayerData fp = m.getFpData();
        fp.ReadPlayersFromXML();
        
             view.CenterUpdate(model.getFpData().getLines(model.getFpData().getFirstLineToDisplay(),
                model.getFpData().getLastLineToDisplay()),
                //data coming as an ArrayList of ArrayList of String
                model.getFpData().getHeaders());
                //headers data (name, position, etc...) coming as an ArrayList of String
        view.CenterInitialSetup(model.getFpData().getLinesBeingDisplayed(), model.getFpData().size());
    }

public class View {


    private final InitialFrame iframe;

    
    public View() {
        iframe = new InitialFrame();
    }

    // member functions
//    public void CenterInitialSetup(int lbd, int numCols) {
//        iframe.getInitialPanel().getCp().CenterInitialSetup(lbd, numCols);
//    }

    public void CenterUpdate(ArrayList< ArrayList< String>> data, ArrayList< String> headers) {

    }

    public void CenterInitialSetup(int linesBeingDisplayed, int size) {
        throw new UnsupportedOperationException("Not supported yet."); 
    }
}
  • You seem to be passing in your data to the `CenterUpdate()` method, but it is empty. Since the method implements a subclass method of `View`, you probably need to look into the methods of `View` to actually put the data in the table. – StarShine Mar 29 '21 at 09:30
  • Does this answer your question? [Java MVC - Am I missing something here?](https://stackoverflow.com/questions/13726226/java-mvc-am-i-missing-something-here) – StarShine Mar 29 '21 at 09:33

0 Answers0