List of usage examples for java.awt Font PLAIN
int PLAIN
To view the source code for java.awt Font PLAIN.
Click Source Link
From source file:TrueTypeJokerman.java
public TrueTypeJokerman() { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); ge.getAllFonts();//from w w w. j ava 2 s .c o m Font font = new Font("Jokerman", Font.PLAIN, 35); JLabel textLabel = new JLabel(textMessage); textLabel.setFont(font); getContentPane().add(textLabel); setVisible(true); }
From source file:DrawSimpleText.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, 96); g2.setFont(font);// ww w. j a v a 2 s . co m g2.drawString("Java Source and Support", 40, 120); }
From source file:uk.ac.ed.epcc.webapp.charts.jfreechart.JFreeSetup.java
public static void setup() { StandardChartTheme theme = new StandardChartTheme("webapp"); theme.setSmallFont(new Font("Arial", Font.PLAIN, 10)); theme.setRegularFont(new Font("Arial", Font.PLAIN, 12)); theme.setLargeFont(new Font("Arial", Font.PLAIN, 14)); theme.setExtraLargeFont(new Font("Arial", Font.PLAIN, 20)); ChartFactory.setChartTheme(theme);/*from w w w . j ava 2 s.co m*/ }
From source file:JTextAreaI18N.java
public JTextAreaI18N() { GraphicsEnvironment.getLocalGraphicsEnvironment(); JTextArea textArea = new JTextArea(davidMessage); textArea.setFont(new Font("LucidaSans", Font.PLAIN, 40)); this.getContentPane().add(textArea); textArea.setVisible(true);/*from w w w .j ava 2s. c o m*/ }
From source file:Main.java
public Main() { super("TrueType Font Demonstration"); GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); ge.getAllFonts();// w w w . ja va 2s. c o m Font font = new Font("Jokerman", Font.PLAIN, 35); JLabel textLabel = new JLabel(textMessage); textLabel.setFont(font); getContentPane().add(textLabel); setVisible(true); }
From source file:TrueTypeTest.java
public TrueTypeTest() { super("TrueType Font Demonstration"); GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); ge.getAllFonts();//from w w w . j ava2 s .co m Font font = new Font("Jokerman", Font.PLAIN, 35); JLabel textLabel = new JLabel(textMessage); textLabel.setFont(font); getContentPane().add(textLabel); show(); }
From source file:BasicDraw.java
public void paint(Graphics g) { Font font = new Font("Serif", Font.PLAIN, 12); g.setFont(font);/*from ww w . java2s.c o m*/ g.drawString("a String", 10, 10); FontMetrics fontMetrics = g.getFontMetrics(); g.drawString("aString", 10, 10 + fontMetrics.getAscent()); }
From source file:RevalidateExample.java
public RevalidateExample() { super("Revalidation Demo"); setSize(300, 150);// w w w.ja v a2 s .c o m setDefaultCloseOperation(EXIT_ON_CLOSE); Font font = new Font("Dialog", Font.PLAIN, 10); final JButton b = new JButton("Add"); b.setFont(font); Container c = getContentPane(); c.setLayout(new FlowLayout()); c.add(b); b.addActionListener(new ActionListener() { // Increase the size of the button's font each time it's clicked int size = 20; public void actionPerformed(ActionEvent ev) { b.setFont(new Font("Dialog", Font.PLAIN, ++size)); b.revalidate(); // invalidates the button & validates its root pane } }); }
From source file:MainClass.java
public void loadFont() throws FontFormatException, IOException { String fontFileName = "yourfont.ttf"; InputStream is = this.getClass().getResourceAsStream(fontFileName); Font ttfBase = Font.createFont(Font.TRUETYPE_FONT, is); Font ttfReal = ttfBase.deriveFont(Font.PLAIN, 24); }
From source file:com.uttesh.pdfngreport.util.chart.ChartStyle.java
/** * this method will set the style theme for pie chart. * * @see org.jfree.chart.StandardChartTheme * @param chart/*from w w w . j a v a 2 s. c o m*/ */ public static void theme(JFreeChart chart) { String fontName = "Lucida Sans"; StandardChartTheme theme = (StandardChartTheme) org.jfree.chart.StandardChartTheme.createJFreeTheme(); theme.setTitlePaint(Color.decode("#4572a7")); theme.setExtraLargeFont(new Font(fontName, Font.PLAIN, 16)); //title theme.setLargeFont(new Font(fontName, Font.BOLD, 15)); //axis-title theme.setRegularFont(new Font(fontName, Font.PLAIN, 11)); theme.setRangeGridlinePaint(Color.decode("#C0C0C0")); theme.setPlotBackgroundPaint(Color.white); theme.setChartBackgroundPaint(Color.white); theme.setGridBandPaint(Color.red); theme.setAxisOffset(new RectangleInsets(0, 0, 0, 0)); theme.setBarPainter(new StandardBarPainter()); theme.setAxisLabelPaint(Color.decode("#666666")); theme.apply(chart); chart.setTextAntiAlias(true); chart.setAntiAlias(true); }