Java JFrame drawHelpPanel(String helpToDisplay, final JFrame frame)

Here you can find the source of drawHelpPanel(String helpToDisplay, final JFrame frame)

Description

draw Help Panel

License

Open Source License

Declaration

private static void drawHelpPanel(String helpToDisplay,
            final JFrame frame) 

Method Source Code

//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();
    }
}

Related

  1. displayConfirmationMessage(JFrame parent, String message, String title)
  2. displayError(Exception e, JFrame jFrame)
  3. displayWindow(final JFrame window)
  4. dispose(final JFrame frame)
  5. doDisableActiveRenderingInEDT(final JFrame jFrame)
  6. enable(final JFrame frame)
  7. enterFullScreenIfPossible(JFrame mainAppFrame)
  8. error(JFrame frame, String msg)
  9. exitFullScreen(JFrame mainAppFrame)