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:Main.java

/** 
 * Adds a basic black line border around the given component.
 * @param c - the component to put the border around
 *//*  w ww  . j  a va  2 s  .c  om*/
public static void addLineBorder(JComponent c) {
    Border lineBorder;
    lineBorder = BorderFactory.createLineBorder(Color.black);
    c.setBorder(lineBorder);
}

From source file:Main.java

private static Component blackJTextPane() {
    JTextPane pane = new JTextPane();
    pane.setBackground(Color.BLACK);
    pane.setForeground(Color.WHITE);
    pane.setText("Here is example text");
    return pane;/*from   ww  w . j a v a2 s.com*/
}

From source file:JDK6SplashTest.java

static void renderSplashFrame(Graphics2D g, int frame) {
    final String[] comps = { "foo", "bar", "baz" };
    g.setComposite(AlphaComposite.Clear);
    g.fillRect(130, 250, 280, 40);//  www . j  a  va2 s  .  co m
    g.setPaintMode();
    g.setColor(Color.BLACK);
    g.drawString("Loading " + comps[(frame / 5) % 3] + "...", 130, 260);
    g.fillRect(130, 270, (frame * 10) % 280, 20);
}

From source file:Main.java

public static void addNewLineTo(Container container, int lineHeight) {
    JLabel label = new JLabel();
    label.setPreferredSize(new Dimension(SCREEN_SIZE.width, lineHeight));
    label.setBorder(new LineBorder(Color.BLACK));
    container.add(label);//from   w ww  .j a va  2s  .c o m
}

From source file:net.sf.maltcms.chromaui.charts.GradientPaintScale.java

/**
 *
 * @param args//  w ww .ja  v  a2 s .  c o  m
 */
public static void main(String[] args) {
    double[] st = ImageTools.createSampleTable(256);
    Logger.getLogger(GradientPaintScale.class.getName()).info(Arrays.toString(st));
    double min = 564.648;
    double max = 24334.234;
    GradientPaintScale gps = new GradientPaintScale(st, min, max,
            new Color[] { Color.BLACK, Color.RED, Color.orange, Color.yellow, Color.white });
    double val = min;
    double incr = (max - min) / (st.length - 1);
    Logger.getLogger(GradientPaintScale.class.getName()).log(Level.INFO, "Increment: {0}", incr);
    for (int i = 0; i < st.length; i++) {
        Logger.getLogger(GradientPaintScale.class.getName()).log(Level.INFO, "Value: {0}", val);
        gps.getPaint(val);
        val += incr;
    }
    Logger.getLogger(GradientPaintScale.class.getName()).info("Printing min and max values");
    Logger.getLogger(GradientPaintScale.class.getName()).log(Level.INFO, "Min: {0} gps min: {1}",
            new Object[] { min, gps.getPaint(min) });
    Logger.getLogger(GradientPaintScale.class.getName()).log(Level.INFO, "Max: {0} gps max: {1}",
            new Object[] { max, gps.getPaint(max) });
    JList jl = new JList();
    DefaultListModel dlm = new DefaultListModel();
    jl.setModel(dlm);
    jl.setCellRenderer(new ListCellRenderer() {
        @Override
        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
                boolean cellHasFocus) {
            if (value instanceof JLabel) {
                // Border b =
                // BorderFactory.createCompoundBorder(BorderFactory
                // .createEmptyBorder(0, 0, 5, 0), BorderFactory
                // .createLineBorder(Color.BLACK, 1));
                // ((JLabel) value).setBorder(b);
                return (Component) value;
            }
            return new JLabel(value.toString());
        }
    });
    JFrame jf = new JFrame();
    jf.add(new JScrollPane(jl));
    jf.setVisible(true);
    jf.setSize(200, 400);
    for (int alpha = -10; alpha <= 10; alpha++) {
        for (int beta = 1; beta <= 20; beta++) {
            gps.setAlphaBeta(alpha, beta);
            // System.out.println(Arrays.toString(gps.st));
            // System.out.println(Arrays.toString(gps.sampleTable));
            BufferedImage bi = gps.getLookupImage();
            ImageIcon ii = new ImageIcon(bi);
            dlm.addElement(new JLabel(ii));
        }
    }

}

From source file:Main.java

public static BufferedImage joinBufferedImage(BufferedImage img1, BufferedImage img2) {
    int offset = 2;
    int width = img1.getWidth() + img2.getWidth() + offset;
    int height = Math.max(img1.getHeight(), img2.getHeight()) + offset;
    BufferedImage newImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
    Graphics2D g2 = newImage.createGraphics();
    Color oldColor = g2.getColor();
    g2.setPaint(Color.BLACK);
    g2.fillRect(0, 0, width, height);/*from   w ww  .  j a v a 2 s.c  o  m*/
    g2.setColor(oldColor);
    g2.drawImage(img1, null, 0, 0);
    g2.drawImage(img2, null, img1.getWidth() + offset, 0);
    g2.dispose();
    return newImage;
}

From source file:Main.java

public static JLabel createVerticalLineLabel() {
    MatteBorder mb = new MatteBorder(0, 1, 0, 0, Color.black);
    JLabel label = new JLabel();
    label.setBorder(mb);//from w w w .  j  ava  2s.  c om
    return label;
}

From source file:Main.java

public static JLabel createHorizontalLineLabel() {
    MatteBorder mb = new MatteBorder(0, 0, 1, 0, Color.black);
    JLabel label = new JLabel();
    label.setBorder(mb);/*w  w w.  j a v a 2s .  c  o  m*/
    return label;
}

From source file:Main.java

public static Border getBorderDefault(int thickness) {
    return BorderFactory.createLineBorder(Color.black, thickness);
}

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

private static JFreeChart createChart(ValueDataset valuedataset) {
    CompassPlot compassplot = new CompassPlot(valuedataset);
    compassplot.setSeriesNeedle(7);/*  w w w.  j av  a2 s  .  c o  m*/
    compassplot.setSeriesPaint(0, Color.black);
    compassplot.setSeriesOutlinePaint(0, Color.black);
    compassplot.setRosePaint(Color.red);
    compassplot.setRoseHighlightPaint(Color.gray);
    compassplot.setRoseCenterPaint(Color.white);
    compassplot.setDrawBorder(false);
    JFreeChart jfreechart = new JFreeChart(compassplot);
    return jfreechart;
}