Advertisement
alvsjo

Obojena tacka (15-02-17)

Feb 22nd, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. import java.awt.Color;
  2.  
  3. public class ObojenaTacka extends Tacka{
  4.  
  5.     Color boja;
  6.  
  7.     public ObojenaTacka(double x, double y, String ime, Color boja) {
  8.         super(x, y, ime);
  9.         this.boja = boja;
  10.     }
  11.  
  12.     @Override
  13.     public void stampa(boolean newLine) {
  14.         // TODO Auto-generated method stub
  15.         super.stampa(false);
  16.         System.out.println(" RBG["+boja.getRed()+","+boja.getGreen()+","+boja.getBlue()+"]");
  17.     }
  18.  
  19.     @Override
  20.     public String toString() {
  21.         String r = super.toString();
  22.         r=r+" RBG["+boja.getRed()+","+boja.getGreen()+","+boja.getBlue()+"]";
  23.         return r;
  24.     }
  25.    
  26.    
  27.    
  28.    
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement