Here you can find the source of error(JFrame frame, String msg)
public static void error(JFrame frame, String msg)
//package com.java2s; /**/*from w ww.j a v a2 s.co m*/ * Copyright (c) 2001-2016 Mathew A. Nelson and Robocode contributors * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://robocode.sourceforge.net/license/epl-v10.html */ import javax.swing.*; public class Main { public static void error(JFrame frame, String msg) { Object[] options = { "OK" }; JOptionPane.showOptionDialog(frame, msg, "Error", JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE, null, options, options[0]); } }