當前位置: 首頁>>代碼示例>>Java>>正文


Java LookAndFeel.installColorsAndFont方法代碼示例

本文整理匯總了Java中javax.swing.LookAndFeel.installColorsAndFont方法的典型用法代碼示例。如果您正苦於以下問題:Java LookAndFeel.installColorsAndFont方法的具體用法?Java LookAndFeel.installColorsAndFont怎麽用?Java LookAndFeel.installColorsAndFont使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.LookAndFeel的用法示例。


在下文中一共展示了LookAndFeel.installColorsAndFont方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: installDefaults

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
protected void installDefaults(JScrollPane p)
{
  scrollpane = p;
  LookAndFeel.installColorsAndFont(p, "ScrollPane.background",
                                   "ScrollPane.foreground",
                                   "ScrollPane.font");
  LookAndFeel.installBorder(p, "ScrollPane.border");

  // Install Viewport border.
  Border vpBorder = p.getViewportBorder();
  if (vpBorder == null || vpBorder instanceof UIResource)
    {
      vpBorder = UIManager.getBorder("ScrollPane.viewportBorder");
      p.setViewportBorder(vpBorder);
    }

  p.setOpaque(true);
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:19,代碼來源:BasicScrollPaneUI.java

示例2: updateUI

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
/**
 * Overridden to message super and forward the method to the tree. Since
 * the tree is not actually in the component hierarchy it will never receive
 * this unless we forward it in this manner.
 */
//----------//
// updateUI //
//----------//
@Override
public void updateUI ()
{
    super.updateUI();

    if (tree != null) {
        tree.updateUI();
    }

    // Use the tree's default foreground and background colors in the
    // table.
    LookAndFeel.installColorsAndFont(this, "Tree.background", "Tree.foreground", "Tree.font");
}
 
開發者ID:Audiveris,項目名稱:audiveris,代碼行數:22,代碼來源:JTreeTable.java

示例3: installDefaults

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
/**
 * This method installs defaults for the JOptionPane.
 */
protected void installDefaults()
{
  LookAndFeel.installColorsAndFont(optionPane, "OptionPane.background",
                                   "OptionPane.foreground",
                                   "OptionPane.font");
  LookAndFeel.installBorder(optionPane, "OptionPane.border");
  optionPane.setOpaque(true);

  minimumSize = UIManager.getDimension("OptionPane.minimumSize");

  // FIXME: Image icons don't seem to work properly right now.
  // Once they do, replace the synthetic icons with these ones.

  /*
  warningIcon = (IconUIResource) defaults.getIcon("OptionPane.warningIcon");
  infoIcon = (IconUIResource) defaults.getIcon("OptionPane.informationIcon");
  errorIcon = (IconUIResource) defaults.getIcon("OptionPane.errorIcon");
  questionIcon = (IconUIResource) defaults.getIcon("OptionPane.questionIcon");
  */
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:24,代碼來源:BasicOptionPaneUI.java

示例4: updateUI

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
/**
   * Overridden to message super and forward the method to the tree. Since the
   * tree is not actually in the component hieachy it will never receive this
   * unless we forward it in this manner.
   */
  public void updateUI() {
super.updateUI();
	if (tree != null) { 
	tree.updateUI();
	}


      // Use the tree's default foreground and background colors in the
      // table.
      LookAndFeel.installColorsAndFont(this, "Tree.background",
              "Tree.foreground", "Tree.font");
  }
 
開發者ID:ser316asu,項目名稱:Neukoelln_SER316,代碼行數:18,代碼來源:TaskTable.java

示例5: updateUI

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
@Override
public void updateUI()
{
	super.updateUI();
	setLineWrap(true);
	setWrapStyleWord(true);
	setHighlighter(null);
	setEditable(false);
	setFocusable(false);
	LookAndFeel.installBorder(this, LABEL_BORDER);
	LookAndFeel.installColorsAndFont(this, LABEL_BACKGROUND, LABEL_FOREGROUND, LABEL_FONT);
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:13,代碼來源:MultiLineLabel.java

示例6: installDefaults

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
/**
 * Installs the default settings.
 *
 * @param b  the button (<code>null</code> not permitted).
 */
protected void installDefaults(AbstractButton b)
{
  String prefix = getPropertyPrefix();
  // Install colors and font.
  LookAndFeel.installColorsAndFont(b, prefix + "background",
                                   prefix + "foreground", prefix + "font");
  // Install border.
  LookAndFeel.installBorder(b, prefix + "border");

  // Install margin property.
  if (b.getMargin() == null || b.getMargin() instanceof UIResource)
    b.setMargin(UIManager.getInsets(prefix + "margin"));

  // Install rollover property.
  Object rollover = UIManager.get(prefix + "rollover");
  if (rollover != null)
    LookAndFeel.installProperty(b, "rolloverEnabled", rollover);

  // Fetch default textShiftOffset.
  defaultTextShiftOffset = UIManager.getInt(prefix + "textShiftOffset");

  // Make button opaque if needed.
  if (b.isContentAreaFilled())
    LookAndFeel.installProperty(b, "opaque", Boolean.TRUE);
  else
    LookAndFeel.installProperty(b, "opaque", Boolean.FALSE);
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:33,代碼來源:BasicButtonUI.java

示例7: installDefaults

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
protected void installDefaults() {
  LookAndFeel.installColorsAndFont(tipPane, "TipOfTheDay.background",
    "TipOfTheDay.foreground", "TipOfTheDay.font");
  LookAndFeel.installBorder(tipPane, "TipOfTheDay.border");
  tipFont = UIManager.getFont("TipOfTheDay.tipFont");
  tipPane.setOpaque(true);
}
 
開發者ID:mstritt,項目名稱:orbit-image-analysis,代碼行數:8,代碼來源:BasicTipOfTheDayUI.java

示例8: installDefaults

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
/**
 * This method installs the defaults that are defined in  the Basic look
 * and feel for this {@link JPopupMenu}.
 */
public void installDefaults()
{
  LookAndFeel.installColorsAndFont(popupMenu, "PopupMenu.background",
                                   "PopupMenu.foreground", "PopupMenu.font");
  LookAndFeel.installBorder(popupMenu, "PopupMenu.border");
  popupMenu.setOpaque(true);
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:12,代碼來源:BasicPopupMenuUI.java

示例9: installDefaults

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
/**
 * Installs the defaults for this UI delegate in the specified panel.
 *
 * @param p  the panel (<code>null</code> not permitted).
 */
protected void installDefaults(JPanel p)
{
  LookAndFeel.installColorsAndFont(p, "Panel.background", "Panel.foreground",
                                   "Panel.font");

  // A test against the reference implementation shows that this method will
  // install a border if one is defined in the UIDefaults table (even though
  // the BasicLookAndFeel doesn't actually define a "Panel.border").  This
  // test was written after discovering that a null argument to
  // uninstallDefaults throws a NullPointerException in
  // LookAndFeel.uninstallBorder()...
  LookAndFeel.installBorder(p, "Panel.border");
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:19,代碼來源:BasicPanelUI.java

示例10: installDefaults

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
protected void installDefaults()
{
  LookAndFeel.installColorsAndFont(table, "Table.background",
                                   "Table.foreground", "Table.font");
  table.setGridColor(UIManager.getColor("Table.gridColor"));
  table.setSelectionForeground(UIManager.getColor("Table.selectionForeground"));
  table.setSelectionBackground(UIManager.getColor("Table.selectionBackground"));
  table.setOpaque(true);
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:10,代碼來源:BasicTableUI.java

示例11: installDefaults

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
/**
 * This method installs defaults for the Look and Feel.
 */
protected void installDefaults()
{
  LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background",
                                   "TabbedPane.foreground",
                                   "TabbedPane.font");
  tabPane.setOpaque(false);

  lightHighlight = UIManager.getColor("TabbedPane.highlight");
  highlight = UIManager.getColor("TabbedPane.light");

  shadow = UIManager.getColor("TabbedPane.shadow");
  darkShadow = UIManager.getColor("TabbedPane.darkShadow");

  focus = UIManager.getColor("TabbedPane.focus");

  textIconGap = UIManager.getInt("TabbedPane.textIconGap");
  tabRunOverlay = UIManager.getInt("TabbedPane.tabRunOverlay");

  tabInsets = UIManager.getInsets("TabbedPane.tabInsets");
  selectedTabPadInsets
    = UIManager.getInsets("TabbedPane.selectedTabPadInsets");
  tabAreaInsets = UIManager.getInsets("TabbedPane.tabAreaInsets");
  contentBorderInsets
    = UIManager.getInsets("TabbedPane.contentBorderInsets");
  tabsOpaque = UIManager.getBoolean("TabbedPane.tabsOpaque");

  // Although 'TabbedPane.contentAreaColor' is not defined in the defaults
  // of BasicLookAndFeel it is used by this class.
  selectedColor = UIManager.getColor("TabbedPane.contentAreaColor");
  if (selectedColor == null)
    selectedColor = UIManager.getColor("control");

  calcRect = new Rectangle();
  tabRuns = new int[10];
  tabAreaRect = new Rectangle();
  contentRect = new Rectangle();
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:41,代碼來源:BasicTabbedPaneUI.java

示例12: installDefaults

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
/**
 * Installs various default settings (mostly colors) from the {@link
 * UIDefaults} into the {@link JList}
 *
 * @see #uninstallDefaults
 */
protected void installDefaults()
{
  LookAndFeel.installColorsAndFont(list, "List.background",
                                   "List.foreground", "List.font");
  list.setSelectionForeground(UIManager.getColor("List.selectionForeground"));
  list.setSelectionBackground(UIManager.getColor("List.selectionBackground"));
  list.setOpaque(true);
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:15,代碼來源:BasicListUI.java

示例13: updateUI

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
/**
 * Overridden to message super and forward the method to the tree. Since the
 * tree is not actually in the component hieachy it will never receive this
 * unless we forward it in this manner.
 */
@Override
public void updateUI() {
	super.updateUI();
	if (tree != null) {
		tree.updateUI();
	}
	// Use the tree's default foreground and background colors in the
	// table.
	LookAndFeel.installColorsAndFont(this, "Tree.background", "Tree.foreground", "Tree.font");
}
 
開發者ID:cst316,項目名稱:spring16project-Fortran,代碼行數:16,代碼來源:JTreeTable.java

示例14: updateUI

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
/**
 * Overridden to message super and forward the method to the tree. Since the
 * tree is not actually in the component hieachy it will never receive this
 * unless we forward it in this manner.
 */
@Override
public void updateUI() {
	super.updateUI();
	if (tree != null) {
		tree.updateUI();
	}

	// Use the tree's default foreground and background colors in the
	// table.
	LookAndFeel.installColorsAndFont(this, "Tree.background", "Tree.foreground", "Tree.font");
}
 
開發者ID:cst316,項目名稱:spring16project-Fortran,代碼行數:17,代碼來源:TaskTable.java

示例15: installDefaults

import javax.swing.LookAndFeel; //導入方法依賴的package包/類
/**
 * This method changes the settings for the progressBar to
 * the defaults provided by the current Look and Feel.
 */
protected void installDefaults()
{
  LookAndFeel.installColorsAndFont(progressBar, "ProgressBar.background",
                                   "ProgressBar.foreground",
                                   "ProgressBar.font");
  LookAndFeel.installBorder(progressBar, "ProgressBar.border");
  progressBar.setOpaque(true);

  selectionForeground = UIManager.getColor("ProgressBar.selectionForeground");
  selectionBackground = UIManager.getColor("ProgressBar.selectionBackground");
  cellLength = UIManager.getInt("ProgressBar.cellLength");
  cellSpacing = UIManager.getInt("ProgressBar.cellSpacing");

  int repaintInterval = UIManager.getInt("ProgressBar.repaintInterval");
  int cycleTime = UIManager.getInt("ProgressBar.cycleTime");

  if (cycleTime % repaintInterval != 0
      && (cycleTime / repaintInterval) % 2 != 0)
    {
      int div = (cycleTime / repaintInterval) + 2;
      div /= 2;
      div *= 2;
      cycleTime = div * repaintInterval;
    }
  setAnimationIndex(0);
  numFrames = cycleTime / repaintInterval;
  animationTimer.setDelay(repaintInterval);
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:33,代碼來源:BasicProgressBarUI.java


注:本文中的javax.swing.LookAndFeel.installColorsAndFont方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。