Package view

Source Code of view.main_menu

package view;

import java.awt.GridLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;

import custom_swing.JImgLabel;

public class main_menu extends JPanel{
 
  /**
   *
   */
  private static final long serialVersionUID = 1L;
 
  String name = "";
  JLabel namel = new JLabel("name");
  JImgLabel play = new JImgLabel("Spielen","./src/img/menu_punkt_bg.png");
  JImgLabel view_profile_data = new JImgLabel("Profil ansehen","./src/img/menu_punkt_bg.png");
  JImgLabel deck_construction = new JImgLabel("Deckaufbau","./src/img/menu_punkt_bg.png");
  JImgLabel shop = new JImgLabel("Karten kaufen","./src/img/menu_punkt_bg.png");
  JImgLabel back = new JImgLabel("Zur Spielerauswahl","./src/img/menu_punkt_bg.png");
 
  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
    namel.setText(name);
  }

  public main_menu() {
    super();
    this.setLayout(new GridLayout(1,2,50,0));
    JPanel menu = new JPanel();
    menu.setLayout(new GridLayout(8,1,0,40));
    menu.add(new JLabel(""));
   
    deck_construction.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
        main_window.deckbuilder.setG(main_window.selected_gambler);
              main_window.showCard("Deck");
        }
    });
   
    namel.setFont(main_window.getFont(30));
    menu.add(namel);
    menu.add(play);
    menu.add(view_profile_data);
    menu.add(deck_construction);
    menu.add(shop);
    menu.add(back);
    menu.add(new JLabel(""));
    menu.setOpaque(false);
   
    JImgLabel img = new JImgLabel("","./src/img/BG_Stone.png");
   
    this.add(menu);
    this.add(img);
   
    this.setOpaque(false);
    this.setVisible(true);
  }
 

}
TOP

Related Classes of view.main_menu

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.