JFileChooser « JTextArea « Java Swing Q&A





1. Displaying a file slected with a JFileChooser into a textarea    java-forums.org

Hi, I'm current struggling to display a file in a text area that needs to be selected with a JFileBrowser. I can manage to get the file browser to come up and select the file I wish to load but I can't seem to get the GUI working to display it in to a text area. I've shown my code below ...

2. Displaying a selected image with a JFileChooser into a textarea    java-forums.org

public class Pseudo implements ActionListener { JFileChooser fileChooser; JLabel label = new JLabel(); Pseudo() { instantiate and configure fileChooser you can use a FileFilter to show only image files } public void actionPerformed(ActionEvent e) { showDialog(); } private void showDialog() { int retVal = fileChooser.showOpenDialog(); if(retVal == JFileChooser.APPROVE_OPTION) { File file = fileChooser.getSelectedFile(); // bmp, gif, jpg, png files okay BufferedImage ...

3. jfilechooser and jtextarea problem    java-forums.org

Hello all, I work in a project and i want to open a .xml or .doc file in a text area or in a label.. whatever is easier.. I tried to use jfilechooser to do that but i didn't find any solution to do it.. I can't find the right method to get the component of a doc or xml and ...