import java.awt.Font;
/*
 * jani_4.java
 *
 * Created on January 8, 2008, 10:38 AM
 */

/**
 *
 * @author  student
 */
public class jani_4 extends javax.swing.JFrame {
    
    /** Creates new form jani_4 */
    public jani_4() {
        initComponents();
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        buttonGroup1 = new javax.swing.ButtonGroup();
        jTextField1 = new javax.swing.JTextField();
        Arial = new javax.swing.JRadioButton();
        jRadioButton2 = new javax.swing.JRadioButton();
        ComicSansMS = new javax.swing.JRadioButton();
        MIcrosoft = new javax.swing.JRadioButton();
        SansSerif = new javax.swing.JRadioButton();
        jComboBox1 = new javax.swing.JComboBox();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("kalina");
        setFont(new java.awt.Font("Arial", 2, 24));
        jTextField1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField1ActionPerformed(evt);
            }
        });

        buttonGroup1.add(Arial);
        Arial.setFont(new java.awt.Font("Tahoma", 1, 10));
        Arial.setText("Arial");
        Arial.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        Arial.setMargin(new java.awt.Insets(0, 0, 0, 0));
        Arial.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ArialActionPerformed(evt);
            }
        });

        buttonGroup1.add(jRadioButton2);
        jRadioButton2.setFont(new java.awt.Font("Tahoma", 2, 11));
        jRadioButton2.setText("Timas new Roman");
        jRadioButton2.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        jRadioButton2.setMargin(new java.awt.Insets(0, 0, 0, 0));
        jRadioButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButton2ActionPerformed(evt);
            }
        });

        buttonGroup1.add(ComicSansMS);
        ComicSansMS.setFont(new java.awt.Font("Tahoma", 1, 12));
        ComicSansMS.setText("Comic Sans MS");
        ComicSansMS.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        ComicSansMS.setMargin(new java.awt.Insets(0, 0, 0, 0));
        ComicSansMS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ComicSansMSActionPerformed(evt);
            }
        });

        buttonGroup1.add(MIcrosoft);
        MIcrosoft.setFont(new java.awt.Font("Tahoma", 1, 11));
        MIcrosoft.setText("Microsoft Sans Serif");
        MIcrosoft.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        MIcrosoft.setMargin(new java.awt.Insets(0, 0, 0, 0));

        buttonGroup1.add(SansSerif);
        SansSerif.setText("Sans Serif");
        SansSerif.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        SansSerif.setMargin(new java.awt.Insets(0, 0, 0, 0));

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        jButton1.setText("Add");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("Remuve");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(35, 35, 35)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(SansSerif)
                    .add(MIcrosoft)
                    .add(jRadioButton2)
                    .add(Arial)
                    .add(ComicSansMS)
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                        .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
                            .add(jComboBox1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(47, 47, 47)
                            .add(jButton1)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(jButton2))
                        .add(org.jdesktop.layout.GroupLayout.LEADING, jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 302, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(63, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(21, 21, 21)
                .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(27, 27, 27)
                .add(Arial)
                .add(17, 17, 17)
                .add(jRadioButton2)
                .add(24, 24, 24)
                .add(ComicSansMS)
                .add(26, 26, 26)
                .add(MIcrosoft)
                .add(20, 20, 20)
                .add(SansSerif)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jComboBox1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jButton1)
                    .add(jButton2))
                .addContainerGap(43, Short.MAX_VALUE))
        );
        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
   jComboBox1.removeItemAt(jComboBox1.getSelectedIndex());
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    jComboBox1.addItem(jTextField1.getText());
     jTextField1.setText("");
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
// TODO add your handling code here:
    }//GEN-LAST:event_jTextField1ActionPerformed

    private void ComicSansMSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ComicSansMSActionPerformed
         if(ComicSansMS.isSelected())
             jTextField1.setFont(new Font("Comic Sans MS", Font.PLAIN, 18));
    }//GEN-LAST:event_ComicSansMSActionPerformed

    private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton2ActionPerformed
    if(jRadioButton2.isSelected())
        jTextField1.setFont(new Font("Times New Roman", Font.PLAIN, 18));
    }//GEN-LAST:event_jRadioButton2ActionPerformed

    private void ArialActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ArialActionPerformed
          if(Arial.isSelected())
              jTextField1.setFont(new Font(Arial.getText(), Font.BOLD, 18));
          
    }//GEN-LAST:event_ArialActionPerformed
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new jani_4().setVisible(true);
            }
        });
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JRadioButton Arial;
    private javax.swing.JRadioButton ComicSansMS;
    private javax.swing.JRadioButton MIcrosoft;
    private javax.swing.JRadioButton SansSerif;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JRadioButton jRadioButton2;
    private javax.swing.JTextField jTextField1;
    // End of variables declaration//GEN-END:variables
    
}
