本文整理汇总了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;
}
}
示例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);
}
示例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);
}
示例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() + "'");
}
}
示例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);
}
}
示例6: installUI
import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
public void installUI(JComponent c) {
super.installUI(c);
chooser = (JFontChooser)c;
installComponents();
installListeners();
}
示例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);
}
示例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);
}
示例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);
}
}
示例10: installUI
import com.l2fprod.common.swing.JFontChooser; //导入依赖的package包/类
public void installUI(JComponent c) {
super.installUI(c);
chooser = (JFontChooser) c;
installComponents();
installListeners();
}
示例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);
}
示例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);
}
示例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);
}
}
示例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();
}
}
示例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);
}
}