Example usage for java.awt Color cyan

List of usage examples for java.awt Color cyan

Introduction

In this page you can find the example usage for java.awt Color cyan.

Prototype

Color cyan

To view the source code for java.awt Color cyan.

Click Source Link

Document

The color cyan.

Usage

From source file:ColorVariousObjects.java

public void paint(Graphics g) {
    Color c1 = new Color(255, 100, 100);
    Color c2 = new Color(100, 255, 100);
    Color c3 = new Color(100, 100, 255);

    g.setColor(c1);//from w  w  w.j  ava  2s.co m
    g.drawLine(0, 0, 100, 100);
    g.drawLine(0, 100, 100, 0);

    g.setColor(c2);
    g.drawLine(40, 25, 250, 180);
    g.drawLine(75, 90, 400, 400);

    g.setColor(c3);
    g.drawLine(20, 150, 400, 40);
    g.drawLine(5, 290, 80, 19);

    g.setColor(Color.red);
    g.drawOval(10, 10, 50, 50);
    g.fillOval(70, 90, 140, 100);

    g.setColor(Color.blue);
    g.drawOval(190, 10, 90, 30);
    g.drawRect(10, 10, 60, 50);

    g.setColor(Color.cyan);
    g.fillRect(100, 10, 60, 50);
    g.drawRoundRect(190, 10, 60, 50, 15, 15);
}

From source file:MainClass.java

public MouseMotionAnonymous() {
    setBackground(Color.white);//from  w  w  w . ja v  a  2  s.  c o m
    addMouseListener(new MouseAdapter() {
        public void mouseReleased(MouseEvent me) {
            setBackground(Color.white);
            repaint();
        }
    });
    addMouseMotionListener(new MouseMotionAdapter() {
        public void mouseDragged(MouseEvent me) {
            setBackground(Color.cyan);
            repaint();
        }
    });
}

From source file:org.mabb.fontverter.opentype.DebugGlyphDrawer.java

public static void drawGlyph(TtfGlyph glyph) throws IOException {
    BufferedImage image = new BufferedImage(650, 650, BufferedImage.TYPE_INT_RGB);
    Graphics2D gfx = image.createGraphics();

    gfx.translate(0, 300);/*from www .j a v a 2 s.  c  o  m*/
    gfx.scale(1, -1);

    gfx.setColor(Color.white);
    gfx.fillRect(0, -1000, 2060, 2060);
    gfx.setColor(Color.lightGray);
    gfx.translate(100, 50);
    gfx.fillRect(0, 0, 1000, 1000);
    gfx.setColor(Color.BLACK);

    gfx.scale(.05, .05);

    //        gfx.rotate(Math.toRadians(180));
    //        gfx.translate(-2200, -2200);

    Color[] colors = new Color[] { Color.BLACK, Color.MAGENTA, Color.GREEN, Color.BLUE, Color.cyan };
    java.util.List<Path2D.Double> paths = glyph.getPaths();
    for (int i = 0; i < paths.size(); i++) {
        Path2D pathOn = paths.get(i);
        gfx.setColor(colors[i]);

        gfx.draw(pathOn);
    }

    gfx.dispose();

    //        ImageIO.write(image, "jpg", new File("test.jpg"));
}

From source file:BezLab.java

public void paint(Graphics g) {
    for (int i = 0; i < 4; i++) {
        if (i == 0 || i == 3)
            g.setColor(Color.blue);
        else//  w w w  .j  a  v a2s.co  m
            g.setColor(Color.cyan);
        g.fillOval(xs[i] - 6, ys[i] - 6, 12, 12);
    }
    Graphics2D g2d = (Graphics2D) g;
    g2d.setColor(Color.black);
    GeneralPath path = new GeneralPath();
    path.moveTo(xs[0], ys[0]);
    path.curveTo(xs[1], ys[1], xs[2], ys[2], xs[3], ys[3]);
    g2d.draw(path);
}

From source file:Main.java

public void mouseDragged(MouseEvent me) {
    mmad.setBackground(Color.cyan);
    mmad.repaint();
}

From source file:EvenOddRowCellRenderer.java

public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
        int row, int column) {
    JTextField editor = new JTextField();
    if (value != null)
        editor.setText(value.toString());
    editor.setBackground((row % 2 == 0) ? Color.white : Color.cyan);
    return editor;
}

From source file:Main.java

public KeyTextComponent() {
    setBackground(Color.cyan);
    KeyListener internalKeyListener = new KeyAdapter() {
        public void keyPressed(KeyEvent keyEvent) {
            if (actionListenerList != null) {
                int keyCode = keyEvent.getKeyCode();
                String keyText = KeyEvent.getKeyText(keyCode);
                ActionEvent actionEvent = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, keyText);
                actionListenerList.actionPerformed(actionEvent);
            }//  w  w w .  j a  v  a  2  s.  c o m
        }
    };

    MouseListener internalMouseListener = new MouseAdapter() {
        public void mousePressed(MouseEvent mouseEvent) {
            requestFocus();
        }
    };

    addKeyListener(internalKeyListener);
    addMouseListener(internalMouseListener);
}

From source file:Main.java

public Main() {
    UIManager.put("TabbedPane.contentBorderInsets", new InsetsUIResource(1, 0, 0, 0));
    UIManager.put("TabbedPane.contentAreaColor", new ColorUIResource(Color.GREEN));
    UIManager.put("TabbedPane.focus", new ColorUIResource(Color.ORANGE));
    UIManager.put("TabbedPane.selected", new ColorUIResource(Color.YELLOW));
    UIManager.put("TabbedPane.darkShadow", new ColorUIResource(Color.DARK_GRAY));
    UIManager.put("TabbedPane.borderHightlightColor", new ColorUIResource(Color.LIGHT_GRAY));
    UIManager.put("TabbedPane.light", new ColorUIResource(Color.WHITE));
    UIManager.put("TabbedPane.tabAreaBackground", new ColorUIResource(Color.CYAN));
    UIManager.put("ToolTip.background", Color.WHITE);
    UIManager.put("ToolTip.border", new BorderUIResource(new LineBorder(Color.BLACK)));
    this.updateUI();

    this.setBackground(Color.BLUE);

    JPanel testPanel = new JPanel();
    testPanel.setLayout(new BorderLayout());
    testPanel.add(new JLabel("Hello World"), BorderLayout.NORTH);
    testPanel.add(new JTextArea("Looks nice out there :)"), BorderLayout.CENTER);

    JPanel testPanel2 = new JPanel();
    testPanel2.setLayout(new BorderLayout());
    testPanel2.add(new JLabel("Good Bye World"), BorderLayout.NORTH);
    testPanel2.add(new JTextArea("OK"), BorderLayout.CENTER);

    this.addTab("Hello World", testPanel);
    this.addTab("World", testPanel2);
}

From source file:MainClass.java

public KeyTextComponent() {
    setBackground(Color.CYAN);
    KeyListener internalKeyListener = new KeyAdapter() {
        public void keyPressed(KeyEvent keyEvent) {
            if (actionListenerList != null) {
                int keyCode = keyEvent.getKeyCode();
                String keyText = KeyEvent.getKeyText(keyCode);
                ActionEvent actionEvent = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, keyText);
                fireActionPerformed(actionEvent);
            }//from   www.j a v a2s .  c o m
        }
    };

    MouseListener internalMouseListener = new MouseAdapter() {
        public void mousePressed(MouseEvent mouseEvent) {
            requestFocusInWindow();
        }
    };

    addKeyListener(internalKeyListener);
    addMouseListener(internalMouseListener);
}

From source file:Main.java

public KeyTextComponent() {
    setBackground(Color.CYAN);
    KeyListener internalKeyListener = new KeyAdapter() {
        public void keyPressed(KeyEvent keyEvent) {
            if (actionListenerList != null) {
                int keyCode = keyEvent.getKeyCode();
                String keyText = KeyEvent.getKeyText(keyCode);
                ActionEvent actionEvent = new ActionEvent(this, ActionEvent.ACTION_LAST, keyText);
                fireActionPerformed(actionEvent);
            }/*from   w  w  w. j a  v a  2  s.  c  o m*/
        }
    };

    MouseListener internalMouseListener = new MouseAdapter() {
        public void mousePressed(MouseEvent mouseEvent) {
            requestFocusInWindow();
        }
    };

    addKeyListener(internalKeyListener);
    addMouseListener(internalMouseListener);
}