Java JOptionPane Info infoMessage(Component owner, String title, String message, ModalityType modalityType)

Here you can find the source of infoMessage(Component owner, String title, String message, ModalityType modalityType)

Description

Use this instead of JOptionPane.showMessageDialog(..., JOptionPane.INFORMATION_MESSAGE)

License

Open Source License

Parameter

Parameter Description
owner a parameter
title a parameter
message a parameter
modalityType a parameter

Declaration

public static void infoMessage(Component owner, String title, String message, ModalityType modalityType) 

Method Source Code

//package com.java2s;
/*//from w  w w  . j  a  v  a 2s.  c o m
 * Copyright (c) 2004-2013 Universidade do Porto - Faculdade de Engenharia
 * Laborat?rio de Sistemas e Tecnologia Subaqu?tica (LSTS)
 * All rights reserved.
 * Rua Dr. Roberto Frias s/n, sala I203, 4200-465 Porto, Portugal
 *
 * This file is part of Neptus, Command and Control Framework.
 *
 * Commercial Licence Usage
 * Licencees holding valid commercial Neptus licences may use this file
 * in accordance with the commercial licence agreement provided with the
 * Software or, alternatively, in accordance with the terms contained in a
 * written agreement between you and Universidade do Porto. For licensing
 * terms, conditions, and further information contact lsts@fe.up.pt.
 *
 * European Union Public Licence - EUPL v.1.1 Usage
 * Alternatively, this file may be used under the terms of the EUPL,
 * Version 1.1 only (the "Licence"), appearing in the file LICENCE.md
 * included in the packaging of this file. You may not use this work
 * except in compliance with the Licence. Unless required by applicable
 * law or agreed to in writing, software distributed under the Licence is
 * distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF
 * ANY KIND, either express or implied. See the Licence for the specific
 * language governing permissions and limitations at
 * https://www.lsts.pt/neptus/licence.
 *
 * For more information please see <http://lsts.fe.up.pt/neptus>.
 *
 * Author: 
 * 24/Fev/2005
 */

import java.awt.Component;
import java.awt.Dialog.ModalityType;

import javax.swing.JDialog;

import javax.swing.JOptionPane;

public class Main {
    /**
     * Use this instead of JOptionPane.showMessageDialog(..., JOptionPane.INFORMATION_MESSAGE)
     * Default ModalityMode.DOCUMENT_MODAL
     * @param owner
     * @param title
     * @param message
     */
    public static void infoMessage(Component owner, String title, String message) {
        infoMessage(owner, title, message, ModalityType.DOCUMENT_MODAL);
    }

    /**
     * Use this instead of JOptionPane.showMessageDialog(..., JOptionPane.INFORMATION_MESSAGE)
     * @param owner
     * @param title
     * @param message
     * @param modalityType
     */
    public static void infoMessage(Component owner, String title, String message, ModalityType modalityType) {
        // JOptionPane.showMessageDialog(owner, message, title,
        // JOptionPane.INFORMATION_MESSAGE);
        JOptionPane jop = new JOptionPane(message, JOptionPane.INFORMATION_MESSAGE);
        JDialog dialog = jop.createDialog(owner, title);
        dialog.setModalityType(modalityType);
        dialog.setVisible(true);
    }
}

Related

  1. info(Component component, String title, String msg)
  2. info(Component parent, String message)
  3. info(Component parent, String message)
  4. info(String message, Component parent)
  5. infoBox(String message, String title)
  6. infoMsg(final String msg)
  7. infoMsg(String msg)
  8. inform(String dlgTitle, String info, Component parent)
  9. inform(String message)