Advertisement
Guest User

Untitled

a guest
Aug 12th, 2012
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. //Konstruktor klasy dziedziczącej po JFrame
  2. buttonEtiquette = new JButton("Change Cards");
  3. buttonEtiquette.setBounds(50,20,100,100);
  4.  
  5. getContentPane().add(buttonEtiquette);
  6. buttonEtiquette.revalidate();
  7. buttonEtiquette.repaint();
  8. buttonEtiquette.setVisible(true);
  9.  
  10. setVisible(true);
  11. image = createImage(getSize().width,getSize().height);
  12. gc = image.getGraphics();
  13.  
  14.  
  15. //Funkcja rysująca
  16. public void paint(Graphics g) {
  17. super.paint(g);
  18. gc = image.getGraphics();
  19. gc.drawImage(backgroundImage,0,0,this.getSize().width,this.getSize().height,null);
  20. for(int i = 0; i<images.size();i++) {
  21. gc.drawImage(images.get(i), coordinates.get(i).getPositionX(), coordinates.get(i).getPositionY(), coordinates.get(i).getWidth(), coordinates.get(i).getHeight(),null);
  22. }
  23. gc.drawImage(switchImage, getSize().width/5*4, getSize().height/5*4, getSize().width/5, getSize().height/5, null);
  24. g.drawImage(image,0,0,null);
  25. }
  26. public void update(Graphics g){
  27. paint(g);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement