1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652
| import java.awt.BorderLayout;
import java.awt.Color;
import javax.swing.JPanel;
import javax.swing.JOptionPane;
import javax.swing.JButton;
import javax.swing.JLabel;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.ImageIcon;
import javax.swing.JApplet;
public class Quisuisje extends JApplet {
public void init() {
this.setBackground(Color.BLACK);
setSize(1350,700);
setContentPane(new Quisuisje1());
}
static class Quisuisje1 extends JPanel implements ActionListener {
/**
*
*/
private static final long serialVersionUID = 1L;
public static void main(String[] args){}
JButton bouton = new JButton(new ImageIcon("C:/image/menu4.jpg"));
JLabel label = new JLabel();;
Quisuisje1() {
setLayout(new BorderLayout(5,5));
add(bouton, BorderLayout.CENTER);
add(label, BorderLayout.NORTH);
this.setBackground(Color.white);
bouton.addActionListener(this);
}
public void actionPerformed(ActionEvent evt) {
int z;
z=20;
String A;
A="Edith Piaf"; // Fait.
String B;
B="Brad Pitt"; // Fait.
String C;
C="Gerard Depardieu"; // Fait.
String D;
D="Jean-Claude Van Damme"; // Fait.
String E;
E="Jennifer Anniston"; // Fait.
String F;
F="Jonny Depp"; // Fait.
String G;
G="Mike Tyson"; // Fait.
String H;
H="Michael Jackson"; // Fait.
String I;
I="Mohamed Ali"; // Fait.
String J;
J="Mylene Farmer"; // Fait.
String K;
K="Pierre Menes"; // Fait.
String L;
L="NOS"; // Fait.
String M;
M="Rihanna"; // Fait.
String N;
N="Zidane"; // Fait.
String O;
O="Abraham Lincoln"; // Fait.
String P;
P="George Clooney"; // Fait.
String Q;
Q="Pere Noel"; // Fait.
String R;
R="Ronaldhino"; // Fait.
String S;
S="Lluis Llach"; // Fait.
String T;
T="Victor Hugo"; // Fait.
String[] choix = {"oui", "non"};
Object reponse = JOptionPane.showInputDialog
(null,
"Est-ce'que votre personnage est un Homme ?",
"Qui-Suis-Je ?",
JOptionPane.QUESTION_MESSAGE,
new ImageIcon("C:/image/im.png"),
choix,
choix[0]);
if (reponse.equals("oui")) {// Si Homme
A="0";
E="0";
J="0";
M="0";
z=z-4;
Object rep1 = JOptionPane.showInputDialog
(null,
"Est-ce-que votre personnage est Brun ?",
"Qui-Suis-Je?",
JOptionPane.QUESTION_MESSAGE,
new ImageIcon("C:/image/im.png"),
choix,
choix[0]);
if (rep1.equals("oui")) {// Si Homme Brun
B="0";
P="0";
C="0";
G="0";
K="0";
L="0";
Q="0";
N="0";
T="0";
z=z-9;
Object rep2 = JOptionPane.showInputDialog
(null,
"Est-ce-que votre personnage a des lunettes ?",
"Qui-Suis-Je ?",
JOptionPane.QUESTION_MESSAGE,
new ImageIcon("C:/image/im.png"),
choix,
choix[0]);
if (rep2.equals("oui")){// Si Homme Brun lunettes
D="0";
I="0";
O="0";
R="0";
T="0";
S="0";
z=z-6;
if (z==1){
label = new JLabel(new ImageIcon("C:/image/jonny.gif"));
add(label, BorderLayout.NORTH);
label.setText("Votre personnage est Jonny Depp");
}
}
if (rep2.equals("non")){// Si Homme Brun pas lunettes
F="0";
z=z-1;
Object rep3 = JOptionPane.showInputDialog
(null,
"Est-ce-que votre personnage a une pilosité faciale importante ?",
"Qui-Suis-Je ?",
JOptionPane.QUESTION_MESSAGE,
new ImageIcon("C:/image/im.png"),
choix,
choix[0]);
if (rep3.equals("oui")){// Si Homme; Brun; pas lunettes; pilosité
D="0";
H="0";
I="0";
R="0";
S="0";
z=z-5;
if (z==1){
label = new JLabel(new ImageIcon("C:/image/lincoln.gif"));
add(label, BorderLayout.NORTH);
label.setText("Votre personnage est Abraham Lincoln");
}
}
// Si Homme Brun pas Lunettes pas Pilosité
if (rep3.equals("non")){
O="0";
z=z-1;
Object rep4 = JOptionPane.showInputDialog
(null,
"Est-ce-que votre personnage a une forte corpolence ?",
"Qui-Suis-Je ?",
JOptionPane.QUESTION_MESSAGE,
new ImageIcon("C:/image/im.png"),
choix,
choix[0]);
// Si Homme; Brun; pas Lunettes; pas Pilosité; pas Corpulent
if (rep4.equals("non")){
I="0";
D="0";
z=z-2;
Object rep5 = JOptionPane.showInputDialog
(null,
"Est-ce-que votre personnage a les yeux vert ?",
"Qui-Suis-Je ?",
JOptionPane.QUESTION_MESSAGE,
new ImageIcon("C:/image/im.png"),
choix,
choix[0]);
// Si Homme; Brun; pas Lunettes; pas Pilosité; pas Corpulent; Yeux vert
if (rep5.equals("oui")){
R="0";
H="0";
z=z-2;
if (z==1){
label = new JLabel(new ImageIcon("C:/image/lluis-llach.jpg"));
add(label, BorderLayout.NORTH);
label.setText("Votre personnage est Lluis Llach ");
}
}
// Si Homme; Brun; pas Lunettes; pas Pilosité; pas Corpulent; pas Yeux vert
if (rep5.equals("non")){
S="0";
z=z-1;
Object rep6 = JOptionPane.showInputDialog
(null,
"Est-ce-que votre personnage a les cheveux au dessus des épaules (Mi-Long) ?",
"Qui-Suis-Je ?",
JOptionPane.QUESTION_MESSAGE,
new ImageIcon("C:/image/im.png"),
choix,
choix[0]);
// Si Homme; Brun; pas Lunettes; pas Pilosité; pas Corpulent; pas Yeux vert; Mi-Long
if (rep6.equals("oui")){
R="0";
z=z-1;
if (z==1){
label = new JLabel(new ImageIcon("C:/image/MJ.gif"));
add(label, BorderLayout.NORTH);
label.setText("Votre personnage est Michael Jackson");
}
}
// Si Homme; Brun; pas Lunettes; pas Pilosité; pas Corpulent; pas Yeux vert; pas Mi-Long
if (rep6.equals("non")){
H="0";
z=z-1;
if (z==1){
label = new JLabel(new ImageIcon("C:/image/Ronaldhino.gif"));
add(label, BorderLayout.NORTH);
label.setText("Votre personnage est Ronaldhino ");
}
}
}
}
// Si Homme; Brun; pas Lunettes; pas Pilosité; Corpulent
if (rep4.equals("oui")){
H="0";
R="0";
S="0";
z=z-3;
Object rep7 = JOptionPane.showInputDialog
(null,
"Est-ce-que votre personnage a une peau blanche ?",
"Qui-Suis-Je ?",
JOptionPane.QUESTION_MESSAGE,
new ImageIcon("C:/image/im.png"),
choix,
choix[0]);
// Si Homme; Brun; pas Lunettes; pas Pilosité; Corpulent; Blanc
if (rep7.equals("oui")){
I="0";
z=z-1;
if (z==1){
label = new JLabel(new ImageIcon("C:/image/jcvd.gif"));
add(label, BorderLayout.NORTH);
label.setText("Votre personnage est Jean Claude Van Damme ");
}
}
// Si Homme; Brun; pas Lunettes; pas Pilosité; Corpulant; pas Blanc
if (rep7.equals("non")){
D="0";
z=z-1;
if (z==1){
label = new JLabel(new ImageIcon("C:/image/momo.gif"));
add(label, BorderLayout.NORTH);
label.setText("Votre personnage est Mohammed Ali ");
}
}
}
}
}
}
// Si Homme pas Brun
if (rep1.equals("non")){
O="0";
R="0";
S="0";
H="0";
D="0";
F="0";
I="0";
z=z-7;
Object rep8 = JOptionPane.showInputDialog
(null,
"Est-ce-que votre personnage a les yeux Marrons ?",
"Qui-Suis-Je ?",
JOptionPane.QUESTION_MESSAGE,
new ImageIcon("C:/image/im.png"),
choix,
choix[0]);
//Si Homme; pas Brun; Yeux Marron
if (rep8.equals("oui")){
Q="0";
C="0";
B="0";
N="0";
z=z-4;
Object rep9 = JOptionPane.showInputDialog
(null,
"Est-ce-que votre personnage a les Cheveux court ?",
"Qui-Suis-Je ?",
JOptionPane.QUESTION_MESSAGE,
new ImageIcon("C:/image/im.png"),
choix,
choix[0]);
//Si Homme; pas Brun; Yeux Marron; Cheveux court
if (rep9.equals("oui")){
G="0";
L="0";
z=z-2;
Object rep10 = JOptionPane.showInputDialog
(null,
"Est-ce-que votre personnage a une pilosité faciale ?",
"Qui-Suis-Je ?",
JOptionPane.QUESTION_MESSAGE,
new ImageIcon("C:/image/im.png"),
choix,
choix[0]);
//Si Homme; pas Brun; Yeux Marron; Cheveux court; Pilosité
if (rep10.equals("oui")){
K="0";
z=z-1;
Object rep11 = JOptionPane.showInputDialog
(null,
"Est-ce-que votre personnage a une forte corpulence ?",
"Qui-Suis-Je ?",
JOptionPane.QUESTION_MESSAGE,
new ImageIcon("C:/image/im.png"),
choix,
choix[0]);
//Si Homme; pas Brun; Yeux Marron; Cheveux court; Pilosité; Fort
if (rep11.equals("oui")){
P="0";
z=z-1;
if (z==1){
label = new JLabel(new ImageIcon("C:/image/Victor Hugo.jpg"));
add(label, BorderLayout.NORTH);
label.setText("Votre personnage est Victor Hugo");
}
}
//Si Homme; pas Brun; Yeux Marron; Cheveux court; Pilosité; pas Fort
if (rep11.equals("non")){
T="0";
z=z-1;
if (z==1){
label = new JLabel(new ImageIcon("C:/image/clooney.gif"));
add(label, BorderLayout.NORTH);
label.setText("Votre personnage est George Clonney");
}
}
}
//Si Homme; pas Brun; Yeux Marron; Cheveux court; pas Pilosité
if (rep10.equals("non")){
P="0";
T="0";
z=z-2;
if (z==1){
label.setText("Votre personnage est Pierre Menes");
add(label, BorderLayout.NORTH);
label = new JLabel(new ImageIcon("C:/image/Pierre Menes.jpeg"));
}
}
}
//Si Homme; pas Brun; Yeux Marron; pas Cheveux court
if (rep9.equals("non")){
P="0";
K="0";
T="0";
z=z-3;
Object rep12 = JOptionPane.showInputDialog
(null,
"Est-ce-que votre personnage est chauve ?",
"Qui-Suis-Je ?",
JOptionPane.QUESTION_MESSAGE,
new ImageIcon("C:/image/im.png"),
choix,
choix[0]);
//Si Homme; pas Brun; Yeux Marron; pas Cheveux court; Chauve
if (rep12.equals("oui")){
L="0";
z=z-1;
if (z==1){
label = new JLabel(new ImageIcon("C:/image/mike.gif"));
add(label, BorderLayout.NORTH);
label.setText("Votre personnage est Mike Tyson");
}
}
//Si Homme; pas Brun; Yeux Marron; pas Cheveux court; pas Chauve
if (rep12.equals("non")){
G="0";
z=z-1;
if (z==1){
label = new JLabel(new ImageIcon("C:/image/nos.gif"));
add(label, BorderLayout.NORTH);
label.setText("Votre personnage est NOS (PNL) ");
}
}}}
//Si Homme; pas Brun; pas Yeux Marron
if (rep8.equals("non")){
T="0";
L="0";
G="0";
P="0";
K="0";
z=z-5;
Object rep13 = JOptionPane.showInputDialog
(null,
"Est-ce-que votre personnage a les Yeux Bleus ?",
"Qui-Suis-Je ?",
JOptionPane.QUESTION_MESSAGE,
new ImageIcon("C:/image/im.png"),
choix,
choix[0]);
//Si Homme; pas Brun; pas Yeux Marron; Yeux bleu
if (rep13.equals("oui")){
N="0";
C="0";
z=z-2;
Object rep14 = JOptionPane.showInputDialog
(null,
"Est-ce-que votre personnage a une pilosité faciale importante ?",
"Qui-Suis-Je ?",
JOptionPane.QUESTION_MESSAGE,
new ImageIcon("C:/image/im.png"),
choix,
choix[0]);
//Si Homme; pas Brun; pas Yeux Marron; Yeux bleu; barbe
if (rep14.equals("oui")){
B="0";
z=z-1;
if (z==1){
label = new JLabel(new ImageIcon("C:/image/Noel.gif"));
add(label, BorderLayout.NORTH);
label.setText("Votre personnage est le Pere Noel ");
}
}
//Si Homme; pas Brun; pas Yeux Marron; Yeux bleu; pas barbe
if (rep14.equals("non")){
Q="0";
z=z-1;
if (z==1){
label = new JLabel(new ImageIcon("C:/image/brad.gif"));
add(label, BorderLayout.NORTH);
label.setText("Votre personnage est Brad Pitt ");
}
}
}
//Si Homme; pas Brun; pas Yeux Marron; pas Yeux bleu
if (rep13.equals("non")){
B="0";
Q="0";
z=z-2;
Object rep15 = JOptionPane.showInputDialog
(null,
"Est-ce-que votre personnage a les cheveux Mi-long ?",
"Qui-Suis-Je ?",
JOptionPane.QUESTION_MESSAGE,
new ImageIcon("C:/image/im.png"),
choix,
choix[0]);;
//Si Homme; pas Brun; pas Yeux Marron; pas Yeux bleu; Mi-long
if (rep15.equals("oui")){
N="0";
z=z-1;
if (z==1){
label = new JLabel(new ImageIcon("C:/image/gerrard.gif"));
add(label, BorderLayout.NORTH);
label.setText("Votre personnage est Gerrard Depardieu");
}
}
//Si Homme; pas Brun; pas Yeux Marron; pas Yeux bleu; pas Mi-long
if (rep15.equals("non")){
C="0";
z=z-1;
label = new JLabel(new ImageIcon("C:/image/zidane.gif"));
add(label, BorderLayout.NORTH);
label.setText("Votre personnage est Zidane");
}
}
}
}
}
else if (reponse.equals("non")) {
B="0";
C="0";
D="0";
F="0";
G="0";
H="0";
I="0";
K="0";
L="0";
N="0";
O="0";
P="0";
Q="0";
R="0";
S="0";
T="0";
z=z-16;
Object rep5 = JOptionPane.showInputDialog
(null,
" Est-ce-que votre personnage est Brune ?",
"Qui-Suis-Je ?",
JOptionPane.QUESTION_MESSAGE,
new ImageIcon("C:/image/im.png"),
choix,
choix[0]);
if (rep5.equals("oui")){
E="0";
J="0";
M="0";
z=z-3;
if (z==1){
label = new JLabel(new ImageIcon("C:/image/piaf.gif"));
add(label, BorderLayout.NORTH);
label.setText ("Votre personnage est Edith Piaf");
}
}
if (rep5.equals("non")) {
A="0";
z=z-1;
Object rep6 = JOptionPane.showInputDialog
(null,
"Est-ce-que votre personnage a des lunettes ?",
"Qui-Suis-Je ?",
JOptionPane.QUESTION_MESSAGE,
new ImageIcon("C:/image/im.png"),
choix,
choix[0]);
// Si Femme; pas Brune, Lunettes
if (rep6.equals("oui")) {
J="0";
M="0";
z=z-2;
if (z==1){
label = new JLabel(new ImageIcon("C:/image/jen.gif"));
add(label, BorderLayout.NORTH);
label.setText("Votre personnage est Jennifer Anniston");
}
}
// Si Femme; pas Brune, pas Lunettes
if (rep6.equals("non")) {
E="0";
z=z-1;
Object rep7 = JOptionPane.showInputDialog
(null,
" Est-ce-que votre personnage a les cheveux lisses ?",
"Qui-Suis-Je ?",
JOptionPane.QUESTION_MESSAGE,
new ImageIcon("C:/image/im.png"),
choix,
choix[0]);
// Si Femme; pas Brune, pas Lunettes, lisse
if (rep7.equals("oui")) {
M="0";
z=z-1;
if (z==1){
label = new JLabel(new ImageIcon("C:/image/rihanna.gif"));
add(label, BorderLayout.NORTH);
label.setText("Votre personnage est Rihanna");
}}
// Si Femme; pas Brune, pas Lunettes, pas lisse
if (rep7.equals("non")) {
J="0";
z=z-1;
if (z==1){
label = new JLabel(new ImageIcon("C:/image/farmer.gif"));
add(label, BorderLayout.NORTH);
label.setText("Votre personnage est Mylene Farmer");
}
}
}
}
}
}
}
} |