5 import java.awt.event.*;
8 public class GFontChooser extends JPanel
10 JLabel jLabel1 = new JLabel();
11 protected JComboBox fontSize = new JComboBox();
12 protected JComboBox fontStyle = new JComboBox();
13 JLabel jLabel2 = new JLabel();
14 JLabel jLabel3 = new JLabel();
15 protected JComboBox fontName = new JComboBox();
16 JButton ok = new JButton();
17 JButton cancel = new JButton();
18 JPanel jPanel1 = new JPanel();
19 JPanel jPanel2 = new JPanel();
20 JPanel jPanel3 = new JPanel();
21 BorderLayout borderLayout1 = new BorderLayout();
22 BorderLayout borderLayout2 = new BorderLayout();
23 BorderLayout borderLayout3 = new BorderLayout();
24 FlowLayout flowLayout1 = new FlowLayout();
37 private void jbInit() throws Exception
39 jLabel1.setFont(new java.awt.Font("Verdana", 0, 11));
40 jLabel1.setHorizontalAlignment(SwingConstants.RIGHT);
41 jLabel1.setText("Font: ");
42 jLabel1.setVerticalTextPosition(javax.swing.SwingConstants.CENTER);
43 this.setLayout(flowLayout1);
44 fontSize.setFont(new java.awt.Font("Verdana", 0, 11));
45 fontSize.setOpaque(false);
46 fontSize.setPreferredSize(new Dimension(50, 21));
47 fontSize.addActionListener(new java.awt.event.ActionListener()
49 public void actionPerformed(ActionEvent e)
51 fontSize_actionPerformed(e);
54 fontStyle.setFont(new java.awt.Font("Verdana", 0, 11));
55 fontStyle.setOpaque(false);
56 fontStyle.setPreferredSize(new Dimension(90, 21));
57 fontStyle.addActionListener(new java.awt.event.ActionListener()
59 public void actionPerformed(ActionEvent e)
61 fontStyle_actionPerformed(e);
64 jLabel2.setFont(new java.awt.Font("Verdana", 0, 11));
65 jLabel2.setHorizontalAlignment(SwingConstants.RIGHT);
66 jLabel2.setText("Size: ");
67 jLabel2.setVerticalTextPosition(javax.swing.SwingConstants.CENTER);
68 jLabel3.setFont(new java.awt.Font("Verdana", 0, 11));
69 jLabel3.setHorizontalAlignment(SwingConstants.RIGHT);
70 jLabel3.setText("Style: ");
71 jLabel3.setVerticalTextPosition(javax.swing.SwingConstants.CENTER);
72 fontName.setFont(new java.awt.Font("Verdana", 0, 11));
73 fontName.setMaximumSize(new Dimension(32767, 32767));
74 fontName.setMinimumSize(new Dimension(300, 21));
75 fontName.setOpaque(false);
76 fontName.setPreferredSize(new Dimension(180, 21));
77 fontName.addActionListener(new java.awt.event.ActionListener()
79 public void actionPerformed(ActionEvent e)
81 fontName_actionPerformed(e);
84 ok.setFont(new java.awt.Font("Verdana", 0, 11));
86 ok.addActionListener(new java.awt.event.ActionListener()
88 public void actionPerformed(ActionEvent e)
90 ok_actionPerformed(e);
93 cancel.setFont(new java.awt.Font("Verdana", 0, 11));
94 cancel.setText("Cancel");
95 cancel.addActionListener(new java.awt.event.ActionListener()
97 public void actionPerformed(ActionEvent e)
99 cancel_actionPerformed(e);
102 this.setBackground(Color.white);
103 jPanel1.setOpaque(false);
104 jPanel1.setLayout(borderLayout1);
105 jPanel2.setOpaque(false);
106 jPanel2.setLayout(borderLayout3);
107 jPanel3.setOpaque(false);
108 jPanel3.setLayout(borderLayout2);
109 flowLayout1.setAlignment(FlowLayout.CENTER);
110 flowLayout1.setVgap(5);
111 this.add(jPanel1, null);
112 jPanel1.add(jLabel1, BorderLayout.WEST);
113 jPanel1.add(fontName, BorderLayout.CENTER);
114 this.add(jPanel3, null);
115 this.add(jPanel2, null);
116 jPanel2.add(jLabel3, BorderLayout.WEST);
117 jPanel2.add(fontStyle, BorderLayout.CENTER);
118 jPanel3.add(jLabel2, BorderLayout.WEST);
119 jPanel3.add(fontSize, BorderLayout.CENTER);
121 this.add(cancel, null);
124 protected void ok_actionPerformed(ActionEvent e)
129 protected void cancel_actionPerformed(ActionEvent e)
134 protected void fontName_actionPerformed(ActionEvent e)
139 protected void fontSize_actionPerformed(ActionEvent e)
144 protected void fontStyle_actionPerformed(ActionEvent e)