本文整理汇总了Java中java.awt.Dialog.setResizable方法的典型用法代码示例。如果您正苦于以下问题:Java Dialog.setResizable方法的具体用法?Java Dialog.setResizable怎么用?Java Dialog.setResizable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.Dialog
的用法示例。
在下文中一共展示了Dialog.setResizable方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showDialog
import java.awt.Dialog; //导入方法依赖的package包/类
public boolean showDialog() {
DialogDescriptor dialogDescriptor = new DialogDescriptor(panel,
org.openide.util.NbBundle.getMessage(RevertModifications.class, "CTL_UpdateDialog", repository.getName()), // NOI18N
true,
new Object[] {okButton, cancelButton},
okButton,
DialogDescriptor.DEFAULT_ALIGN,
new HelpCtx(this.getClass()),
null);
dialogDescriptor.setValid(false);
Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor);
dialog.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(RevertModifications.class, "ACSD_UpdateDialog", repository.getName())); // NOI18N
dialog.setVisible(true);
dialog.setResizable(false);
boolean ret = dialogDescriptor.getValue() == okButton;
return ret;
}
示例2: showDialog
import java.awt.Dialog; //导入方法依赖的package包/类
public boolean showDialog() {
DialogDescriptor dialogDescriptor = new DialogDescriptor(panel, org.openide.util.NbBundle.getMessage(UpdateTo.class, "CTL_UpdateToDialog")); // NOI18N
dialogDescriptor.setOptions(new Object[] {okButton, cancelButton});
dialogDescriptor.setModal(true);
dialogDescriptor.setHelpCtx(new HelpCtx(this.getClass()));
dialogDescriptor.setValid(false);
Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor);
dialog.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(UpdateTo.class, "ACSD_UpdateToDialog")); // NOI18N
dialog.setVisible(true);
dialog.setResizable(false);
boolean ret = dialogDescriptor.getValue() == okButton;
return ret;
}
示例3: showDialog
import java.awt.Dialog; //导入方法依赖的package包/类
public boolean showDialog() {
DialogDescriptor dialogDescriptor = new DialogDescriptor(panel, org.openide.util.NbBundle.getMessage(RevertModifications.class, "CTL_RevertDialog")); // NOI18N
dialogDescriptor.setOptions(new Object[] {okButton, cancelButton});
dialogDescriptor.setModal(true);
dialogDescriptor.setHelpCtx(new HelpCtx(this.getClass()));
dialogDescriptor.setValid(false);
Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor);
dialog.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(RevertModifications.class, "ACSD_RevertDialog")); // NOI18N
dialog.setVisible(true);
dialog.setResizable(false);
boolean ret = dialogDescriptor.getValue() == okButton;
return ret;
}
示例4: performAction
import java.awt.Dialog; //导入方法依赖的package包/类
public void performAction () {
DialogDescriptor descriptor = new DialogDescriptor(
new org.netbeans.core.ui.ProductInformationPanel (),
NbBundle.getMessage(AboutAction.class, "About_title"),
true,
new Object[0],
null,
DialogDescriptor.DEFAULT_ALIGN,
null,
null);
Dialog dlg = null;
try {
dlg = DialogDisplayer.getDefault().createDialog(descriptor);
if( Utilities.isMac() && dlg instanceof JDialog ) {
JDialog d = (JDialog) dlg;
InputMap map = d.getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
map.put(KeyStroke.getKeyStroke(KeyEvent.VK_W, KeyEvent.META_MASK), "Escape"); //NOI18N
//#221571
d.getRootPane().putClientProperty("nb.about.dialog", Boolean.TRUE); //NOI18N
}
dlg.setResizable(false);
dlg.setVisible(true);
} finally {
if (dlg != null) {
dlg.dispose();
}
}
}
示例5: askPassword
import java.awt.Dialog; //导入方法依赖的package包/类
@Override
public boolean askPassword(ExecutionEnvironment execEnv, String key) {
Mnemonics.setLocalizedText(promptLabel, NbBundle.getMessage(CertPassphraseDlg.class, "CertPassphraseDlg.promptLabel.text", key)); // NOI18N
tfUser.setText(execEnv.getUser());
String hostName = execEnv.getHost();
if (execEnv.getSSHPort() != 22) {
hostName += ":" + execEnv.getSSHPort(); //NOI18N
}
tfHost.setText(hostName); // NOI18N
DialogDescriptor dd = new DialogDescriptor(this,
NbBundle.getMessage(CertPassphraseDlg.class, "CertPassphraseDlg.title.text"), // NOI18N
true, // NOI18N
new Object[]{
DialogDescriptor.OK_OPTION,
DialogDescriptor.CANCEL_OPTION},
DialogDescriptor.OK_OPTION,
DialogDescriptor.DEFAULT_ALIGN, null, null);
Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
dialog.setResizable(false);
try {
dialog.setVisible(true);
} catch (Throwable th) {
if (!(th.getCause() instanceof InterruptedException)) {
throw new RuntimeException(th);
}
dd.setValue(DialogDescriptor.CANCEL_OPTION);
} finally {
dialog.dispose();
}
return dd.getValue() == DialogDescriptor.OK_OPTION;
}
示例6: askPassword
import java.awt.Dialog; //导入方法依赖的package包/类
@Override
public boolean askPassword(ExecutionEnvironment execEnv, String prompt) {
tfUser.setText(execEnv.getUser());
String hostName = execEnv.getHost();
if (execEnv.getSSHPort() != 22) {
hostName += ":" + execEnv.getSSHPort(); //NOI18N
}
tfHost.setText(hostName); // NOI18N
cbRememberPwd.setSelected(PasswordManager.getInstance().isRememberPassword(execEnv));
DialogDescriptor dd = new DialogDescriptor(this,
loc("TITLE_Password"), true, // NOI18N
new Object[]{
DialogDescriptor.OK_OPTION,
DialogDescriptor.CANCEL_OPTION},
DialogDescriptor.OK_OPTION,
DialogDescriptor.DEFAULT_ALIGN, null, null);
Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
dialog.setResizable(false);
try {
dialog.setVisible(true);
} catch (Throwable th) {
if (!(th.getCause() instanceof InterruptedException)) {
throw new RuntimeException(th);
}
dd.setValue(DialogDescriptor.CANCEL_OPTION);
} finally {
dialog.dispose();
}
return dd.getValue() == DialogDescriptor.OK_OPTION;
}
示例7: initAuthentication
import java.awt.Dialog; //导入方法依赖的package包/类
/**
*
* @param auth
* @return false if cancelled
*/
public boolean initAuthentication(final Authentication auth) {
AuthenticationSettingsPanel vpanel = new AuthenticationSettingsPanel(auth, false);
vpanel.addValidationListener(new AuthValidationListener());
cfgPanel.add(vpanel, BorderLayout.CENTER);
DialogDescriptor dd = new DialogDescriptor(this,
NbBundle.getMessage(AuthTypeSelectorDlg.class, "TITLE_AuthTypeSelectorDlg"), // NOI18N
true, new Object[]{ok, DialogDescriptor.CANCEL_OPTION}, ok,
DialogDescriptor.DEFAULT_ALIGN, null, null);
Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
dialog.setResizable(false);
try {
dialog.setVisible(true);
} catch (Throwable th) {
if (!(th.getCause() instanceof InterruptedException)) {
throw new RuntimeException(th);
}
dd.setValue(DialogDescriptor.CANCEL_OPTION);
} finally {
dialog.dispose();
}
if (dd.getValue() == ok) {
vpanel.applyChanges(null);
return true;
} else {
return false;
}
}
示例8: showDialog
import java.awt.Dialog; //导入方法依赖的package包/类
public boolean showDialog() {
DialogDescriptor dialogDescriptor = new DialogDescriptor(panel, org.openide.util.NbBundle.getMessage(Clone.class, "CTL_CloneDialog"), // NOI18N
true, new Object[] {okButton, cancelButton}, okButton, DialogDescriptor.DEFAULT_ALIGN, new HelpCtx(this.getClass()), null);
dialogDescriptor.setValid(false);
Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor);
dialog.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(Clone.class, "ACSD_CloneDialog")); // NOI18N
dialog.setVisible(true);
dialog.setResizable(false);
boolean ret = dialogDescriptor.getValue() == okButton;
return ret;
}
示例9: hierarchyChanged
import java.awt.Dialog; //导入方法依赖的package包/类
@Override
public void hierarchyChanged(HierarchyEvent e) {
Window window = SwingUtilities.getWindowAncestor(pane);
if (window instanceof Dialog) {
Dialog dialog = (Dialog) window;
if (!dialog.isResizable()) {
dialog.setResizable(true);
}
}
}
示例10: main
import java.awt.Dialog; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
Robot robot = new Robot();
for(int i = 0; i < 10; i++) {
Dialog dialog = new Dialog((Frame) null);
dialog.setLocation(100, 100);
Component panel = new Panel();
panel.setPreferredSize(new Dimension(200, 100));
dialog.add(panel);
dialog.pack();
dialog.setVisible(true);
robot.waitForIdle();
robot.delay(200);
Point frameLoc = dialog.getLocationOnScreen();
Point contentLoc = panel.getLocationOnScreen();
System.out.println("Decor location " + frameLoc);
System.out.println("Content location " + contentLoc);
dialog.setResizable(false);
robot.waitForIdle();
robot.delay(200);
Point l = dialog.getLocationOnScreen();
if (!l.equals(frameLoc)) {
dialog.dispose();
throw new RuntimeException("Decorated frame location moved " +
"after setResizable(false)" + l);
}
l = panel.getLocationOnScreen();
if (!l.equals(contentLoc)) {
dialog.dispose();
throw new RuntimeException("Content location moved after " +
"setResizable(false)" + l);
}
if (panel.getLocationOnScreen().y <
dialog.getLocationOnScreen().y + dialog.getInsets().top) {
dialog.dispose();
throw new RuntimeException(
"Wrong content position after setResizable(false)");
}
dialog.setResizable(true);
robot.waitForIdle();
robot.delay(200);
l = dialog.getLocationOnScreen();
if (!l.equals(frameLoc)) {
dialog.dispose();
throw new RuntimeException("Decorated frame location moved " +
"after setResizable(true)" + l);
}
l = panel.getLocationOnScreen();
if (!l.equals(contentLoc)) {
dialog.dispose();
throw new RuntimeException("Content location moved after " +
"setResizable(true)" + l);
}
if (panel.getLocationOnScreen().y <
dialog.getLocationOnScreen().y + dialog.getInsets().top) {
dialog.dispose();
throw new RuntimeException(
"Wrong content position after setResizable(true)");
}
dialog.dispose();
}
}