Import javax.swing. *;
.
.
.
Public Class Jcutter Extends Jframe {
Private JTextField Textfield;
Private jbutton button;
Private jfilechooser fdialog;
Private Jframe Frame;
.
.
.
Button = new jbutton ();
Button.addActionListener (New ActionListener () {
Public Void ActionPerformed (ActionEvent E) {
String msg;
fdialog = new jfilechooser (); // file selector
Int results = fdialog.showopendialog (frame);
IF (result == jfilechooser.Approve_option) {
String fname = fdialog.getname (fdialog.getSelectedFile ());
Frame.SetTitle (FNAME);
Msg = "file open approved";
Else
Msg = "File Open Cancelled";
JOPTIONPANE.SHOWMESSAGEDIALOG (Frame, MSG); // Tips box
}
});