"save as" function

Hi expert people,
How i can do to a "button" which has the function to save the work .Let say  we want to save a " table"  which already complete the data in a certain location.Can i have a similar example?? Thanks.
Bye
wildwildAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

OviCommented:

--------------------------------------
Button b = new Button("Save");
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
doSave();
}
});

private void doSave() {
//--------save implementation-----------
}

---------OR with Swing-----------------------
JButton b = new JButton("Save");
b.setToolTipText("Save");
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
doSave();
}
});

private void doSave() {
//--------save implementation-----------
}



This is the general way. For one better, please give more details.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wildwildAuthor Commented:
Thanks for your answer. I will apply it into my program. I hope there are no problem for me to do it. If i have find any further problems i still hope for your help. Bye
0
wildwildAuthor Commented:
I'm sorry. Can i have another question? In the doSave() method, you had type "save implementation" . Is we type a location to save our work? Is the part should look like this : " c:\my java\table" ?  If i wrong, what are the right way should i do.Can you give a example?? Thanks a lot.
0
OviCommented:
Of course, in this method you will IMPLEMENT the save part of your work. This can be in various forms, depends in what you actually work. Be more specific please.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.