当前位置: 首页>>代码示例>>Java>>正文


Java JFontChooser类代码示例

本文整理汇总了Java中com.l2fprod.common.swing.JFontChooser的典型用法代码示例。如果您正苦于以下问题:Java JFontChooser类的具体用法?Java JFontChooser怎么用?Java JFontChooser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


JFontChooser类属于com.l2fprod.common.swing包,在下文中一共展示了JFontChooser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: selectFont

import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
/**
 * Let the user select a font and save it into the {@link SettingsModel}.
 * 
 * @param target
 *            the target setting for the newly selected font
 * @return {@code true} if the font was changed, {@code false} else
 */
private boolean selectFont(SettingKey target) {
	JFontChooser fontChooser = new JFontChooser();
	fontChooser.setSelectedFont(new Font("Dialog", Font.BOLD | Font.ITALIC, 56));
	Font font = settingsModel.get(target, Font.class);
	if (font != null) {
		fontChooser.setSelectedFont(font);
	}
	Font selectedFont = fontChooser.showFontDialog(this, "Choose Font");
	if (selectedFont != null) {
		settingsModel.put(target, selectedFont);
		return true;
	} else {
		return false;
	}
}
 
开发者ID:mathisdt,项目名称:sdb2,代码行数:23,代码来源:MainWindow.java

示例2: GeoInspectorPanel

import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
/** Creates new form GeoInspectorPanel */
public GeoInspectorPanel() {
    initComponents();
    
    JPanel emptyPanel = new JPanel();
    this.add(emptyPanel, NONE);
    
    this.vectorSymbolPanel = new VectorSymbolPanel();
    this.add(vectorSymbolPanel, VECTOR);
    
    this.fontChooser = new JFontChooser();
    PropertyChangeListener l = new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            if (singleSelectedGeoText == null)
                return;
            Font newFont = fontChooser.getSelectedFont();
            if (newFont == null)
                return;
            singleSelectedGeoText.getFontSymbol().setFont(newFont);
        }
    };
    this.fontChooser.addPropertyChangeListener(l);
    
    this.add(fontChooser, FONT);
    
}
 
开发者ID:OSUCartography,项目名称:TerrainViewer,代码行数:27,代码来源:GeoInspectorPanel.java

示例3: ChooseFont

import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
public ChooseFont() {
  setLayout(new PercentLayout(PercentLayout.VERTICAL, 3));

  JFontChooser chooser = new JFontChooser();
  chooser.setSelectedFont(new Font("Dialog", Font.BOLD | Font.ITALIC, 56));
  add("*", chooser);

  JButton button = new JButton("Click here to show JFontChooser");
  button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      selectFont(ChooseFont.this);
    }
  });
  add(button);
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:16,代码来源:ChooseFont.java

示例4: selectFont

import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
private static void selectFont(Component parent) {
  Font selectedFont = JFontChooser.showDialog(parent, "Choose Font", null);
  if (selectedFont == null) {
    JOptionPane.showMessageDialog(parent, "You clicked 'Cancel'");
  } else {
    JOptionPane.showMessageDialog(parent, "You selected '"
      + selectedFont.getName() + "'");
  }
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:10,代码来源:ChooseFont.java

示例5: selectFont

import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
protected void selectFont() {
  ResourceManager rm = ResourceManager.all(FontPropertyEditor.class);
  String title = rm.getString("FontPropertyEditor.title");
  
  Font selectedFont = JFontChooser.showDialog(editor, title, font);

  if (selectedFont != null) {
    Font oldFont = font;
    Font newFont = selectedFont;
    label.setValue(newFont);
    font = newFont;
    firePropertyChange(oldFont, newFont);
  }
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:15,代码来源:FontPropertyEditor.java

示例6: installUI

import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
public void installUI(JComponent c) {
  super.installUI(c);

  chooser = (JFontChooser)c;

  installComponents();
  installListeners();
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:9,代码来源:WindowsFontChooserUI.java

示例7: installListeners

import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
protected void installListeners() {
  SelectedFontUpdater listener = new SelectedFontUpdater();
  fontList.addListSelectionListener(listener);
  fontEffectList.addListSelectionListener(listener);
  fontSizeList.addListSelectionListener(listener);
  fontSizeField.getDocument().addDocumentListener(listener);

  propertyListener = createPropertyChangeListener();
  chooser.addPropertyChangeListener(JFontChooser.SELECTED_FONT_CHANGED_KEY,
      propertyListener);
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:12,代码来源:WindowsFontChooserUI.java

示例8: installListeners

import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
protected void installListeners() {
  SelectedFontUpdater listener = new SelectedFontUpdater();
  fontList.addListSelectionListener(listener);
  fontSizeList.addListSelectionListener(listener);
  fontSizeField.getDocument().addDocumentListener(listener);
  boldCheck.addActionListener(listener);
  italicCheck.addActionListener(listener);

  propertyListener = createPropertyChangeListener();
  chooser.addPropertyChangeListener(
    JFontChooser.SELECTED_FONT_CHANGED_KEY,
    propertyListener);
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:14,代码来源:BasicFontChooserUI.java

示例9: selectFont

import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
protected void selectFont() {
  ResourceManager rm = ResourceManager.all(FontPropertyEditor.class);
  String title = rm.getString("FontPropertyEditor.title");

  Font selectedFont = JFontChooser.showDialog(editor, title, font);

  if (selectedFont != null) {
    Font oldFont = font;
    Font newFont = selectedFont;
    label.setValue(newFont);
    font = newFont;
    firePropertyChange(oldFont, newFont);
  }
}
 
开发者ID:calibre2opds,项目名称:calibre2opds,代码行数:15,代码来源:FontPropertyEditor.java

示例10: installUI

import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
public void installUI(JComponent c) {
  super.installUI(c);

  chooser = (JFontChooser) c;

  installComponents();
  installListeners();
}
 
开发者ID:calibre2opds,项目名称:calibre2opds,代码行数:9,代码来源:WindowsFontChooserUI.java

示例11: installListeners

import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
protected void installListeners() {
  SelectedFontUpdater listener = new SelectedFontUpdater();
  fontList.addListSelectionListener(listener);
  fontEffectList.addListSelectionListener(listener);
  fontSizeList.addListSelectionListener(listener);
  fontSizeField.getDocument().addDocumentListener(listener);

  propertyListener = createPropertyChangeListener();
  chooser.addPropertyChangeListener(JFontChooser.SELECTED_FONT_CHANGED_KEY, propertyListener);
}
 
开发者ID:calibre2opds,项目名称:calibre2opds,代码行数:11,代码来源:WindowsFontChooserUI.java

示例12: installListeners

import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
protected void installListeners() {
  SelectedFontUpdater listener = new SelectedFontUpdater();
  fontList.addListSelectionListener(listener);
  fontSizeList.addListSelectionListener(listener);
  fontSizeField.getDocument().addDocumentListener(listener);
  boldCheck.addActionListener(listener);
  italicCheck.addActionListener(listener);

  propertyListener = createPropertyChangeListener();
  chooser.addPropertyChangeListener(JFontChooser.SELECTED_FONT_CHANGED_KEY, propertyListener);
}
 
开发者ID:calibre2opds,项目名称:calibre2opds,代码行数:12,代码来源:BasicFontChooserUI.java

示例13: jButton_FontActionPerformed

import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
private void jButton_FontActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_FontActionPerformed
    // TODO add your handling code here:
    //FontChooser fontChooser = new FontChooser(this, true, _labelBreak.getFont());
    //fontChooser.setVisible(true);
    Font aFont = JFontChooser.showDialog(this, null, _labelBreak.getFont());
    if (aFont != null) {
        this.jTextArea_Text.setFont(aFont);
        _labelBreak.setFont(aFont);
    }
}
 
开发者ID:meteoinfo,项目名称:MeteoInfoLib,代码行数:11,代码来源:FrmLabelSymbolSet.java

示例14: jButton_FontActionPerformed

import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
private void jButton_FontActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_FontActionPerformed
    // TODO add your handling code here:
    Font font = JFontChooser.showDialog(this, null, _font);
    if (font != null) {
        _font = font;
        updateLabelSet();
        updateLabelsFontColor();
        _mapView.paintLayers();
    }
}
 
开发者ID:meteoinfo,项目名称:MeteoInfoLib,代码行数:11,代码来源:FrmLabelSet.java

示例15: jMenuItem_SetFontActionPerformed

import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
private void jMenuItem_SetFontActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem_SetFontActionPerformed
    // TODO add your handling code here:
    TextEditor textEditor = getActiveTextEditor();
    Font tFont = JFontChooser.showDialog(this, null, textEditor.getTextArea().getFont());
    if (tFont != null) {
        this.setTextFont(tFont);
        ((FrmMain) _parent).getOptions().setTextFont(tFont);
    }
}
 
开发者ID:meteoinfo,项目名称:MeteoInfoMap,代码行数:10,代码来源:FrmTextEditor.java


注:本文中的com.l2fprod.common.swing.JFontChooser类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。