Demos and Usage of java.awt.Component.setFont(Font f)


   1: 
   2: import java.awt.Component;
   3: import javax.swing.JTable;
   4:         ...
   5: 
   6:     public Component getTableCellRendererComponent(JTable table, Object value, 
   7:         boolean isSelected, boolean hasFocus, int row, int column)
   8:         ...
   9:             
  10:             Component c = super.getTableCellRendererComponent(table, attType.getValue(), isSelected, hasFocus, row, column);
  11:             
  12:         ...
  13:             {
  14:                 c.setFont(boldFont);

View Full Code Here
   1: 
   2: import java.awt.Component;
   3: import java.awt.Font;
   4:         ...
   5: 
   6:   public Component getTableCellRendererComponent(JTable table, Object value,
   7:     boolean isSelected, boolean hasFocus, int row, int column) {
   8:         ...
   9: 
  10:     Component comp;
  11:     if (delegateRenderer==null) {
  12:         ...
  13:     }
  14:     comp.setFont(font);

View Full Code Here
   1: 
   2: import java.awt.Component;
   3: import javax.swing.JTable;
   4:         ...
   5:      
   6:     public Component getTableCellRendererComponent(JTable table, Object value, 
   7:         boolean isSelected, boolean hasFocus, int row, int column)
   8:         ...
   9:             
  10:             Component c = super.getTableCellRendererComponent(table, attString, isSelected, hasFocus, row, column);
  11:             
  12:         ...
  13:                 c.setForeground(((isSelected)?Color.white:Color.blue));
  14:                 c.setFont(boldFont);

View Full Code Here
   1: 
   2:     public Component getRendererComponent() {
   3:         TreeModel treeModel = tree.getModel();
   4:         ...
   5:         boolean isLeaf = treeModel.isLeaf(item);
   6:         Component component = renderer.getTreeCellRendererComponent(tree, item, isSelected, isExpanded, isLeaf, rowIndex, hasFocus);
   7:         ...
   8:         component.setFont(tree.getFont());
   9:         return component;

View Full Code Here
   1:     private SimpleDateFormat    m_dFormat = null;
   2:     public Component getTableCellRendererComponent(JTable table, Object value,
   3:         boolean isSelected, boolean hasFocus, int row, int col)
   4:         ...
   5:     {
   6:         Component c = m_check;
   7:             c = super.getTableCellRendererComponent(table,value, isSelected,hasFocus, row,col);
   8:         ...
   9:         if (m_rm.isGroupRow(row))
  10:             c.setFont(c.getFont().deriveFont(Font.BOLD));
  11:         setValue (value);

View Full Code Here
   1: 
   2:         public Component getListCellRendererComponent(
   3:                 JList l, Object v, int i, boolean sel, boolean foc)
   4:         ...
   5:         {
   6:             Component c = super.getListCellRendererComponent(
   7:                     l, v.toString().substring(1), i, sel, foc);
   8:         ...
   9:             c.setFont(v.toString().charAt(0) == '/' ? italic : normal);
  10:             return c;

View Full Code Here
   1: }
   2:     public static void recursivelySetFonts(Component comp, Font font) {
   3:         ...
   4:         comp.setFont(font);
   5:         if (comp instanceof Container) {
   6:             Container cont = (Container) comp;
   7:             for(int j=0, ub=cont.getComponentCount(); j<ub; ++j)

View Full Code Here
   1: import java.awt.Color;
   2: import java.awt.Component;
   3: import java.awt.Font;
   4:         ...
   5: 
   6:                 public Component getTreeCellRendererComponent(JTree tree,
   7:                     Object value, boolean sel, boolean expanded, boolean leaf,
   8:         ...
   9:                     int row, boolean hasFocus) {
  10:                     Component component = super.getTreeCellRendererComponent(tree,
  11:                             (text == null) ? value : text, sel, expanded, leaf,
  12:         ...
  13:                             row, hasFocus);
  14:                     component.setFont(font);

View Full Code Here
   1: import java.io.*;
   2: import java.awt.Component;
   3: import java.awt.Container;
   4:         ...
   5:         }
   6:         public void recursivelySetFonts(Component comp, Font font) {
   7:         ...
   8:             comp.setFont(font);
   9:             if (comp instanceof Container) {

View Full Code Here
   1:     private JCheckBox           m_check = null;
   2:     public Component getTableCellRendererComponent (JTable table, Object value,
   3:         boolean isSelected, boolean hasFocus, int row, int col)
   4:         ...
   5: 
   6:         Component c = null;
   7:         if (m_displayType == DisplayType.YesNo)
   8:         ...
   9:             c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col);
  10:             c.setFont(CompierePLAF.getFont_Field());
  11:         }

View Full Code Here
   1: import java.awt.Color;
   2: import java.awt.Component;
   3: import java.awt.ComponentOrientation;
   4:         ...
   5: 
   6:     public static Box getBox(Component[] c, boolean horiz, 
   7:             int margin, int spacing)
   8:         ...
   9:     
  10:     public static Box getBox(Component[] c, boolean horiz,
  11:             int margin1, int margin2, int spacing)
  12:         ...
  13:     public static void setFont(Component c, Font font) {
  14:         c.setFont(font);

View Full Code Here
   1: }
   2:     public static void recursivelySetFonts(Component comp, Font font) {
   3:         ...
   4:         comp.setFont(font);
   5:         if (comp instanceof Container) {
   6:             Container cont = (Container) comp;
   7:             for(int j=0, ub=cont.getComponentCount(); j<ub; ++j)

View Full Code Here
   1: import jp.ujihara.java.awt.Color;
   2: import jp.ujihara.java.awt.Component;
   3: import jp.ujihara.java.awt.Dimension;
   4:         ...
   5: {
   6:       public Insets getBorderInsets(Component c)
   7:       {
   8:         ...
   9: 
  10:       public void paintBorder(Component c, Graphics g, int x, int y, int w,
  11:                               int h)
  12:         ...
  13:     c.setForeground(defaults.getColor("ToolTip.foreground"));
  14:     c.setFont(defaults.getFont("ToolTip.font"));

View Full Code Here
   1: 
   2:   public Component getBaseRendererComponent(char base,
   3:       SequenceI seq,
   4:         ...
   5:       int tier) {
   6:     Component comp
   7:     = super.getBaseRendererComponent(base, seq, pos, offset, tier);
   8:         ...
   9:     if (usedToCompare)
  10:       comp.setFont(boldFont);
  11:     else
  12:         ...
  13:       comp.setFont(plainFont);

View Full Code Here
   1: import java.io.*;
   2: import java.awt.Component;
   3: import java.awt.Container;
   4:         ...
   5:         }
   6:         public void recursivelySetFonts(Component comp, Font font) {
   7:         ...
   8:             comp.setFont(font);
   9:             if (comp instanceof Container) {

View Full Code Here