Advertisement
Cre3d

Untitled

Nov 22nd, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.87 KB | None | 0 0
  1.  public class Report extends JFrame{
  2.                      Report(){
  3.                                  setTitle("Quiz Filozoficzny - Odpowiedzi!");
  4.                                  setSize(1500,750);
  5.                                  setBackground(Color.WHITE);
  6.                                  addWindowListener(new WindowAdapter(){
  7.                                                          public void windowClosing(WindowEvent e){
  8.                                                                      dispose();
  9.                                                                      reset();
  10.                                                          }
  11.                                              });
  12.                                  Draw d=new Draw();                                  
  13.                                  add(d);
  14.                                  setVisible(true);
  15.                                  }
  16.                      
  17.                      
  18.                  class Draw extends Canvas{
  19.                                  public void paint(Graphics g){
  20.                                              int qnum=21;
  21.                                              int x=10;
  22.                                              int y=20;
  23.                                              for(int i=0;i<qnum;i++){
  24.                                                          //Pierwsza kolumna
  25.                                                          g.setFont(new Font("Arial",Font.BOLD,12));                                          
  26.                                                          g.drawString(i+1+". "+qca[i][0], x,y);
  27.                                                          y+=15;            
  28.                                                          g.setFont(new Font("Arial",Font.PLAIN,12));                              
  29.                                                          g.drawString("      Poprawna odpowiedź:"+qca[i][1]+ "                 Twoja odpowiedź:"+map.get(i), x,y);
  30.                                                          y+=20;
  31.                                                          
  32.                                                        
  33.                                                          
  34.                                              }
  35.                                              //Wyświetl poprawną ilość odpowiedzi
  36.                                              int numc=calCorrectAnswer();
  37.                                              g.setColor(Color.BLUE);
  38.                                              g.setFont(new Font("Arial",Font.BOLD,14));
  39.                                              g.drawString("Twoja liczba poprawnych odpowiedzi:"+numc,550,700);
  40.                      
  41.                                              
  42.                                  }
  43.                      }
  44.                                  
  45.          }
  46.          
  47.  
  48.          
  49.  
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement