• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java JFontChooser类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: run

import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
public void run() {
  Component actualParent;
  if (parent != null) actualParent = parent;
  else actualParent = BOGUS_PARENT;
  //System.out.println(actualParent);
  Font font = JFontChooser.showDialog(actualParent, "Choose new font", label.getFont());

  if (font == null) return;

  label.setFont(font);
  label.setText(font.getName() + " " + font.getSize());
  label.repaint();
  // store pref
  App.prefs.setPref(pref, UIDefaultsComponent.stringifyFont(font));
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:16,代码来源:FontPrefComponent.java


示例17: 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, this.chartSet.getLabelFont());
    if (font != null)
        this.chartSet.setLabelFont(font);
}
 
开发者ID:meteoinfo,项目名称:MeteoInfoLib,代码行数:7,代码来源:FrmChartLabel.java


示例18: jButton_LegendFontActionPerformed

import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
private void jButton_LegendFontActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_LegendFontActionPerformed
    // TODO add your handling code here:
    Font lFont = JFontChooser.showDialog(this, null, _legendFont);
    _legendFont = lFont;
    this.jLabel_LegendFont.setText(_legendFont.getFontName() + " " + _legendFont.getSize());
}
 
开发者ID:meteoinfo,项目名称:MeteoInfoMap,代码行数:7,代码来源:FrmOptions.java


示例19: jButton_TextFontActionPerformed

import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
private void jButton_TextFontActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_TextFontActionPerformed
    // TODO add your handling code here:
    Font tFont = JFontChooser.showDialog(this, null, _textFont);
    _textFont = tFont;
    this.jLabel_TextFont.setText(_textFont.getFontName() + " " + _textFont.getSize());
}
 
开发者ID:meteoinfo,项目名称:MeteoInfoMap,代码行数:7,代码来源:FrmOptions.java


示例20: run

import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
public void run() {
    Font f = JFontChooser.showDialog(new javax.swing.JFrame(), text, currentFont);
  if (f != null) currentFont = f;
  text = null;
  fireEditingStopped();
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:7,代码来源:FontEditor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Factory类代码示例发布时间:2022-05-22
下一篇:
Java OperationResourceInfo类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap