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: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_FIRST, keyText);
                fireActionPerformed(actionEvent);
            }// w  w  w .j a  va 2 s. co 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_FIRST, keyText,
                        ActionEvent.ALT_MASK);
                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);
}

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_FIRST, keyText,
                        System.currentTimeMillis() - 10, ActionEvent.ALT_MASK);
                fireActionPerformed(actionEvent);
            }/*from  w  w w.jav  a  2s.  com*/
        }
    };

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

    addKeyListener(internalKeyListener);
    addMouseListener(internalMouseListener);
}

From source file:KeyTextTester2.java

public KeyTextComponent2() {
    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  w ww . 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:org.martin.ftp.model.TCRSearch.java

@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
        int row, int column) {

    JLabel lbl = new JLabel();
    ImageIcon icon;/*from www  .j a  v  a2  s  .c  o  m*/
    FTPFile file = files.get(row).getFile();

    if (column == 0) {
        if (file.isDirectory())
            icon = new ImageIcon(getClass().getResource("/org/martin/ftp/resources/folder.png"));

        else
            icon = new ImageIcon(getClass().getResource("/org/martin/ftp/resources/file.png"));

        lbl.setIcon(icon);
        lbl.setText(file.getName());
    }

    else
        lbl.setText(value.toString());

    Color bg = lbl.getBackground();

    if (isSelected)
        lbl.setBackground(Color.CYAN);

    else
        lbl.setBackground(bg);

    lbl.setOpaque(true);

    return lbl;

}

From source file:org.martin.ftp.model.TCRFiles.java

@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
        int row, int column) {

    JLabel lbl = new JLabel();
    ImageIcon icon;/*from  w  w w .j  ava 2  s  .  co  m*/
    FTPFile file = files.get(row);

    if (column == 0) {
        if (file.isDirectory())
            icon = new ImageIcon(getClass().getResource("/org/martin/ftp/resources/folder.png"));

        else
            icon = new ImageIcon(getClass().getResource("/org/martin/ftp/resources/file.png"));

        lbl.setIcon(icon);
        lbl.setText(file.getName());
    }

    else
        lbl.setText(value.toString());

    Color bg = lbl.getBackground();

    if (isSelected)
        lbl.setBackground(Color.CYAN);

    else if (row == foundFileIndex)
        lbl.setBackground(Color.RED);

    else
        lbl.setBackground(bg);

    lbl.setOpaque(true);

    return lbl;

}

From source file:TopLevelDemo.java

/**
 * Create the GUI and show it. For thread safety, this method should be
 * invoked from the event-dispatching thread.
 *///from  www  .ja va  2s.  com
private static void createAndShowGUI() {
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);

    //Create and set up the window.
    JFrame frame = new JFrame("TopLevelDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Create the menu bar. Make it have a cyan background.
    JMenuBar cyanMenuBar = new JMenuBar();
    cyanMenuBar.setOpaque(true);
    cyanMenuBar.setBackground(Color.cyan);
    cyanMenuBar.setPreferredSize(new Dimension(200, 20));

    //Create a yellow label to put in the content pane.
    JLabel yellowLabel = new JLabel();
    yellowLabel.setOpaque(true);
    yellowLabel.setBackground(Color.yellow);
    yellowLabel.setPreferredSize(new Dimension(200, 180));

    //Set the menu bar and add the label to the content pane.
    frame.setJMenuBar(cyanMenuBar);
    frame.getContentPane().add(yellowLabel, BorderLayout.CENTER);

    //Display the window.
    frame.pack();
    frame.setVisible(true);
}

From source file:TabPanelwithImageIconCustom.java

public void paintIcon(Component c, Graphics g, int x, int y) {
    g.setColor(Color.black);/* ww  w.j  a v  a2 s. co  m*/
    g.fillRect(x + 4, y + 4, getIconWidth() - 8, getIconHeight() - 8);
    g.setColor(Color.cyan);
    g.fillRect(x + 6, y + 6, getIconWidth() - 12, getIconHeight() - 12);
}

From source file:lectorarchivos.MostrarGraficaCSV.java

/**
 * Creates new form MostrarGraficaCSV/*from   ww  w .ja  va  2  s .  c o m*/
 */
public MostrarGraficaCSV(JTable jTableInfoCSV) {
    initComponents();
    this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);

    panel = new JPanel();
    getContentPane().add(panel);

    //Fuente de datos
    DefaultCategoryDataset dataset = new DefaultCategoryDataset();

    //Recorremos la columna del consumo de la tabla
    for (int i = jTableInfoCSV.getRowCount() - 1; i >= 0; i--) {
        if (Double.parseDouble(jTableInfoCSV.getValueAt(i, 4).toString()) > 0)
            dataset.setValue(Double.parseDouble(jTableInfoCSV.getValueAt(i, 4).toString()), "Consumo",
                    jTableInfoCSV.getValueAt(i, 0).toString());
    }

    //Creando el grfico
    JFreeChart chart = ChartFactory.createBarChart3D("Consumo", "Fecha", "Consumo", dataset,
            PlotOrientation.VERTICAL, true, true, false);
    chart.setBackgroundPaint(Color.cyan);
    chart.getTitle().setPaint(Color.black);
    chart.setBackgroundPaint(Color.white);
    chart.removeLegend();

    //Cambiar color de barras
    CategoryPlot plot = (CategoryPlot) chart.getPlot();
    BarRenderer barRenderer = (BarRenderer) plot.getRenderer();
    barRenderer.setSeriesPaint(0, Color.decode("#5882FA"));

    // Mostrar Grafico
    ChartFrame frame = new ChartFrame("CONSUMO", chart);
    frame.pack();
    frame.getChartPanel().setMouseZoomable(false);
    frame.setVisible(true);

    panel.add(frame);

}

From source file:org.talend.dq.indicators.graph.GradientPickedEdgePaintFunction.java

protected Color getColor2(Edge e) {
    return pi.isPicked(e) ? Color.CYAN : c2;
}