Package wuxingthegame1

Source Code of wuxingthegame1.Frame

package wuxingthegame1;

import java.awt.Color;
import javax.swing.JPanel;
import metier.Element;
import metier.Pair;
import metier.Question;

/**
*
* @author Alexandre
*/
public class Frame extends javax.swing.JFrame {

    public Frame() {
        initComponents();
        this.setResizable(false);
        setContentPane(new Connexion(this));    
        this.setVisible(true);
       
        Question q1 = getQuestion1();
    }
   
    public Question getQuestion1(){
        Question question = new Question(1);
        question.setIntitule("Placer les saisons");
        question.setExplaination("Explanations?");

  //Cases
        Element e1 = new Element();
        e1.setLibelle("Feu");
        e1.setUrl_image("/ressources/Element_Feu.png");
        e1.setID(1);
        question.addFixedElement(e1);
   
        Element e2 = new Element();
        e2.setLibelle("Eau");
        e2.setUrl_image("/ressources/Element_Eau.png");
        e2.setID(2);
        question.addFixedElement(e2);
   
        Element e3 = new Element();
        e3.setLibelle("Terre");
        e3.setUrl_image("/ressources/Element_Terre.png");
        e3.setID(3);
        question.addFixedElement(e3);
   
        Element e4 = new Element();
        e4.setLibelle("Eau");
        e4.setUrl_image("/ressources/Element_Metal.png");
        e4.setID(4);
        question.addFixedElement(e4);
   
        Element e5 = new Element();
        e5.setLibelle("Bois");
        e5.setUrl_image("/ressources/Element_Bois.png");
        e5.setID(5);
        question.addFixedElement(e5);
   
  //Mots à placer
  Element e6 = new Element();
        e6.setLibelle("Rate");
        e6.setUrl_image("/ressources/rate.png");
  question.addMovableElement(1, e6);
   
  Element e7 = new Element();
        e7.setLibelle("Poumon");
        e7.setUrl_image("/ressources/poumon.png");
  question.addMovableElement(2, e7);
   
  Element e8 = new Element();
        e8.setLibelle("Reins");
        e7.setUrl_image("/ressources/reins.png");
  question.addMovableElement(3, e8);
   
  Element e9 = new Element();
        e9.setLibelle("Coeur");
        e7.setUrl_image("/ressources/coeur.png");
  question.addMovableElement(5, e9);
   
        return question;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setPreferredSize(new java.awt.Dimension(1280, 720));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 714, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 398, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    public void setPanel (JPanel p)
    {
        //this.removeAll();
        this.setContentPane(p);
        this.setVisible(true);
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
}
TOP

Related Classes of wuxingthegame1.Frame

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.