本文整理汇总了Java中com.connectina.swing.fontchooser.JFontChooser类的典型用法代码示例。如果您正苦于以下问题:Java JFontChooser类的具体用法?Java JFontChooser怎么用?Java JFontChooser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JFontChooser类属于com.connectina.swing.fontchooser包,在下文中一共展示了JFontChooser类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: eventDispatched
import com.connectina.swing.fontchooser.JFontChooser; //导入依赖的package包/类
@Override
public void eventDispatched(AWTEvent event) {
if (event instanceof ContainerEvent) {
ContainerEvent containerEvent = (ContainerEvent)event;
if (containerEvent.getID() == ContainerEvent.COMPONENT_ADDED){
Component container = containerEvent.getChild();
if ((container instanceof JButton)||
(container instanceof JCheckBox)||
(container instanceof JComboBox)||
(container instanceof JLabel)||
(container instanceof JMenu)||
(container instanceof JMenuItem)||
(container instanceof JRadioButton)||
(container instanceof JRadioButtonMenuItem)||
(container instanceof JSpinner)||
(container instanceof JTabbedPane)||
(container instanceof JTextField)||
(container instanceof JHelp)||
(container instanceof JFileChooser)||
((container instanceof JScrollPane)&&(!(container instanceof CanvasPane)))||
(container instanceof JFontChooser)||
(container instanceof JCheckBoxMenuItem)) {
AppPreferences.setScaledFonts(((JComponent)container).getComponents());
try{container.setFont(AppPreferences.getScaledFont(containerEvent.getChild().getFont()));
container.revalidate();
container.repaint();}
catch(Exception e){}
}
if (container instanceof JOptionPane) {
JOptionPane pane = (JOptionPane) container;
if (HasIcon(pane)) {
ImageIcon icon;
switch (pane.getMessageType()) {
case JOptionPane.ERROR_MESSAGE :
icon = new ImageIcon(getClass().getClassLoader().getResource("resources/logisim/error.png"));
pane.setIcon(AppPreferences.getScaledImageIcon(icon,(float) 3));
break;
case JOptionPane.QUESTION_MESSAGE :
icon = new ImageIcon(getClass().getClassLoader().getResource("resources/logisim/question.png"));
pane.setIcon(AppPreferences.getScaledImageIcon(icon,(float) 3));
break;
case JOptionPane.PLAIN_MESSAGE :
icon = new ImageIcon(getClass().getClassLoader().getResource("resources/logisim/plain.png"));
pane.setIcon(AppPreferences.getScaledImageIcon(icon,(float) 3));
break;
case JOptionPane.INFORMATION_MESSAGE :
icon = new ImageIcon(getClass().getClassLoader().getResource("resources/logisim/info.png"));
pane.setIcon(AppPreferences.getScaledImageIcon(icon,(float) 3));
break;
case JOptionPane.WARNING_MESSAGE :
icon = new ImageIcon(getClass().getClassLoader().getResource("resources/logisim/warning.png"));
pane.setIcon(AppPreferences.getScaledImageIcon(icon,(float) 3));
break;
}
}
}
}
}
// TODO Auto-generated method stub
}