Package views

Source Code of views.ButtonPanel

package views;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.MouseListener;

import javax.swing.*;

import controllers.ButtonHelpManager;

public class ButtonPanel extends JPanel{

  /**
   *
   */
  private static final long serialVersionUID = 1L;
 
  private JButton drawButton;
  private JButton stayButton;
  private JButton betButton1;
  private JButton betButton10;
  private JButton betButton50;
  private JButton betButton100;
  private HelpPanel helpPanel;
 
  public ButtonPanel(HelpPanel helpPanel){
    super(new GridLayout(2,1));
    this.setBorder(BorderFactory.createLineBorder(Color.black));
    this.helpPanel = helpPanel;
    drawButton=new JButton("Carte");
    stayButton=new JButton("Je reste");
    betButton1=new JButton("1");
    betButton10=new JButton("10");
    betButton50=new JButton("50");
    betButton100=new JButton("100");
    JPanel upButtons = new JPanel(new FlowLayout());
    upButtons.add(new JLabel("Contr�les"));
    upButtons.add(drawButton);
    upButtons.add(stayButton);
    this.add(upButtons);
    JPanel downButtons = new JPanel(new GridLayout(5,1));
    downButtons.add(new JLabel("Mises"));
    downButtons.add(betButton1);
    downButtons.add(betButton10);
    downButtons.add(betButton50);
    downButtons.add(betButton100);
    this.add(downButtons);
    MouseListener listener = new ButtonHelpManager(helpPanel);
    drawButton.addMouseListener(listener);
    stayButton.addMouseListener(listener);
    betButton1.addMouseListener(listener);
    betButton10.addMouseListener(listener);
    betButton50.addMouseListener(listener);
    betButton100.addMouseListener(listener);
  }
}
TOP

Related Classes of views.ButtonPanel

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.