I made a filechooser that enables the user to save a file.

I used netbean's gui maker for it.

I literally have just one thing stopping me from finishing my task: The save button does not actually do anything. You can click on it, but nothing happens.

How do I add an actionlistener or something to that button? I've tried but all I managed was to add the listener to the entire filechhoser, meaning I can click anywhere on the filechooser and it will save the file.

Um, I'm sorry, but what is wrong with JFileChooser?

In any case, if you insist on recreating the wheel, here.

Hmmm I don't think I stated my case clearly enough, forgive me.

I'm using the netbeans drag 'n' drop gui editor. I dragged a filechooser on form the palette(that's a JFileChooser, right?), but I don't know how to make the Save button work. I have the file that should be save ready, but I don't know where to put the code to save the file.

I put an actionListener on the JFileChooser, but it doesn't do anything when I click save.

Thanks, I got it working.

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.