本文整理汇总了Java中java.awt.Dialog.setLocationRelativeTo方法的典型用法代码示例。如果您正苦于以下问题:Java Dialog.setLocationRelativeTo方法的具体用法?Java Dialog.setLocationRelativeTo怎么用?Java Dialog.setLocationRelativeTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.Dialog
的用法示例。
在下文中一共展示了Dialog.setLocationRelativeTo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showDocumentsDialog
import java.awt.Dialog; //导入方法依赖的package包/类
public static void showDocumentsDialog() {
DocumentsDlg documentsPanel = getDefault();
DialogDescriptor dlgDesc = new DialogDescriptor(
documentsPanel,
NbBundle.getMessage(DocumentsDlg.class, "CTL_DocumentsTitle"),
true, // is modal!!
new Object[0],
// make "switcch to document" button default
getDefault().jButtonActivate,
DialogDescriptor.DEFAULT_ALIGN,
null,
null
);
dlgDesc.setHelpCtx( null ); //hide the default Help button
final Dialog dlg = DialogDisplayer.getDefault().createDialog(dlgDesc);
dlg.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(DocumentsDlg.class, "ACSD_DocumentsDialog"));
if( dlg instanceof JDialog ) {
HelpCtx.setHelpIDString(((JDialog)dlg).getRootPane(), documentsPanel.getHelpCtx().getHelpID());
}
getDefault().updateNodes();
if (getDefault().previousDialogSize != null) {
dlg.setSize(getDefault().previousDialogSize);
dlg.setLocationRelativeTo(null);
}
dlg.setVisible(true);
getDefault().clearNodes();
}
示例2: implement
import java.awt.Dialog; //导入方法依赖的package包/类
public ChangeInfo implement(){
PickOrCreateFieldPanel pnlPickOrCreateField = new PickOrCreateFieldPanel();
pnlPickOrCreateField.setAvailableFields(getAvailableFields());
pnlPickOrCreateField.setFileObject(fileObject);
DialogDescriptor ddesc = new DialogDescriptor(pnlPickOrCreateField,
NbBundle.getMessage(CreateId.class, "LBL_AddIDAnnotationDlgTitle"));
ddesc.createNotificationLineSupport();
Dialog dlg = DialogDisplayer.getDefault().createDialog(ddesc);
pnlPickOrCreateField.setDlgDescriptor(ddesc);
dlg.setLocationRelativeTo(null);
dlg.setVisible(true);
if (ddesc.getValue() == DialogDescriptor.OK_OPTION){
if (pnlPickOrCreateField.wasCreateNewFieldSelected()){
createIDField(pnlPickOrCreateField.getNewIdName(),
pnlPickOrCreateField.getSelectedIdType());
} else{
// pick existing
String fieldName = (String) pnlPickOrCreateField.getSelectedField();
createIDField(fieldName, null);
}
}
return null;
}
示例3: implement
import java.awt.Dialog; //导入方法依赖的package包/类
public ChangeInfo implement(){
examineTargetClass();
boolean owningSide = isOwningSideByDefault();
String mappedBy = getExistingFieldInRelation();
if (mappedBy == null){
// couldn't get the corresponding field automatically, display dialog
CreateRelationshipPanel pnlPickOrCreateField = new CreateRelationshipPanel();
pnlPickOrCreateField.setEntityClassNames(
Utilities.getShortClassName(classHandle.getQualifiedName()),
Utilities.getShortClassName(targetEntityClassName));
pnlPickOrCreateField.setAvailableSelection(getAvailableRelationTypeSelection());
pnlPickOrCreateField.setAvailableFields(compatibleFieldsExistingAtTargetClass);
pnlPickOrCreateField.setDefaultFieldName(genDefaultFieldName());
pnlPickOrCreateField.setExistingFieldNames(fieldsExistingAtTargetClass);
DialogDescriptor ddesc = new DialogDescriptor(pnlPickOrCreateField,
NbBundle.getMessage(AbstractCreateRelationshipHint.class, "LBL_CreateRelationDlgTitle",
relationName, targetEntityClassName));
pnlPickOrCreateField.setDlgDescriptor(ddesc);
Dialog dlg = DialogDisplayer.getDefault().createDialog(ddesc);
dlg.setLocationRelativeTo(null);
dlg.setVisible(true);
if (ddesc.getValue() == DialogDescriptor.OK_OPTION){
String fieldName = null;
if (pnlPickOrCreateField.wasCreateNewFieldSelected()){
// create new
fieldName = pnlPickOrCreateField.getNewIdName();
}else{
// pick existing
fieldName = pnlPickOrCreateField.getSelectedField().toString();
}
owningSide = pnlPickOrCreateField.owningSide();
mappedBy = fieldName;
} else {
mappedBy = null;
}
} else {
owningSide = false;
}
if (mappedBy != null){
modifyFiles(owningSide, mappedBy);
}
return null;
}
示例4: optionsButtonActionPerformed
import java.awt.Dialog; //导入方法依赖的package包/类
private void optionsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_optionsButtonActionPerformed
Dialog window = new ImportOptionsDialog(this);
window.setLocationRelativeTo(this);
window.setVisible(true);
updateCarelinkData();
}