Example usage for javax.swing JOptionPane INFORMATION_MESSAGE

List of usage examples for javax.swing JOptionPane INFORMATION_MESSAGE

Introduction

In this page you can find the example usage for javax.swing JOptionPane INFORMATION_MESSAGE.

Prototype

int INFORMATION_MESSAGE

To view the source code for javax.swing JOptionPane INFORMATION_MESSAGE.

Click Source Link

Document

Used for information messages.

Usage

From source file:de.erdesignerng.visual.MessagesHelper.java

public static void displayInfoMessage(Component aParent, String aMessage, String anInfoText) {
    JOptionPane.showMessageDialog(aParent, StringEscapeUtils.unescapeJava(aMessage), anInfoText,
            JOptionPane.INFORMATION_MESSAGE);
}

From source file:br.usp.poli.lta.cereda.macro.util.DisplayUtils.java

/**
 * Exibe mensagem na tela./*  ww w .  ja  v  a 2 s .c o m*/
 * @param title Ttulo da janela.
 * @param text Texto da mensagem.
 */
public static void showMessage(String title, String text) {
    JOptionPane.showMessageDialog(null, WordUtils.wrap(text, 70), title, JOptionPane.INFORMATION_MESSAGE);
}

From source file:Main.java

public void actionPerformed(ActionEvent e) {
    String menuText = ((JMenuItem) e.getSource()).getText();
    int messageType = JOptionPane.INFORMATION_MESSAGE;
    if (menuText.equals("Information")) {
        messageType = JOptionPane.INFORMATION_MESSAGE;
    } else if (menuText.equals("Warning")) {
        messageType = JOptionPane.WARNING_MESSAGE;
    } else if (menuText.equals("Error")) {
        messageType = JOptionPane.ERROR_MESSAGE;
    } else if (menuText.equals("Plain")) {
        messageType = JOptionPane.PLAIN_MESSAGE;
    }//from  w w w. j  a  v  a 2s.c  o m

    JOptionPane.showMessageDialog(myFrame, "This is message dialog box of type: " + menuText,
            menuText + " Message", messageType);
}

From source file:com.webcrawler.WebCrawlerMain.java

@Override
public void showMessageDialog(String message, String dialogHeader) {
    JOptionPane.showMessageDialog(this, message, dialogHeader, JOptionPane.INFORMATION_MESSAGE);
}

From source file:cz.nn.copytables.gui.CopyTablesGUI.java

private void showDialog(String title, String message) {
    JOptionPane pane = new JOptionPane(message, JOptionPane.INFORMATION_MESSAGE);
    JDialog dialog = pane.createDialog(this, title);
    dialog.setAlwaysOnTop(true);/*from   w ww.  j  av  a 2s . c o  m*/
    dialog.setVisible(true);
    logger.info("setVisible");
}

From source file:com.willwinder.universalgcodesender.utils.GUIHelpers.java

public static void displayHelpDialog(final String helpMessage) {
    java.awt.EventQueue.invokeLater(() -> {
        NarrowOptionPane.showNarrowConfirmDialog(250, helpMessage, Localization.getString("help"),
                JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE);
        //JOptionPane.showMessageDialog(new JFrame(), helpMessage, 
        //        Localization.getString("help"), JOptionPane.INFORMATION_MESSAGE);
    });// w  w w.ja v  a 2 s.  com
}

From source file:rhinova.gui.dataentry.link.LinkDataEntryPanel.java

private void btnCreateActionPerformed(ActionEvent ev) {
    try {/*from   w ww.ja  v  a 2s  .  c  om*/
        // test if the Tableable object can be created
        linkList.createTableable(getUserInputArray());

        // ask for confirmation
        int response = JOptionPane.showConfirmDialog(null, "Do you wish to create this Componenet?", "Confirm?",
                JOptionPane.YES_NO_CANCEL_OPTION);
        if (response == 0) {
            // create the object
            linkList.createAndAddNewInstance(getUserInputArray());
            JOptionPane.showMessageDialog(null, "Model Component Created", "Success",
                    JOptionPane.INFORMATION_MESSAGE);
        }
        // report exceptions to the user
    } catch (IncorrectDataType e) {
        EntityExceptionDialogs.onIncorrectDataType(e.getMessage());
    } catch (ConstraintViolatedException e) {
        EntityExceptionDialogs.onConstraintViolateException(e.getMessage());
    } catch (NullInputException e) {
        EntityExceptionDialogs.onNullInputException(e.getMessage());
    }
}

From source file:latexstudio.editor.DbxFileActions.java

/**
 * Saves progress to dropbox and updates file history (DropboxRevisions)
 *
 * @param drtc to be updated with a new entry (file history)
 *///from  w ww  .j  a  v  a  2  s.  c o m
public void saveProgress(DbxClient client, DropboxRevisionsTopComponent drtc) {
    DbxState dbxState = etc.getDbxState();

    if (client == null) {
        return;
    }

    File file = new File(ApplicationUtils.getTempSourceFile());

    try (FileInputStream inputStream = new FileInputStream(file)) {
        if (dbxState != null) {
            try {
                DbxEntry.File uploadedFile = client.uploadFile(dbxState.getPath(),
                        DbxWriteMode.update(dbxState.getRevision()), file.length(), inputStream);
                JOptionPane.showMessageDialog(null,
                        "Successfuly updated file " + uploadedFile.name + " (" + uploadedFile.humanSize + ")",
                        "File updated in Dropbox", JOptionPane.INFORMATION_MESSAGE);
                drtc.updateRevisionsList(uploadedFile.path);
                etc.setDbxState(new DbxState(uploadedFile.path, uploadedFile.rev));
            } catch (DbxException ex) {
                DbxUtil.showDbxAccessDeniedPrompt();
            } catch (IOException ex) {
                Exceptions.printStackTrace(ex);
            } finally {
                IOUtils.closeQuietly(inputStream);
                etc.setModified(false);
            }
        } else {
            JOptionPane.showMessageDialog(null,
                    "No Dropbox file has been loaded.\n" + "You must open Dropbox file, before you save it.",
                    "Cannot save progress", JOptionPane.WARNING_MESSAGE);
        }
    } catch (IOException ex) {
        Exceptions.printStackTrace(ex);
    }
}

From source file:rhinova.gui.dataentry.reserve.ReserveDataEntryPanel.java

private void btnCreateReserveActionPerformed(ActionEvent ev) {
    try {// www .j a v a 2  s.c  o m
        // test if the Tableable object can be created
        reserveList.createTableable(getUserInputArray());

        // ask for confirmation
        int response = JOptionPane.showConfirmDialog(null, "Do you wish to create this Componenet?", "Confirm?",
                JOptionPane.YES_NO_CANCEL_OPTION);
        if (response == 0) {
            // create the object
            reserveList.createAndAddNewInstance(getUserInputArray());
            JOptionPane.showMessageDialog(null, "Model Component Created", "Success",
                    JOptionPane.INFORMATION_MESSAGE);
        }
        // report exceptions to the user
    } catch (IncorrectDataType e) {
        EntityExceptionDialogs.onIncorrectDataType(e.getMessage());
    } catch (ConstraintViolatedException e) {
        EntityExceptionDialogs.onConstraintViolateException(e.getMessage());
    } catch (NullInputException e) {
        EntityExceptionDialogs.onNullInputException(e.getMessage());
    }
}

From source file:com.tapontikes.java.doUpload.java

public void checkExist() throws IOException {

    _ftp.changeWorkingDirectory("/public_html");

    String[] files = _ftp.listNames();

    if (Arrays.asList(files).contains(local_file.getName())) {
        JOptionPane.showMessageDialog(null, local_file.getName() + " already exists on the server.", "Alert!",
                JOptionPane.INFORMATION_MESSAGE);
        System.exit(0);//from  w w  w  .ja v a2s .com
    }
    _ftp.changeWorkingDirectory("/");

}