Facebook
From Scanty Bison, 5 Years ago, written in Java.
Embed
Download Paste or View Raw
Hits: 208
  1. package mobileapplication9;
  2.  
  3. import javax.microedition.lcdui.Canvas;
  4. import javax.microedition.lcdui.Font;
  5. import javax.microedition.lcdui.Graphics;
  6.  
  7. /*
  8.  * To change this license header, choose License Headers in Project Properties.
  9.  * To change this template file, choose Tools | Templates
  10.  * and open the template in the editor.
  11.  */
  12. /**
  13.  *
  14.  * @author Bartosz
  15.  */
  16. public class Plotno extends Canvas {
  17.  
  18.     String napis;
  19.  
  20.     public Plotno() {
  21.         napis = "Rio de Janeiro 2016";
  22.     }
  23.  
  24.     protected void paint(Graphics g) {
  25.  
  26.         g.setColor(255, 255, 255);
  27.         g.fillRect(0, 0, this.getWidth(), this.getHeight());
  28.  
  29.         g.setColor(0, 0, 255);
  30.         g.drawArc(getWidth() / 2 - 40, getHeight() / 3, 30, 30, 0, 360);
  31.         g.setColor(0, 0, 0);
  32.         g.drawArc(getWidth() / 2 - 20, getHeight() / 3, 30, 30, 0, 360);
  33.         g.setColor(255, 0, 0);
  34.         g.drawArc(getWidth() / 2, getHeight() / 3, 30, 30, 0, 360);
  35.  
  36.         g.setColor(0, 255, 0);
  37.         g.drawArc(getWidth() / 2 - 10, getHeight() / 3 + 20, 30, 30, 0, 360);
  38.         g.setColor(255, 255, 0);
  39.         g.drawArc(getWidth() / 2 - 30, getHeight() / 3 + 20, 30, 30, 0, 360);
  40.  
  41.         g.setColor(0, 0, 0);
  42.  
  43.         g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_PLAIN, Font.SIZE_SMALL));
  44.         g.drawString(napis, this.getWidth() / 2, this.getHeight() / 2 + 40, Graphics.BASELINE | Graphics.HCENTER);
  45.  
  46.     }
  47.  
  48. }
  49.