List of usage examples for javax.swing JLabel setFont
@BeanProperty(preferred = true, visualUpdate = true, description = "The font for the component.") public void setFont(Font font)
From source file:edu.ku.brc.specify.utilapps.ERDVisualizer.java
/** * @param font/*from w w w . j a va2 s .com*/ * @param name * @param align * @return */ public static JLabel mkLabel(final Font font, final String name, int align) { JLabel lbl = new JLabel(name, align); lbl.setFont(font); lbl.setOpaque(false); return lbl; }
From source file:TrueTypeJokerman.java
public TrueTypeJokerman() { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); ge.getAllFonts();//from ww w .j a v a 2 s . c om Font font = new Font("Jokerman", Font.PLAIN, 35); JLabel textLabel = new JLabel(textMessage); textLabel.setFont(font); getContentPane().add(textLabel); setVisible(true); }
From source file:Main.java
public Main() { super("TrueType Font Demonstration"); GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); ge.getAllFonts();// w ww. j a va2 s . com 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 .ja v a2 s .c o m Font font = new Font("Jokerman", Font.PLAIN, 35); JLabel textLabel = new JLabel(textMessage); textLabel.setFont(font); getContentPane().add(textLabel); show(); }
From source file:ArabicDigitsI18N.java
public ArabicDigitsI18N() { DecimalFormat df = (DecimalFormat) NumberFormat.getInstance(); DecimalFormatSymbols dfs = df.getDecimalFormatSymbols(); dfs.setZeroDigit('\u0660'); df.setDecimalFormatSymbols(dfs);//w ww. j a v a 2s.c om JLabel label = new JLabel(df.format(1234567.89)); label.setFont(new Font("Lucida Sans", Font.PLAIN, 22)); add(label); }
From source file:Main.java
public Main() { DecimalFormat df = (DecimalFormat) NumberFormat.getInstance(); DecimalFormatSymbols dfs = df.getDecimalFormatSymbols(); dfs.setZeroDigit('\u0660'); df.setDecimalFormatSymbols(dfs);//from www. ja va 2 s . c o m JLabel label = new JLabel(df.format(1234567.89)); label.setFont(new Font("Lucida Sans", Font.PLAIN, 22)); add(label); }
From source file:MainClass.java
public MainClass() { NumberFormat nf = NumberFormat.getInstance(); if (nf instanceof DecimalFormat) { DecimalFormat df = (DecimalFormat) nf; DecimalFormatSymbols dfs = df.getDecimalFormatSymbols(); // set the beginning of the range to Arabic digits dfs.setZeroDigit('\u0660'); df.setDecimalFormatSymbols(dfs); }/*from w w w . j av a 2 s . c om*/ JLabel label = new JLabel(nf.format(1234567.89)); label.setFont(new Font("Lucida Sans", Font.PLAIN, 22)); add(label); }
From source file:Main.java
public SplashScreen() { Container container = getContentPane(); JPanel panel = new JPanel(); panel.setBorder(new EtchedBorder()); container.add(panel, BorderLayout.CENTER); JLabel label = new JLabel("Hello World!"); label.setFont(new Font("Verdana", Font.BOLD, 14)); panel.add(label);/*w w w . j a v a 2 s . co m*/ progressBar.setMaximum(PROGBAR_MAX); container.add(progressBar, BorderLayout.SOUTH); pack(); setVisible(true); startProgressBar(); }
From source file:CombinedLayoutManager.java
protected JComponent getHeader() { JLabel label = new JLabel("Embedded Layout Manager Test", JLabel.CENTER); label.setFont(new Font("Courier", Font.BOLD, 24)); return label; }
From source file:Main.java
Main() { setDefaultCloseOperation(EXIT_ON_CLOSE); setSize(900, 600);//w w w . j a va 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); }