List of utility methods to do JOptionPane Prompt
int | askYesNo(String title, String prompt, Object... args) ask Yes No return JOptionPane.showConfirmDialog(getFrontWindow(), String.format(prompt, args), title,
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
|
File | promptForDatsDir(Component parentComponent) Modally prompts the user for the FTL resources dir. File result = null; String message = ""; message += "You will now be prompted to locate FTL manually.\n"; message += "Select '(FTL dir)/resources/data.dat'.\n"; message += "Or 'FTL.app', if you're on OSX."; JOptionPane.showMessageDialog(parentComponent, message, "Find FTL", JOptionPane.INFORMATION_MESSAGE); final JFileChooser fc = new JFileChooser(); fc.setDialogTitle("Find data.dat or FTL.app"); ... |
String | promptForDecryptionPassword() prompt For Decryption Password JPanel decryptionPasswordInputPanel = new JPanel(new GridLayout(1, 2)); JPasswordField decryptionPasswordPrompt = new JPasswordField(); decryptionPasswordInputPanel.add(new JLabel("Enter decryption password:")); decryptionPasswordInputPanel.add(decryptionPasswordPrompt); int result = JOptionPane.showConfirmDialog(null, decryptionPasswordInputPanel, "Decryption Password", JOptionPane.OK_CANCEL_OPTION); if (result == JOptionPane.OK_OPTION) { return new String(decryptionPasswordPrompt.getPassword()); ... |
boolean | promptForDelete(Component c, String title, String prompt) prompt For Delete return (JOptionPane.showConfirmDialog(findWindow(c), prompt, title,
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION);
|
boolean | promptForDelete(Component c, String title, String prompt) prompt For Delete return (JOptionPane.showConfirmDialog(c, prompt, title,
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION);
|
void | showDbxAccessDeniedPrompt() show Dbx Access Denied Prompt JOptionPane.showMessageDialog(null, "The application failed to connect to your Dropbox account.\nThis might mean that " + "your access token is no longer valid or you are not connected to the Internet.", "Could not connect to Dropbox", JOptionPane.ERROR_MESSAGE); |