Example usage for java.awt Color BLACK

List of usage examples for java.awt Color BLACK

Introduction

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

Prototype

Color BLACK

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

Click Source Link

Document

The color black.

Usage

From source file:TextQualityDemoVALUE_TEXT_ANTIALIAS_LCD_HBGR.java

public void paintComponent(Graphics g) {
    Dimension d = this.getSize();
    BufferedImage backBuffer = (BufferedImage) this.createImage(d.width, d.height);
    Graphics2D g2 = backBuffer.createGraphics();

    g2.setColor(Color.WHITE);/* ww  w . java2s .  co  m*/
    g2.fillRect(0, 0, d.width, d.height);

    g2.setColor(Color.BLACK);
    g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, hintValue);

    g2.drawRect(0, 0, d.width - 1, d.height - 1);

    g2.drawString("abcdefghijklmnopqrstuvwxyz", 20, 40);
    g2.drawString("ABCDEFGHIJKLMNOPQRSTUVWXYZ", 20, 60);
    g2.drawString("1234567890-=!@#$%^&*()_+,./<>?", 20, 80);

    g.drawImage(backBuffer, 0, 0, this);
}

From source file:StocksTable2.java

public StocksTable2() {
    super("Stocks Table");
    setSize(600, 300);/*  w ww  .j  av  a2s .c  om*/

    m_data = new StockTableData();

    m_title = new JLabel(m_data.getTitle(), new ImageIcon("money.gif"), SwingConstants.LEFT);
    m_title.setFont(new Font("TimesRoman", Font.BOLD, 24));
    m_title.setForeground(Color.black);
    getContentPane().add(m_title, BorderLayout.NORTH);

    m_table = new JTable();
    m_table.setAutoCreateColumnsFromModel(false);
    m_table.setModel(m_data);

    for (int k = 0; k < StockTableData.m_columns.length; k++) {
        DefaultTableCellRenderer renderer = new ColoredTableCellRenderer();
        renderer.setHorizontalAlignment(StockTableData.m_columns[k].m_alignment);
        TableColumn column = new TableColumn(k, StockTableData.m_columns[k].m_width, renderer, null);
        m_table.addColumn(column);
    }

    JTableHeader header = m_table.getTableHeader();
    header.setUpdateTableInRealTime(false);

    JScrollPane ps = new JScrollPane();
    ps.getViewport().add(m_table);
    getContentPane().add(ps, BorderLayout.CENTER);

    WindowListener wndCloser = new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);
        }
    };
    addWindowListener(wndCloser);
    setVisible(true);
}

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/*from  w w w . j av  a 2  s.c o  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:SplashDemo.java

static void renderSplashFrame(Graphics2D g, int frame) {
    final String[] comps = { "foo", "bar", "baz" };
    g.setComposite(AlphaComposite.Clear);
    g.fillRect(120, 140, 200, 40);/*from w  ww.jav  a 2s .com*/
    g.setPaintMode();
    g.setColor(Color.BLACK);
    g.drawString("Loading " + comps[(frame / 5) % 3] + "...", 120, 150);
}

From source file:Main.java

public CustomPanel(Color c) {
    setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),
            BorderFactory.createLineBorder(Color.black, 1)));

    setBackground(c);/*from   w w  w.  j  a v a 2s .  c  o m*/
}

From source file:no.imr.sea2data.guibase.chart.XYBarChart.java

public XYBarChart() {
    dataset = new XYSeriesCollection(new XYSeries("Series 1"));
    JFreeChart chart = ChartFactory.createXYBarChart("", "X axis", false, "Y axis", dataset,
            PlotOrientation.VERTICAL, false, true, false);
    chart.setBackgroundPaint(Color.white);
    chart.getTitle().setPaint(Color.black);
    chart.getTitle().setFont(new Font("SansSerif", Font.PLAIN, 12));
    chart.addSubtitle(trendLegend);/*from   w  w  w .ja  v a 2  s. c o  m*/
    chart.addSubtitle(trendLegend2);
    trendLegend.setPosition(RectangleEdge.TOP);
    trendLegend2.setPosition(RectangleEdge.TOP);
    plot = (XYPlot) chart.getPlot();
    XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer();
    renderer.setShadowVisible(false);
    chartPanel = new ChartPanel(chart);
    plot.getRangeAxis().setStandardTickUnits(NumberAxis.createIntegerTickUnits());
}

From source file:osproject.Drawer.java

private static JFreeChart createChart(IntervalXYDataset paramIntervalXYDataset) {
    JFreeChart localJFreeChart = ChartFactory.createXYBarChart("Procssing schadual", "Resource", false,
            "Timing", paramIntervalXYDataset, PlotOrientation.HORIZONTAL, true, false, false);
    localJFreeChart.setBackgroundPaint(Color.BLACK);
    XYPlot localXYPlot = (XYPlot) localJFreeChart.getPlot();

    SymbolAxis localSymbolAxis = new SymbolAxis("Process", arr);
    localSymbolAxis.setGridBandsVisible(false);
    localXYPlot.setDomainAxis(localSymbolAxis);
    XYBarRenderer localXYBarRenderer = (XYBarRenderer) localXYPlot.getRenderer();
    localXYBarRenderer.setUseYInterval(true);
    localXYPlot.setRangeAxis(new DateAxis("Timing"));
    ChartUtilities.applyCurrentTheme(localJFreeChart);
    return localJFreeChart;
}

From source file:com.cburch.draw.shapes.Line.java

public Line(int x0, int y0, int x1, int y1) {
    this.x0 = x0;
    this.y0 = y0;
    this.x1 = x1;
    this.y1 = y1;
    bounds = Bounds.create(x0, y0, 0, 0).add(x1, y1);
    strokeWidth = 1;// w  w  w  . j a  v  a 2 s. co m
    strokeColor = Color.BLACK;
}

From source file:FilledGeneralPath.java

public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    int x = 5;/*from w  ww  .ja v a2 s. c o  m*/
    int y = 7;

    // fill and stroke GeneralPath
    int xPoints[] = { x, 200, x, 200 };
    int yPoints[] = { y, 200, 200, y };
    GeneralPath filledPolygon = new GeneralPath(GeneralPath.WIND_EVEN_ODD, xPoints.length);
    filledPolygon.moveTo(xPoints[0], yPoints[0]);
    for (int index = 1; index < xPoints.length; index++) {
        filledPolygon.lineTo(xPoints[index], yPoints[index]);
    }
    filledPolygon.closePath();
    g2.setPaint(Color.red);
    g2.fill(filledPolygon);
    g2.setPaint(Color.black);
    g2.draw(filledPolygon);
    g2.drawString("Filled and Stroked GeneralPath", x, 250);
}

From source file:org.quickserver.net.qsadmin.plugin.stats.ThermometerChart.java

public ThermometerChart(String title) {
    bgColor = new Color(238, 238, 230, 255);
    thermo1.setValue(value);//ww w. j a va  2 s  .c o m
    thermo1.setBackground(bgColor);
    thermo1.setOutlinePaint(null);
    thermo1.setUnits(0);
    thermo1.setShowValueLines(true);
    thermo1.setFollowDataInSubranges(true);
    //thermo1.setForeground(Color.blue);
    thermo1.setValuePaint(Color.BLACK);

    setRange(0, 300);
    /*
      setSubrangeInfo(0,   0,  50,    0, 60);
      setSubrangeInfo(1,  50,  100,  40, 110);
      setSubrangeInfo(2, 110,  250, 100, 300);
    */

    thermo1.addSubtitle(title, new Font("Dialog", Font.BOLD, 15));
    thermo1.setToolTipText(title);
    setToolTipText(title);

    setLayout(new BorderLayout());
    add(thermo1, BorderLayout.CENTER);
}