import java.awt.Font;
/*
 * boyana.java
 *
 * Created on January 15, 2007, 9:06 AM
 */

/**
 *
 * @author  student
 */
public class boyana extends javax.swing.JFrame {
    
    /** Creates new form boyana */
    public boyana() {
        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();
        buttonGroup2 = new javax.swing.ButtonGroup();
        text = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        combo = new javax.swing.JComboBox();
        Button1 = new javax.swing.JRadioButton();
        Button2 = new javax.swing.JRadioButton();
        Button3 = new javax.swing.JRadioButton();
        Button4 = new javax.swing.JRadioButton();
        Button5 = new javax.swing.JRadioButton();
        Button6 = new javax.swing.JRadioButton();
        Button7 = new javax.swing.JRadioButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Boyana 0566013");
        text.setText("tekstovo pole");

        jButton1.setText("pravi si ne6to");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        combo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        Button1.setText("Green");
        Button1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        Button1.setMargin(new java.awt.Insets(0, 0, 0, 0));

        Button2.setText("Red");
        Button2.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        Button2.setMargin(new java.awt.Insets(0, 0, 0, 0));

        Button3.setText("Blue");
        Button3.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        Button3.setMargin(new java.awt.Insets(0, 0, 0, 0));

        buttonGroup1.add(Button4);
        Button4.setText("Add");
        Button4.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        Button4.setMargin(new java.awt.Insets(0, 0, 0, 0));
        Button4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Button4ActionPerformed(evt);
            }
        });

        buttonGroup1.add(Button5);
        Button5.setText("Remove");
        Button5.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        Button5.setMargin(new java.awt.Insets(0, 0, 0, 0));

        buttonGroup2.add(Button6);
        Button6.setText("Comic Sans MS");
        Button6.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        Button6.setMargin(new java.awt.Insets(0, 0, 0, 0));
        Button6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Button6ActionPerformed(evt);
            }
        });

        buttonGroup2.add(Button7);
        Button7.setText("Verdana");
        Button7.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        Button7.setMargin(new java.awt.Insets(0, 0, 0, 0));
        Button7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Button7ActionPerformed(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(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup()
                        .add(40, 40, 40)
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(layout.createSequentialGroup()
                                .add(text, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 84, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(76, 76, 76)
                                .add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 122, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(layout.createSequentialGroup()
                                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(combo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 105, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(Button4)
                                    .add(Button5))
                                .add(76, 76, 76)
                                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(Button1)
                                    .add(Button2)
                                    .add(Button3))))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 9, Short.MAX_VALUE))
                    .add(layout.createSequentialGroup()
                        .add(158, 158, 158)
                        .add(Button6)
                        .add(27, 27, 27)
                        .add(Button7)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(32, 32, 32)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(text, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 36, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jButton1))
                .add(43, 43, 43)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(combo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(Button1))
                .add(18, 18, 18)
                .add(Button2)
                .add(8, 8, 8)
                .add(Button4)
                .add(5, 5, 5)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(Button3)
                    .add(Button5))
                .add(46, 46, 46)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(Button6)
                    .add(Button7))
                .addContainerGap(30, Short.MAX_VALUE))
        );
        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
if(Button4.isSelected())
combo.addItem(text.getText());
else 
if(Button5.isSelected())
 combo.removeItemAt(combo.getSelectedIndex());
    }//GEN-LAST:event_jButton1ActionPerformed

    private void Button7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Button7ActionPerformed
text.setFont(new Font("Verdana",Font.BOLD,11));
    }//GEN-LAST:event_Button7ActionPerformed

    private void Button6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Button6ActionPerformed
    text.setFont(new Font("Comic Sans MS",Font.BOLD,11));
    }//GEN-LAST:event_Button6ActionPerformed

    private void Button4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Button4ActionPerformed

    }//GEN-LAST:event_Button4ActionPerformed
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new boyana().setVisible(true);
            }
        });
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JRadioButton Button1;
    private javax.swing.JRadioButton Button2;
    private javax.swing.JRadioButton Button3;
    private javax.swing.JRadioButton Button4;
    private javax.swing.JRadioButton Button5;
    private javax.swing.JRadioButton Button6;
    private javax.swing.JRadioButton Button7;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.JComboBox combo;
    private javax.swing.JButton jButton1;
    private javax.swing.JTextField text;
    // End of variables declaration//GEN-END:variables
    
}
