Here you can find the source of drawHelpPanel(String helpToDisplay, final JFrame frame)
private static void drawHelpPanel(String helpToDisplay, final JFrame frame)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013 DHBW.// w w w. j av a 2 s . com * This source is subject to the DHBW Permissive License. * Please see the License.txt file for more information. * All other rights reserved. * * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A * PARTICULAR PURPOSE. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * *Project: Zombiz *Package: com.dhbw.zombiz ********************************************************************************/ import java.awt.Color; import java.awt.image.BufferedImage; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; public class Main { private static BufferedImage bg; private static void drawHelpPanel(String helpToDisplay, final JFrame frame) { JPanel panel = new JPanel(); panel.setBackground(Color.black); panel.setBounds(10, 500, 780, 50); frame.getContentPane().removeAll(); JLabel helpLabel = new JLabel(helpToDisplay); helpLabel.setForeground(Color.white); panel.add(helpLabel); frame.add(panel); JLabel label = new JLabel(new ImageIcon(bg)); frame.add(label); panel.setVisible(true); frame.validate(); frame.repaint(); } }