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:br.unesp.rc.desafio.utils.Utils.java

public static void createLine(DefaultCategoryDataset dataset) {
    JFreeChart chart = ChartFactory.createLineChart("Grafico", " ", " ", dataset);
    CategoryPlot p = chart.getCategoryPlot();
    p.setRangeGridlinePaint(Color.black);
    ChartFrame frame = new ChartFrame("Grafico de BArras", chart);
    frame.setVisible(true);// w  ww . j a va 2 s .  c  om
    frame.setSize(400, 350);
    ManagerGUI.centralizar(frame);

}

From source file:union.java

public void paint(Graphics g) {
    g.setColor(Color.lightGray);/*from   ww  w.  j  ava2  s.com*/
    Rectangle r2 = r.union(r1);
    g.fillRect(r2.x, r2.y, r2.width, r2.height);
    g.setColor(Color.black);
    g.drawRect(r.x, r.y, r.width, r.height);
    g.drawRect(r1.x, r1.y, r1.width, r1.height);
}

From source file:ImageLabelExample.java

protected static JLabel makeLabel(int vert, int horiz) {
    JLabel l = new JLabel("Smile", icon, SwingConstants.CENTER);
    l.setVerticalTextPosition(vert);//from w w  w .  j ava2s  .  c o  m
    l.setHorizontalTextPosition(horiz);
    l.setBorder(BorderFactory.createLineBorder(Color.black));
    return l;
}

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

private static JFreeChart createChart(XYZDataset xyzdataset) {
    NumberAxis numberaxis = new NumberAxis("X");
    numberaxis.setLowerMargin(0.0D);/*from  w  w w  . j av  a2  s  .c om*/
    numberaxis.setUpperMargin(0.0D);
    NumberAxis numberaxis1 = new NumberAxis("Y");
    numberaxis1.setAutoRangeIncludesZero(false);
    numberaxis1.setInverted(true);
    numberaxis1.setLowerMargin(0.0D);
    numberaxis1.setUpperMargin(0.0D);
    numberaxis1.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    XYBlockRenderer xyblockrenderer = new XYBlockRenderer();
    LookupPaintScale lookuppaintscale = new LookupPaintScale(0.5D, 3.5D, Color.black);
    lookuppaintscale.add(0.5D, Color.green);
    lookuppaintscale.add(1.5D, Color.orange);
    lookuppaintscale.add(2.5D, Color.red);
    xyblockrenderer.setPaintScale(lookuppaintscale);
    XYPlot xyplot = new XYPlot(xyzdataset, numberaxis, numberaxis1, xyblockrenderer);
    xyplot.setBackgroundPaint(Color.lightGray);
    xyplot.setDomainGridlinePaint(Color.white);
    xyplot.setRangeGridlinePaint(Color.white);
    xyplot.setForegroundAlpha(0.66F);
    xyplot.setAxisOffset(new RectangleInsets(5D, 5D, 5D, 5D));
    JFreeChart jfreechart = new JFreeChart("XYBlockChartDemo3", xyplot);
    jfreechart.removeLegend();
    jfreechart.setBackgroundPaint(Color.white);
    SymbolAxis symbolaxis = new SymbolAxis(null, new String[] { "", "OK", "Uncertain", "Bad" });
    symbolaxis.setRange(0.5D, 3.5D);
    symbolaxis.setPlot(new PiePlot());
    symbolaxis.setGridBandsVisible(false);
    PaintScaleLegend paintscalelegend = new PaintScaleLegend(lookuppaintscale, symbolaxis);
    paintscalelegend.setAxisOffset(5D);
    paintscalelegend.setPosition(RectangleEdge.BOTTOM);
    paintscalelegend.setMargin(new RectangleInsets(5D, 5D, 5D, 5D));
    jfreechart.addSubtitle(paintscalelegend);
    return jfreechart;
}

From source file:PaintAllFontsFromGraphicEvironment.java

public void paint(Graphics g) {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();

    Font[] allFonts = ge.getAllFonts();

    for (int i = 0; i < allFonts.length; i++) {
        Font f = allFonts[i].deriveFont(10.0f);
        g.setFont(f);//  w w  w.j  ava 2 s.  c  o  m

        g.setColor(Color.black);
        g.drawString("Hello!", 10, 20 * i);

    }
}

From source file:JProgressBarDemo.java

public JProgressBarDemo() {
    super("JProgressBar Demo");
    setSize(300, 100);//  w  ww.j a  va  2  s .  co  m

    UIManager.put("ProgressBar.selectionBackground", Color.black);
    UIManager.put("ProgressBar.selectionForeground", Color.white);
    UIManager.put("ProgressBar.foreground", new Color(8, 32, 128));

    progressBar = new JProgressBar();
    progressBar.setMinimum(minValue);
    progressBar.setMaximum(maxValue);
    progressBar.setStringPainted(true);

    JButton start = new JButton("Start");
    start.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            Thread runner = new Thread() {
                public void run() {
                    counter = minValue;
                    while (counter <= maxValue) {
                        Runnable runme = new Runnable() {
                            public void run() {
                                progressBar.setValue(counter);
                            }
                        };
                        SwingUtilities.invokeLater(runme);
                        counter++;
                        try {
                            Thread.sleep(100);
                        } catch (Exception ex) {
                        }
                    }
                }
            };
            runner.start();
        }
    });

    getContentPane().add(progressBar, BorderLayout.CENTER);
    getContentPane().add(start, BorderLayout.WEST);

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

From source file:Main.java

public TestPane() {
    setLayout(new BorderLayout());
    setBorder(new EmptyBorder(10, 10, 10, 10));
    JTextPane pane = new JTextPane();
    JPanel panel = new JPanel(new BorderLayout());
    JPanel innerPanel = new JPanel(new BorderLayout());

    pane.setBorder(BorderFactory.createLineBorder(Color.BLACK));
    innerPanel.add(pane);/*from  w  w  w .j  ava2 s  .c  o  m*/
    panel.add(innerPanel);
    add(panel);
}

From source file:ColorIcon.java

public ColorIcon(int width, int height) {
    this(width, height, Color.black);
}

From source file:Main.java

public void paintComponent(Graphics g) {
    ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    g.fillRect(0, 0, getWidth(), getHeight());
    g.setColor(Color.black);
    g.drawString(month.format(date), 34, 36);
    g.setColor(Color.white);/*from   www.jav a2  s  .com*/
    g.drawString(year.format(date), 235, 36);

    Calendar today = Calendar.getInstance();
    today.setTime(date);
    Calendar cal = Calendar.getInstance();
    cal.setTime(date);
    cal.set(Calendar.DATE, 1);
    cal.add(Calendar.DATE, -cal.get(Calendar.DAY_OF_WEEK) + 1);
    for (int week = 0; week < 6; week++) {
        for (int d = 0; d < 7; d++) {
            Color col = Color.black;
            g.drawString(day.format(cal.getTime()), d * 30 + 46 + 4, week * 29 + 81 + 20);
            cal.add(Calendar.DATE, +1);
        }
    }
}

From source file:MainClass.java

public void paint(Graphics g) {
    Graphics2D g2D = (Graphics2D) g;

    Point2D.Float p1 = new Point2D.Float(150.f, 75.f);
    Point2D.Float p2 = new Point2D.Float(250.f, 75.f);
    float width = 300;
    float height = 50;
    GradientPaint g1 = new GradientPaint(p1, Color.WHITE, p2, Color.DARK_GRAY, true);
    Rectangle2D.Float rect1 = new Rectangle2D.Float(p1.x - 100, p1.y - 25, width, height);
    g2D.setPaint(g1);//from  w  w w .  j av  a2  s .co m
    g2D.fill(rect1);
    g2D.setPaint(Color.BLACK);
    g2D.draw(rect1);
    g2D.draw(new Line2D.Float(p1, p2));

}