JavaFx with COMBOBOX

0

Thank you very much in advance but I have a query to see if you can help me because what I need is that the program I'm doing read me a CSV file in which the program itself saves data and from there I only took the name and I showed it in the combobox and when I select the name of the combobox I showed it in the textview thank you very much.

for now and tried this ... but it still does not work and I do not know how to do it anymore.

 @FXML private void mostrarcombo() {
        	/*BufferedReader br = null;
        	ComboBox<proveedores>  combo = new ComboBox<proveedores>();
        	try {
        		br = new BufferedReader(new FileReader("CsvFile2"));
        		String line;
                
                while ((line = br.readLine()) != null) {
                    String[] fields = line.split(FieldDelimiter, -1);
                   /* combo.getItems().addAll(proveedores2.toString().length(), proveedores2);
                    proveedores proveedor = new proveedores();
                    proveedor.nombrep.set(fields[0]);
                    for(int a = 0; a<fields.length;a++) {
                    	combo.getItems().addAll(proveedores2);
                    }
                    
                    
                    //System.out.println(fields[0]);
                    
                }
        	}catch(Exception e) {
        		
        	}*/
        	//ComboBox<proveedores> cmb = new ComboBox<>(proveedores2);
        	
        	
        	BufferedReader br ;
        	try {
        		br = new BufferedReader(new FileReader("CsvFile2"));
        		combo.setItems(proveedores2);
        		proveedores2.add(posicionClienteEnTabla, null);
        	}catch(Exception e) {
        		
        	}
        	
        }
    
asked by Nikolai Ivanov 25.01.2018 в 17:51
source

0 answers