I want to save selected text file as html file
i have written following code

JFrame parentFrame = new JFrame();

                    JFileChooser fileChooser = new JFileChooser();
                    fileChooser.setSelectedFile(f12);
                    fileChooser.setDialogTitle("Specify a file to save");    

                    int userSelection = fileChooser.showSaveDialog(parentFrame);

                    if (userSelection == JFileChooser.APPROVE_OPTION) {
                        File fileToSave = fileChooser.getSelectedFile();

                        System.out.println("Save as file: " + fileToSave.getAbsolutePath());
                    }




                now to save actualy text into destination folder what else should i write

The info you need is in the Oracle tutorials here

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.