Grazie ancora ci sono riuscito cosi a sottrarre il .doc:
Perdonami ma cosa intendevi sul "showOpenDialog" perchè non mi è molto chiaro quello che volevi spiegarmi?codice:ButtonSearch = new JButton("Search Customer"); ButtonSearch.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { JFileChooser chooser = new JFileChooser(); //trova file-------------------------------------------- chooser.showOpenDialog(null); File f = chooser.getSelectedFile(); String filename=f.getName(); String file = ".doc"; //SOTTRAE IL .DOC------------------------------------ String Testo = null; //SOTTRAE IL .DOC------------------------------------ if (filename.endsWith (file)) //SOTTRAE IL .DOC------------------------------------ Testo = filename.substring (0, filename.length()-file.length()); //SOTTRAE IL .DOC------------------------------------ textCLIENTE.setText(Testo); } });
Anche questa parte non ho capito. "(insiste sul fatto che il document implementi la interfaccia StyledDocument)"

Rispondi quotando