List of usage examples for java.awt Color WHITE
Color WHITE
To view the source code for java.awt Color WHITE.
Click Source Link
From source file:TexturedPanel.java
/** * Creates a new TexturedPanel with a simple striped pattern. *//* ww w . j ava 2 s . c o m*/ public TexturedPanel() { super(); ourDefaultForeground = Color.white; ourDefaultBackground = getBackground(); setupDefaultPainter(ourDefaultForeground, ourDefaultBackground); }
From source file:Operacional.Janela2.java
private static JFreeChart createChart(IntervalXYDataset intervalxydataset) { JFreeChart jfreechart = ChartFactory.createXYBarChart("Dados Parquimetro", "Mes", true, "Dados", intervalxydataset, PlotOrientation.VERTICAL, true, false, false); jfreechart.setBackgroundPaint(Color.white); XYPlot xyplot = jfreechart.getXYPlot(); XYItemRenderer xyitemrenderer = xyplot.getRenderer(); StandardXYToolTipGenerator standardxytooltipgenerator = new StandardXYToolTipGenerator("{1} = {2}", new SimpleDateFormat("yyyy"), new DecimalFormat("0")); //xyitemrenderer.setToolTipGenerator(standardxytooltipgenerator); xyplot.setBackgroundPaint(Color.lightGray); xyplot.setRangeGridlinePaint(Color.white); DateAxis dateaxis = (DateAxis) xyplot.getDomainAxis(); dateaxis.setTickMarkPosition(DateTickMarkPosition.MIDDLE); dateaxis.setLowerMargin(0.01D);//from w w w . java2 s. c om dateaxis.setUpperMargin(0.01D); return jfreechart; }
From source file:SplashScreen.java
public void showSplash() { JPanel content = (JPanel) getContentPane(); content.setBackground(Color.white); // Set the window's bounds, centering the window int width = 450; int height = 115; Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); int x = (screen.width - width) / 2; int y = (screen.height - height) / 2; setBounds(x, y, width, height);/*from ww w . j av a 2s.c om*/ // Build the splash screen JLabel label = new JLabel(new ImageIcon("1.gif")); JLabel copyrt = new JLabel("Copyright 2002, O'Reilly & Associates", JLabel.CENTER); copyrt.setFont(new Font("Sans-Serif", Font.BOLD, 12)); content.add(label, BorderLayout.CENTER); content.add(copyrt, BorderLayout.SOUTH); Color oraRed = new Color(156, 20, 20, 255); content.setBorder(BorderFactory.createLineBorder(oraRed, 10)); // Display it setVisible(true); // Wait a little while, maybe while loading resources try { Thread.sleep(duration); } catch (Exception e) { } setVisible(false); }
From source file:DropTest2.java
public DropTest2() { super("Drop Test"); setSize(300, 300);//from w w w.ja v a 2s. com getContentPane().add(new JLabel("Drop a list from your file chooser here:"), BorderLayout.NORTH); ta = new JTextArea(); ta.setBackground(Color.white); getContentPane().add(ta, BorderLayout.CENTER); // Set up our text area to recieve drops... // This class will handle drop events dt = new DropTarget(ta, this); setVisible(true); }
From source file:br.unicamp.cst.util.ChartViewerUtil.java
public static synchronized ChartPanel createLineXYChart(XYSeriesCollection dataset, String title, String categoryAxisLabel, String valueAxisLabel, long timeRefresh) { final JFreeChart chart = ChartFactory.createXYLineChart(title, categoryAxisLabel, valueAxisLabel, dataset, PlotOrientation.VERTICAL, true, true, false); final XYPlot plot = chart.getXYPlot(); plot.setBackgroundPaint(Color.lightGray); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); plot.getDomainAxis().setFixedAutoRange(timeRefresh * 100); chart.setBackgroundPaint(Color.lightGray); ChartPanel localChartPanel = new ChartPanel(chart); localChartPanel.setVisible(true);/* www. ja va2 s. com*/ localChartPanel.setDomainZoomable(true); return localChartPanel; }
From source file:AlphaCompositeSRCOUT.java
DrawingCanvas() {
setSize(300, 300);
setBackground(Color.white);
}
From source file:BufferedImageMouseDrag.java
DisplayCanvas() { setBackground(Color.white); setSize(450, 400);// www. ja v a2 s. c o m addMouseMotionListener(new MouseMotionHandler()); Image image = getToolkit().getImage("largeJava2sLogo.gif"); MediaTracker mt = new MediaTracker(this); mt.addImage(image, 1); try { mt.waitForAll(); } catch (Exception e) { System.out.println("Exception while loading image."); } if (image.getWidth(this) == -1) { System.out.println("no gif file"); System.exit(0); } bi = new BufferedImage(image.getWidth(this), image.getHeight(this), BufferedImage.TYPE_INT_ARGB); Graphics2D big = bi.createGraphics(); big.drawImage(image, 0, 0, this); }
From source file:MonthPanel.java
protected JPanel createTitleGUI() { JPanel titlePanel = new JPanel(true); titlePanel.setLayout(new FlowLayout()); titlePanel.setBackground(Color.WHITE); JLabel label = new JLabel(monthNames[month] + " " + year); label.setForeground(SystemColor.activeCaption); titlePanel.add(label, BorderLayout.CENTER); return titlePanel; }
From source file:org.jfree.chart.demo.XYBlockChartDemo3.java
private static JFreeChart createChart(XYZDataset xyzdataset) { NumberAxis numberaxis = new NumberAxis("X"); numberaxis.setLowerMargin(0.0D);// w w w.j ava2s . 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:Main.java
public void render(Graphics g) { Graphics2D g2d = (Graphics2D) g; g2d.setColor(Color.WHITE); Font font = new Font("Verdana", Font.PLAIN, 20); g2d.setFont(font);//from ww w .ja va 2 s . c o m g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); FontMetrics fm = g2d.getFontMetrics(); String option = "This is a test"; int x = (getWidth() - fm.stringWidth(option)) / 2; int y = ((getHeight() - fm.getHeight()) / 2); g2d.drawString(option, x, y + fm.getAscent()); g2d.drawRect((int) x - 20, (int) y - 10, (int) fm.stringWidth(option) + 40, (int) fm.getHeight() + 20); }