List of usage examples for java.awt Color DARK_GRAY
Color DARK_GRAY
To view the source code for java.awt Color DARK_GRAY.
Click Source Link
From source file:Main.java
static void createFrameAtLocation(Point p) { JFrame frame = new JFrame(); frame.setTitle("Test frame on two screens"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel panel = new JPanel(new BorderLayout()); JTextArea textareaA = new JTextArea(24, 80); textareaA.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY, 1)); panel.add(textareaA, BorderLayout.CENTER); frame.setLocation(p);//from w w w . ja v a2 s .c o m frame.add(panel); frame.pack(); frame.setExtendedState(Frame.MAXIMIZED_BOTH); frame.setVisible(true); }
From source file:st.jigasoft.dbutil.util.ReportTheme.java
public static void circularTheme(JFreeChart chart, String... colunsName) { chart.setBackgroundPaint(//ww w.j a v a2s. co m new GradientPaint(new Point(0, 0), new Color(20, 20, 20), new Point(400, 200), Color.DARK_GRAY)); TextTitle t = chart.getTitle(); t.setHorizontalAlignment(HorizontalAlignment.LEFT); t.setPaint(new Color(240, 240, 240)); t.setFont(new Font("Arial", Font.BOLD, 26)); PiePlot plot = (PiePlot) chart.getPlot(); plot.setBackgroundPaint(null); plot.setInteriorGap(0.04); plot.setOutlineVisible(false); int iCount = 0; // use gradients and white borders for the section colours for (Object s : colunsName) { plot.setSectionPaint(s.toString(), createGradientPaint(new Color(200, 200, 255), colorItems(iCount++))); if (iCount == MAX_COLUNS_COLOR) iCount = 0; } plot.setBaseSectionOutlinePaint(Color.WHITE); plot.setSectionOutlinesVisible(true); plot.setBaseSectionOutlineStroke(new BasicStroke(2.0f)); plot.setLabelFont(new Font("Courier New", Font.BOLD, 20)); plot.setLabelLinkPaint(Color.WHITE); plot.setLabelLinkStroke(new BasicStroke(2.0f)); plot.setLabelOutlineStroke(null); plot.setLabelPaint(Color.WHITE); plot.setLabelBackgroundPaint(null); // // add a subtitle giving the data source TextTitle source = new TextTitle("Source: http://www.bbc.co.uk/news/business-15489523", new Font("Courier New", Font.PLAIN, 12)); source.setPaint(Color.WHITE); source.setPosition(RectangleEdge.BOTTOM); source.setHorizontalAlignment(HorizontalAlignment.RIGHT); chart.addSubtitle(source); }
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 ww w. java2 s.c o m g2D.fill(rect1); g2D.setPaint(Color.BLACK); g2D.draw(rect1); g2D.draw(new Line2D.Float(p1, p2)); }
From source file:Main.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); Rectangle2D.Float rect1 = new Rectangle2D.Float(p1.x - 100, p1.y - 25, width, height); g2D.setPaint(g1);/* w ww . j a va 2 s . c o m*/ g2D.fill(rect1); g2D.setPaint(Color.BLACK); g2D.draw(rect1); g2D.draw(new Line2D.Float(p1, p2)); g2D.drawString("Cyclic Gradient Paint", p1.x - 100, p1.y - 50); g2D.drawString("p1", p1.x - 20, p1.y); g2D.drawString("p2", p2.x + 10, p2.y); p1.setLocation(150, 200); p2.setLocation(250, 200); GradientPaint g2 = new GradientPaint(p1, Color.WHITE, p2, Color.DARK_GRAY, false); rect1.setRect(p1.x - 100, p1.y - 25, width, height); g2D.setPaint(g2); g2D.fill(rect1); g2D.setPaint(Color.BLACK); g2D.draw(rect1); g2D.draw(new Line2D.Float(p1, p2)); g2D.drawString("Acyclic Gradient Paint", p1.x - 100, p1.y - 50); g2D.drawString("p1", p1.x - 20, p1.y); g2D.drawString("p2", p2.x + 10, p2.y); }
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);// www . j a va 2 s .c om g2D.fill(rect1); g2D.setPaint(Color.BLACK); g2D.draw(rect1); g2D.draw(new Line2D.Float(p1, p2)); g2D.drawString("Cyclic Gradient Paint", p1.x - 100, p1.y - 50); g2D.drawString("p1", p1.x - 20, p1.y); g2D.drawString("p2", p2.x + 10, p2.y); p1.setLocation(150, 200); p2.setLocation(250, 200); GradientPaint g2 = new GradientPaint(p1, Color.WHITE, p2, Color.DARK_GRAY, false); rect1.setRect(p1.x - 100, p1.y - 25, width, height); g2D.setPaint(g2); g2D.fill(rect1); g2D.setPaint(Color.BLACK); g2D.draw(rect1); g2D.draw(new Line2D.Float(p1, p2)); g2D.drawString("Acyclic Gradient Paint", p1.x - 100, p1.y - 50); g2D.drawString("p1", p1.x - 20, p1.y); g2D.drawString("p2", p2.x + 10, p2.y); }
From source file:GradientPane.java
public void paint(Graphics g) { Graphics2D g2D = (Graphics2D) g; Point2D.Float p1 = new Point2D.Float(150.f, 75.f); // Gradient line start Point2D.Float p2 = new Point2D.Float(250.f, 75.f); // Gradient line end float width = 300; float height = 50; Rectangle2D.Float rect1 = new Rectangle2D.Float(p1.x - 100, p1.y - 25, width, height); GradientPaint g2 = new GradientPaint(p1, Color.WHITE, p2, Color.DARK_GRAY, false); // Acyclic // gradient rect1.setRect(p1.x - 100, p1.y - 25, width, height); g2D.setPaint(g2); // Gradient color fill g2D.fill(rect1); // Fill the rectangle g2D.setPaint(Color.BLACK); // Outline in black g2D.draw(rect1); // Fill the rectangle g2D.draw(new Line2D.Float(p1, p2)); }
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:org.slage.ui.ToolBar.java
/** * /** Creates a new instance of ToolBar * //from w ww. j a v a 2 s . c o m * @param ownerGame * Game that owns the tool bar */ public ToolBar(SlageGame ownerGame) { this.game = ownerGame; if (ownerGame == null) { setBackground(Color.DARK_GRAY); setForeground(Color.BLACK); setFont(new Font("Arial", 1, 10)); } else { try { setBackground((Color) ownerGame.getAttributeValue("Toolbar Background Color")); } catch (NotFoundException e) { LOG.warn(e); } try { setForeground((Color) ownerGame.getAttributeValue("Toolbar Foreground Color")); } catch (NotFoundException e) { LOG.warn(e); } try { setFont((Font) ownerGame.getAttributeValue("Toolbar Font")); } catch (NotFoundException e) { LOG.warn(e); } } setLayout(new GridLayout(1, 1)); resize(); setFocusTraversalKeysEnabled(false); // disable focus change when tab // is // pressed }
From source file:dk.netdesign.common.osgi.config.osgi.OCD.java
@Override public InputStream getIcon(int iconDimension) throws IOException { BufferedImage img = null;/* ww w . j a v a 2 s. co m*/ img = ImageIO.read(iconFile); BufferedImage resizedImage = scaleImage(img, iconDimension, iconDimension, Color.DARK_GRAY); ByteArrayOutputStream os = new ByteArrayOutputStream(); ImageIO.write(resizedImage, "jpg", os); return new ByteArrayInputStream(os.toByteArray()); }
From source file:netplot.XYPlotPanel.java
private JFreeChart createChart(XYDataset dataset) { JFreeChart chart = ChartFactory.createXYLineChart(plotTitle, xAxisName, yAxisName, dataset, PlotOrientation.VERTICAL, enableLegend, true, true); XYPlot plot = (XYPlot) chart.getPlot(); plot.setBackgroundPaint(Color.WHITE); plot.setDomainGridlinePaint(Color.DARK_GRAY); plot.setRangeGridlinePaint(Color.DARK_GRAY); return chart; }