display an Object [] in a JList

1

I have a JFrame in which I placed a JList to visualize an arrangement, but the arrangement I get is an Object [] since I compile the code in matlab, but the result is processed in java, this is my code:

private void jButtonOpenActionPerformed(java.awt.event.ActionEvent evt) {                                            
    // Obtiene el path del Folder con el volumen adquirido
    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    fileChooser.setCurrentDirectory(new File("C:\...\ProjectColorCT"));

    int show_fileC = fileChooser.showOpenDialog(this);

    String pathFolder = null;
    if (show_fileC != JFileChooser.CANCEL_OPTION ){
        File folderName = fileChooser.getSelectedFile();
        pathFolder = folderName.getAbsolutePath();
        jTextPathFolder.setText(pathFolder);
    }
    // ---    
    System.out.println(pathFolder);
    Object[] arrList = null;
    getNameClass nameObj = null;
    try {
        nameObj = new getNameClass();
        arrList = nameObj.getNameSlices(1, pathFolder);
        System.out.println(arrList[0]);

    } catch (MWException ex) {
        Logger.getLogger(TACframe.class.getName()).log(Level.SEVERE, null, ex);
    }         
}

In the object called "arrList" I get the whole list of names I want to show, but I do not know how to show it in a JList, I tried to pass the object to a String [] but it does not work.

    
asked by Aridai Solis 07.05.2018 в 23:26
source

0 answers