Example usage for java.awt Color RED

List of usage examples for java.awt Color RED

Introduction

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

Prototype

Color RED

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

Click Source Link

Document

The color red.

Usage

From source file:Main.java

Main(String title) {
    super(title);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    source.setForeground(Color.red);
    getContentPane().add(source, BorderLayout.NORTH);

    target.addActionListener(this);
    getContentPane().add(target, BorderLayout.SOUTH);

    new DropTarget(target, DnDConstants.ACTION_COPY_OR_MOVE, this);

    setSize(205, 100);//www . j  av a2  s  .c  o  m

    setVisible(true);
}

From source file:Main.java

public Main(String title) {
    super(title);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    source.setForeground(Color.red);
    getContentPane().add(source, BorderLayout.NORTH);

    target.addActionListener(this);
    getContentPane().add(target, BorderLayout.SOUTH);

    new DropTarget(target, DnDConstants.ACTION_COPY_OR_MOVE, this);

    setSize(205, 100);//from  w  w w  .  j  a  va2  s . co m

    setVisible(true);
}

From source file:com.mirth.connect.client.ui.ChangePasswordDialog.java

public ChangePasswordDialog(User currentUser, String message) {
    super(PlatformUI.MIRTH_FRAME);
    this.currentUser = currentUser;
    this.parent = PlatformUI.MIRTH_FRAME;
    initComponents();/*from   w w  w .ja v a2s .c  om*/

    mirthHeadingLabel.setForeground(UIConstants.HEADER_TITLE_TEXT_COLOR);

    passwordTextArea.setText(message);
    passwordTextArea.setBackground(Color.WHITE);
    passwordTextArea.setDisabledTextColor(Color.RED);

    finishButton.setEnabled(false);

    setModal(true);

    setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);

    this.addWindowListener(new WindowAdapter() {

        @Override
        public void windowClosing(WindowEvent e) {
            cancelButtonActionPerformed(null);
        }
    });

    pack();
    Dimension dlgSize = getPreferredSize();
    Dimension frmSize = parent.getSize();
    Point loc = parent.getLocation();

    if ((frmSize.width == 0 && frmSize.height == 0) || (loc.x == 0 && loc.y == 0)) {
        setLocationRelativeTo(null);
    } else {
        setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
    }

    setVisible(true);
}

From source file:Main.java

public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
        boolean cellHasFocus) {
    setText(value.toString());//w ww.java  2  s . c o  m
    if (cellHasFocus) {
        setBackground(Color.RED);
    } else if (isSelected) {
        setBackground(Color.BLUE);
    } else {
        setBackground(null);
    }
    return this;
}

From source file:MainClass.java

MainClass(String title) {
    super(title);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    source.setForeground(Color.red);
    getContentPane().add(source, BorderLayout.NORTH);

    target.addActionListener(this);
    getContentPane().add(target, BorderLayout.SOUTH);

    new DropTarget(target, DnDConstants.ACTION_COPY_OR_MOVE, this);

    setSize(205, 100);/*from  www. ja  v a2s . co  m*/

    setVisible(true);
}

From source file:Main.java

protected void paintComponent(Graphics g) {
    super.paintComponent(g);

    g.drawLine(10, 100, 380, 100);/* ww  w .j a v  a2s. co  m*/
    g.drawLine(200, 30, 200, 190);

    g.drawLine(380, 100, 370, 90);
    g.drawLine(380, 100, 370, 110);
    g.drawLine(200, 30, 190, 40);
    g.drawLine(200, 30, 210, 40);

    g.drawString("X", 360, 80);
    g.drawString("Y", 220, 40);

    Polygon p = new Polygon();
    Polygon p2 = new Polygon();

    for (int x = -170; x <= 170; x++) {
        p.addPoint(x + 200, 100 - (int) (50 * f((x / 100.0) * 2 * Math.PI)));

    }

    for (int x = -170; x <= 170; x++) {
        p2.addPoint(x + 200, 100 - (int) (50 * gCos((x / 100.0) * 2 * Math.PI)));

    }

    g.setColor(Color.red);
    g.drawPolyline(p.xpoints, p.ypoints, p.npoints);
    g.drawString("-2\u03c0", 95, 115);
    g.drawString("-\u03c0", 147, 115);
    g.drawString("\u03c0", 253, 115);
    g.drawString("2\u03c0", 305, 115);
    g.drawString("0", 200, 115);

    g.setColor(Color.blue);
    g.drawPolyline(p2.xpoints, p2.ypoints, p2.npoints);

}

From source file:org.jfree.chart.demo.GanttRenderer2.java

public GanttRenderer2() {
    setIncludeBaseInRange(false);
    completePaint = Color.green;
    incompletePaint = Color.red;
    startPercent = 0.34999999999999998D;
    endPercent = 0.65000000000000002D;
}

From source file:dataform.components.WorkTimer.java

private void init() throws Exception {
    stopWatch = new StopWatch();
    setEditable(false);//w w w.j a v  a  2  s  .c  o  m

    setForeground(Color.RED);
    setHorizontalAlignment(JLabel.RIGHT);

    setMargin(new Insets(2, 2, 2, 4));
    timer = new javax.swing.Timer(ONE_SECOND, new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            timer_ActionPerformed(evt);
        }
    });
    stopWatch.start();
    timer.start();
}

From source file:cv.mikusher.freechart.XYLineChart.java

public XYLineChart(String applicationTitle, String chartTitle) {
    super(applicationTitle);
    setDefaultCloseOperation(ApplicationFrame.EXIT_ON_CLOSE);
    JFreeChart xylineChart = ChartFactory.createXYLineChart(chartTitle, "Category", "Score", createDataset(),
            PlotOrientation.VERTICAL, true, true, false);

    ChartPanel chartPanel = new ChartPanel(xylineChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
    final XYPlot plot = xylineChart.getXYPlot();
    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
    renderer.setSeriesPaint(0, Color.RED);
    renderer.setSeriesPaint(1, Color.GREEN);
    renderer.setSeriesPaint(2, Color.YELLOW);
    renderer.setSeriesStroke(0, new BasicStroke(4.0f));
    renderer.setSeriesStroke(1, new BasicStroke(3.0f));
    renderer.setSeriesStroke(2, new BasicStroke(2.0f));
    plot.setRenderer(renderer);//from   ww w  .j  a  v  a 2  s  .  c  o  m
    setContentPane(chartPanel);
}

From source file:MainClass.java

private BufferedImage createImage() {
    BufferedImage bim;//from   w w w . j av a  2 s .  c om

    Color[] colors = { Color.red, Color.blue, Color.yellow, };

    int width = 8, height = 8;
    bim = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
    Graphics2D g2 = bim.createGraphics();
    for (int i = 0; i < width; i++) {
        g2.setPaint(colors[(i / 2) % colors.length]);
        g2.drawLine(0, i, i, 0);
        g2.drawLine(width - i, height, width, height - i);
    }
    return bim;
}