Here you can find the source of warning(String Msg)
Parameter | Description |
---|---|
Msg | the warning message to display. |
public static boolean warning(String Msg)
//package com.java2s; //License from project: Open Source License import java.awt.Component; import java.awt.Frame; import javax.swing.JOptionPane; public class Main { private static Frame displayFrame = null; /**/*from w w w. ja v a2s.c om*/ * utility ftn; prints warning dialog message to the user, * *without* echoing to the log ftn. Basically wrapper to JOptionPane * * @param caller the GUI component calling (required for dialog box drawing) * @param Msg a short one line message to display to the user * @return returns false for easy chaining. */ public static boolean warning(Component caller, String Msg, String Title) { JOptionPane.showMessageDialog(caller, Msg, Title, JOptionPane.WARNING_MESSAGE); return false; // for chaining } /** * Short version of warning method - uses default frame, and has the * title 'Warning'. * @param Msg the warning message to display. */ public static boolean warning(String Msg) { if (displayFrame == null) // no default display registered { System.out.println("warning display not initialised! (error was: " + Msg + ")"); return false; } return warning(displayFrame, Msg, "Warning"); } }