How do I get an image of the computer inside a java application?

5

I have a registration and in this register I would like the user to choose an image to represent him. Otherwise, a default image would appear.

That is, in a certain part of the registry would have a button that when clicked open the Windows manager for the choice of the image, but that restricted so that only chose an image and something of the "type" image, without being a document, for example.

What is the attribute to represent this image? How to do this in a simple way?

    
asked by anonymous 26.06.2015 / 06:25

1 answer

3

You should use a JFileChooser with FileFilter . In Oracle's official tutorials , there is an example of how to restrict it to files with extension image only.

See this part, specifically: Filtering the List of Files . / p>     

26.06.2015 / 20:45