List of usage examples for java.awt Color blue
Color blue
To view the source code for java.awt Color blue.
Click Source Link
From source file:Main.java
Main() { setDefaultCloseOperation(EXIT_ON_CLOSE); setSize(900, 600);/*from w w w.j a v a 2 s . com*/ JPanel left = new JPanel(); left.setBackground(Color.BLUE); JPanel right = new JPanel(new BorderLayout()); JLabel fox = new JLabel("The quick brown fox jumps over the lazy dog."); fox.setFont(new Font(null, 0, 50)); JPanel rightBottom = new JPanel(); rightBottom.setLayout(new GridLayout(10, 10)); for (int i = 1; i <= 100; i++) { rightBottom.add(new JButton("butt" + i)); } right.add(fox, BorderLayout.NORTH); right.add(rightBottom, BorderLayout.CENTER); add(right); }
From source file:org.jfree.graphics2d.demo.ImageTest.java
private static void drawGradientPaintTest(Graphics2D g2) { g2.setPaint(new GradientPaint(10f, 10f, Color.RED, 10f, 60f, Color.YELLOW)); g2.fillRect(10, 10, 50, 50);//from w w w . j a v a 2s . co m g2.setPaint(Color.BLUE); g2.fillRect(60, 10, 50, 50); }
From source file:Main.java
public Main() { Object[] items = { Color.red, Color.green, Color.blue }; JComboBox comboBox = new JComboBox(items); comboBox.setRenderer(new ColorRenderer(comboBox)); getContentPane().add(comboBox, BorderLayout.NORTH); add(new JTextField(), BorderLayout.SOUTH); }
From source file:RoundedLineBorder.java
public RoundedLineBorder() { super(true);//w w w . j ava 2s. c om setLayout(new BorderLayout()); JLabel label = new JLabel("Rounded Corners"); label.setHorizontalAlignment(JLabel.CENTER); LineBorder line = new LineBorder(Color.blue, 2, true); label.setBorder(line); add(label, BorderLayout.CENTER); }
From source file:Main.java
public Main() { JFrame frame = new JFrame(); JPanel container = new JPanel(); container.setLayout(new BoxLayout(container, BoxLayout.X_AXIS)); CustomPanel customPanel1 = new CustomPanel(Color.blue); CustomPanel customPanel2 = new CustomPanel(Color.red); CustomPanel customPanel3 = new CustomPanel(Color.green); container.add(customPanel1);// w w w .jav a 2 s. c o m container.add(customPanel2); container.add(customPanel3); frame.getContentPane().add(container); frame.pack(); frame.setVisible(true); }
From source file:Main.java
public Main() { JPanel simplePanel = new JPanel(new GridLayout(7, 1, 5, 5)); simplePanel.setBorder(BorderFactory.createMatteBorder(2, 5, 2, 5, Color.BLUE)); simplePanel.add(new JLabel("Examples"), JLabel.CENTER); add(simplePanel);/* www .ja va2 s .co m*/ }
From source file:Main.java
public Main() { JProgressBar jpb = new JProgressBar(); jpb.setUI(new MyProgressUI()); jpb.setForeground(Color.blue); jpb.setIndeterminate(true);/*from w w w. j av a2s . co m*/ this.add(jpb); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.add(this); f.pack(); f.setVisible(true); }
From source file:MyCanvas.java
public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; //Draw the chord Arc2D.Float arc1 = new Arc2D.Float(Arc2D.CHORD); arc1.setFrame(140, 30, 67, 46);/*from w ww . j av a 2 s.com*/ arc1.setAngleStart(45); arc1.setAngleExtent(270); g2.setColor(Color.blue); g2.draw(arc1); g2.setColor(Color.gray); g2.fill(arc1); g2.setColor(Color.black); g2.drawString("Arc2D.CHORD", 140, 20); }
From source file:cv.mikusher.freechart.BubbleChart.java
private static JFreeChart createChart(XYZDataset xyzdataset) { JFreeChart jfreechart = ChartFactory.createBubbleChart("AGE vs WEIGHT vs WORK", "Weight", "AGE", xyzdataset, PlotOrientation.HORIZONTAL, true, true, false); XYPlot xyplot = (XYPlot) jfreechart.getPlot(); xyplot.setForegroundAlpha(0.65F);/* w w w .ja va 2s . com*/ XYItemRenderer xyitemrenderer = xyplot.getRenderer(); xyitemrenderer.setSeriesPaint(0, Color.blue); NumberAxis numberaxis = (NumberAxis) xyplot.getDomainAxis(); numberaxis.setLowerMargin(0.2); numberaxis.setUpperMargin(0.5); NumberAxis numberaxis1 = (NumberAxis) xyplot.getRangeAxis(); numberaxis1.setLowerMargin(0.8); numberaxis1.setUpperMargin(0.9); return jfreechart; }
From source file:Main.java
public Main() { JPanel simplePanel = new JPanel(new GridLayout(7, 1, 5, 5)); simplePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.BLUE), "Title Line Border with color")); simplePanel.add(new JLabel("Examples"), JLabel.CENTER); add(simplePanel);//from w w w.jav a 2 s. c o m }