"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?
 
OviConnect With a Mentor Commented:

--------------------------------------
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
 
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
All Courses

From novice to tech pro — start learning today.