Usage
-
LocalArchiveEdit dlg = new LocalArchiveEdit();
-
-
dlg.setTitle("Create a new Local Archive");
-
dlg.doModal(p_Parent);
-
if (null==returned) return null;
-
-
name = dlg.getInpName();
-
description = dlg.getInpDescription();
-
sourcePath = dlg.getInpPath();
Derived Class
-
package metcarob.com.mediaorganiser.mainapp.ui;
-
-
import java.awt.event.KeyEvent;
-
-
import java.io.File;
-
-
import java.util.ArrayList;
-
import java.util.HashMap;
-
import java.util.List;
-
-
import java.util.Map;
-
-
import javax.swing.JFileChooser;
-
import javax.swing.JOptionPane;
-
import javax.swing.KeyStroke;
-
-
import javax.swing.filechooser.FileFilter;
-
-
import metcarob.com.common.ui.RJMFrameDialog.FieldTypes.RJMFrameDialogFieldBrowsePath;
-
import metcarob.com.common.ui.RJMFrameDialog.FieldTypes.RJMFrameDialogFieldLabel;
-
import metcarob.com.common.ui.RJMFrameDialog.FieldTypes.RJMFrameDialogFieldText;
-
import metcarob.com.common.ui.RJMFrameDialog.PossibleReturnValue;
-
import metcarob.com.common.ui.RJMFrameDialog.RJMFrameDialog;
-
import metcarob.com.common.ui.RJMFrameDialog.RJMFrameDialogField;
-
-
public class RelationshipEditDLG extends RJMFrameDialog {
-
super();
-
List<PossibleReturnValue> retVals = new ArrayList<PossibleReturnValue>();
-
-
RJMFrameDialogField field = null;
-
this.AddField(new RJMFrameDialogFieldLabel("Relationship"));
-
field = new RJMFrameDialogFieldText("Name:","");
-
field.setEnabled(false);
-
this.AddField("NAME",field);
-
field = new RJMFrameDialogFieldText("Description:","");
-
field.setEnabled(false);
-
this.AddField("DESC",field);
-
field = new RJMFrameDialogFieldBrowsePath("File:","","...",JFileChooser.FILES_ONLY,new FileFilter() {
-
return f.getName().toLowerCase().endsWith(".db")
-
|| f.isDirectory();
-
}
-
-
return "DB Files";
-
}
-
}
-
);
-
field.setEnabled(false);
-
this.AddField("FILE",field);
-
field = new RJMFrameDialogFieldBrowsePath("Directory:","","...",JFileChooser.DIRECTORIES_ONLY,null);
-
field.setEnabled(false);
-
this.AddField("DIR",field);
-
-
this.Setup(retVals);
-
}
-
-
-
-
if (p_ReturnValue!=null) {
-
if (p_ReturnValue.equals("OK")) {
-
if (getInpName().length()<2) {
-
return false;
-
}
-
}
-
};
-
return true;
-
}
-
}
Then add actions as
-
{
-
putValue(NAME, m_strMenuOpen);
-
putValue(SMALL_ICON, getValue(LARGE_ICON_KEY));
-
}
-
-
//Write Code
-
//No need to if enabled
-
//No need for start or end long running operation
-
//No need for exception messagebox
-
}
-
};
Simple wrapper to wrap a JPanel
-
package metcarob.com.xmlwasher.ui;
-
-
import java.util.ArrayList;
-
import java.util.List;
-
-
import javax.swing.JPanel;
-
import javax.swing.KeyStroke;
-
-
import metcarob.com.common.ui.RJMFrameDialog.RJMFrameDialog;
-
import metcarob.com.common.ui.RJMFrameDialog.PossibleReturnValue;
-
import metcarob.com.common.ui.RJMFrameDialog.FieldTypes.RJMFrameDialogFieldSubPanel;
-
-
public class MainWindowDLG extends RJMFrameDialog {
-
-
super();
-
List<PossibleReturnValue> retVals = new ArrayList<PossibleReturnValue>();
-
-
-
RJMFrameDialogFieldSubPanel field = new RJMFrameDialogFieldSubPanel(pan, 10);
-
this.AddField("MAIN_PANEL",field);
-
-
this.Setup(retVals);
-
};
-
-
}
Close Dialog from code
Call ReturnActionCall
-
this.ReturnActionCall("SETTINGSUPDATE");
Google Juice
RJMDialog
RJM Article Type
Quick Reference