List of usage examples for java.awt Color BLACK
Color BLACK
To view the source code for java.awt Color BLACK.
Click Source Link
From source file:UIUtilities.java
/** * Set up the user interface./* w w w . j a v a 2 s . c o m*/ */ public static void setupUI() { try { final String classname = UIManager.getSystemLookAndFeelClassName(); UIManager.setLookAndFeel(classname); } catch (Exception e) { e.printStackTrace(); } final UIDefaults defaults = UIManager.getDefaults(); defaults.put("PopupMenu.border", new BorderUIResource.EtchedBorderUIResource(EtchedBorder.RAISED, defaults.getColor("controlShadow"), defaults.getColor("controlLtHighlight"))); final MatteBorder matteborder = new MatteBorder(1, 1, 1, 1, Color.black); final EmptyBorder emptyborder = new MatteBorder(2, 2, 2, 2, defaults.getColor("control")); final BorderUIResource.CompoundBorderUIResource compBorder = new BorderUIResource.CompoundBorderUIResource( emptyborder, matteborder); final BorderUIResource.EmptyBorderUIResource emptyBorderUI = new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0); defaults.put("SplitPane.border", emptyBorderUI); defaults.put("Table.scrollPaneBorder", emptyBorderUI); defaults.put("ComboBox.border", compBorder); defaults.put("TextField.border", compBorder); defaults.put("TextArea.border", compBorder); defaults.put("CheckBox.border", compBorder); defaults.put("ScrollPane.border", emptyBorderUI); }
From source file:ImageProcessing.GrayscaleHistogram_GUI.java
public GrayscaleHistogram_GUI(Component callerComponent) { //callerComponent is used only to determine the position of this //frame when called. initComponents();/*www .ja v a2s. co m*/ this.setLocationRelativeTo(callerComponent); //Determine chart width & height in display. int chartLabelHeight = sourceImageHistogram.getHeight(); int chartLabelWidth = sourceImageHistogram.getWidth(); //Get Grayscale value for every pixels from source & processed image. double[] sourceGrayValues = ImageProcessing.extractGrayColor(Main.getSourceImage()); double[] processedGrayValues = ImageProcessing.extractGrayColor(Main.getProcessedImage()); //Create two charts using the grayscale values. JFreeChart sourceChart = ImageProcessing.createHistogram(sourceGrayValues, Color.BLACK); JFreeChart processedChart = ImageProcessing.createHistogram(processedGrayValues, Color.BLACK); //Convert the charts to a BufferedImage for displaying. BufferedImage sourceChartImage = sourceChart.createBufferedImage(chartLabelWidth, chartLabelHeight); BufferedImage processedChartImage = processedChart.createBufferedImage(chartLabelWidth, chartLabelHeight); //Display the chart images. sourceImageHistogram.setIcon(new ImageIcon(sourceChartImage)); processedImageHistogram.setIcon(new ImageIcon(processedChartImage)); }
From source file:UserInterface.JFreeChartJPanel.java
public JFreeChartJPanel(VitalSign vs, JPanel upc) { initComponents();//from w ww .j a va2 s .c o m this.vs = vs; this.upc = upc; int rr = (vs.getRespiratoryrate()); int hr = vs.getHeartrate(); int bp = vs.getBloodpressure(); double w = vs.getWeight(); DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.setValue(rr, "", "Respiratory Rate"); dataset.setValue(hr, "", "Heart Rate"); dataset.setValue(bp, "", "Blood Pressure"); dataset.setValue(w, "", "Weight"); // org.jfree.chart.JFreeChart chart = ChartFactory.createBarChart("VitalSign", "Vital Signs", "Range", dataset, PlotOrientation.VERTICAL, false, true, false); CategoryPlot plot = chart.getCategoryPlot(); plot.setRangeGridlinePaint(Color.black); ChartFrame frame = new ChartFrame("Bar Chart for _---_", chart); frame.setVisible(true); frame.setSize(600, 600); }
From source file:Calendar.java
public Calendar() { super();/* ww w. ja v a 2 s.co m*/ getContentPane().setLayout(null); comboBox.setBounds(10, 10, 100, 30); comboBox.setSelectedIndex(0); comboBox.addItemListener(new ComboHandler()); scrollPane.setBounds(200, 10, 150, 100); list.setSelectedIndex(3); list.addListSelectionListener(new ListHandler()); table.setBounds(10, 150, 550, 200); model.setMonth(comboBox.getSelectedIndex() + 1998, list.getSelectedIndex()); getContentPane().add(comboBox); getContentPane().add(scrollPane); table.setGridColor(Color.black); table.setShowGrid(true); getContentPane().add(table); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(500, 500); setVisible(true); }
From source file:Main.java
public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); Font font = new Font("Serif", Font.PLAIN, 72); g2.setFont(font);/* w w w . j ava2 s. c o m*/ String s = "this is a test"; float x = 50, y = 150; // Draw the baseline. FontRenderContext frc = g2.getFontRenderContext(); float width = (float) font.getStringBounds(s, frc).getWidth(); Line2D baseline = new Line2D.Float(x, y, x + width, y); g2.setPaint(Color.red); g2.draw(baseline); // Draw the ascent. LineMetrics lm = font.getLineMetrics(s, frc); Line2D ascent = new Line2D.Float(x, y - lm.getAscent(), x + width, y - lm.getAscent()); g2.draw(ascent); // Draw the descent. Line2D descent = new Line2D.Float(x, y + lm.getDescent(), x + width, y + lm.getDescent()); g2.draw(descent); // Draw the leading. Line2D leading = new Line2D.Float(x, y + lm.getDescent() + lm.getLeading(), x + width, y + lm.getDescent() + lm.getLeading()); g2.draw(leading); // Render the string. g2.setPaint(Color.black); g2.drawString(s, x, y); }
From source file:UserInterface.JFreeChart.java
public JFreeChart(VitalSign vs, JPanel upc) { initComponents();/*from www. jav a2 s.c om*/ this.vs = vs; this.upc = upc; int rr = (vs.getRespiratoryrate()); int hr = vs.getHeartrate(); int bp = vs.getBloodpressure(); double w = vs.getWeight(); DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.setValue(rr, "", "Respiratory Rate"); dataset.setValue(hr, "", "Heart Rate"); dataset.setValue(bp, "", "Blood Pressure"); dataset.setValue(w, "", "Weight"); // org.jfree.chart.JFreeChart chart = ChartFactory.createBarChart("VitalSign", "Vital Signs", "Range", dataset, PlotOrientation.VERTICAL, false, true, false); CategoryPlot plot = chart.getCategoryPlot(); plot.setRangeGridlinePaint(Color.black); ChartFrame frame = new ChartFrame("Bar Chart for _---_", chart); frame.setVisible(true); frame.setSize(450, 350); }
From source file:LineMetricsIllustration.java
public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); Font font = new Font("Serif", Font.PLAIN, 72); g2.setFont(font);// w w w. j a v a2 s .c o m String s = "Java Source and Support"; float x = 50, y = 150; // Draw the baseline. FontRenderContext frc = g2.getFontRenderContext(); float width = (float) font.getStringBounds(s, frc).getWidth(); Line2D baseline = new Line2D.Float(x, y, x + width, y); g2.setPaint(Color.red); g2.draw(baseline); // Draw the ascent. LineMetrics lm = font.getLineMetrics(s, frc); Line2D ascent = new Line2D.Float(x, y - lm.getAscent(), x + width, y - lm.getAscent()); g2.draw(ascent); // Draw the descent. Line2D descent = new Line2D.Float(x, y + lm.getDescent(), x + width, y + lm.getDescent()); g2.draw(descent); // Draw the leading. Line2D leading = new Line2D.Float(x, y + lm.getDescent() + lm.getLeading(), x + width, y + lm.getDescent() + lm.getLeading()); g2.draw(leading); // Render the string. g2.setPaint(Color.black); g2.drawString(s, x, y); }
From source file:bbank.CurrentStockWindow.java
/** * Creates new form CurrentStockWindow/*from w w w.ja v a2s .co m*/ */ public CurrentStockWindow() { initComponents(); DefaultCategoryDataset dataset = new DefaultCategoryDataset(); BloodStock.CalculateTotalBlood(); dataset.addValue(BloodStock.total_A_accepted, "", "Total Accepted A"); dataset.addValue(BloodStock.total_A_rejected, "", "Total Rejected A"); dataset.addValue(BloodStock.total_B_accepted, "", "Total Accepted B"); dataset.addValue(BloodStock.total_B_rejected, "", "Total Rejected B"); dataset.addValue(BloodStock.total_O_accepted, "", "Total Accepted O"); dataset.addValue(BloodStock.total_O_rejected, "", "Total Rejected O"); JFreeChart chart = ChartFactory.createBarChart("Current Total Blood Stock", "Blood type", "Amount (litres)", dataset, PlotOrientation.VERTICAL, false, false, false); CategoryPlot catPlot = chart.getCategoryPlot(); catPlot.setRangeGridlinePaint(Color.BLACK); ChartPanel chartpanel = new ChartPanel(chart); jPanel1.removeAll(); jPanel1.add(chartpanel); jPanel1.validate(); }
From source file:Main.java
public Main() { UIManager.put("TabbedPane.contentBorderInsets", new InsetsUIResource(1, 0, 0, 0)); UIManager.put("TabbedPane.contentAreaColor", new ColorUIResource(Color.GREEN)); UIManager.put("TabbedPane.focus", new ColorUIResource(Color.ORANGE)); UIManager.put("TabbedPane.selected", new ColorUIResource(Color.YELLOW)); UIManager.put("TabbedPane.darkShadow", new ColorUIResource(Color.DARK_GRAY)); UIManager.put("TabbedPane.borderHightlightColor", new ColorUIResource(Color.LIGHT_GRAY)); UIManager.put("TabbedPane.light", new ColorUIResource(Color.WHITE)); UIManager.put("TabbedPane.tabAreaBackground", new ColorUIResource(Color.CYAN)); UIManager.put("ToolTip.background", Color.WHITE); UIManager.put("ToolTip.border", new BorderUIResource(new LineBorder(Color.BLACK))); this.updateUI(); this.setBackground(Color.BLUE); JPanel testPanel = new JPanel(); testPanel.setLayout(new BorderLayout()); testPanel.add(new JLabel("Hello World"), BorderLayout.NORTH); testPanel.add(new JTextArea("Looks nice out there :)"), BorderLayout.CENTER); JPanel testPanel2 = new JPanel(); testPanel2.setLayout(new BorderLayout()); testPanel2.add(new JLabel("Good Bye World"), BorderLayout.NORTH); testPanel2.add(new JTextArea("OK"), BorderLayout.CENTER); this.addTab("Hello World", testPanel); this.addTab("World", testPanel2); }
From source file:jurls.core.utils.MatrixImage.java
public MatrixImage(int width, int height) { setDoubleBuffered(true);//ww w .j a va2 s .co m setIgnoreRepaint(true); setBackground(Color.BLACK); setPreferredSize(new Dimension(width, height)); setMinimumSize(new Dimension(width, height)); }