plz ,, I Need help here : Exception in thread "main" java.lang.NullPointerException
hi ,,
I created a form by using JFormDesigner,,
and i waana add some codes in Jcretor,, but its doesn't work with me?? :(think):
please anyone can help me in that?
Code:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
/*
* Created by JFormDesigner on Thu Aug 25 22:59:29 GST 2011
*/
/**
* @author ema
*/
public class project1part6 extends JFrame {
public project1part6() {
initComponents();
}
private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
label5 = new JLabel();
label3 = new JLabel();
label4 = new JLabel();
label6 = new JLabel();
label7 = new JLabel();
button1 = new JButton();
label8 = new JLabel();
label9 = new JLabel();
radioButton1 = new JRadioButton();
//======== this ========
Container contentPane = getContentPane();
contentPane.setLayout(null);
//---- label5 ----
label5.setText("Step 6:Logo");
label5.setFont(new Font("Aharoni", Font.BOLD, 36));
contentPane.add(label5);
label5.setBounds(30, 20, 210, label5.getPreferredSize().height);
//---- label3 ----
label3.setText("A logo is a graphical element (ideogram, symbol, emblem, icon, sign). It's one aspect ");
label3.setHorizontalAlignment(SwingConstants.CENTER);
label3.setFont(new Font("Aharoni", Font.ITALIC, 14));
label3.setForeground(new Color(0, 204, 102));
contentPane.add(label3);
label3.setBounds(100, 68, 569, label3.getPreferredSize().height);
//---- label4 ----
label4.setText("of a company's commercial brand, or economic or academic entity, and its shapes, colors, fonts, ");
label4.setHorizontalAlignment(SwingConstants.CENTER);
label4.setFont(new Font("Aharoni", Font.ITALIC, 14));
label4.setForeground(new Color(0, 204, 102));
contentPane.add(label4);
label4.setBounds(45, 86, 655, label4.getPreferredSize().height);
//---- label6 ----
label6.setText(" and images usually are different from others in a similar market.");
label6.setHorizontalAlignment(SwingConstants.CENTER);
label6.setFont(new Font("Aharoni", Font.ITALIC, 14));
label6.setForeground(new Color(0, 204, 102));
contentPane.add(label6);
label6.setBounds(150, 103, 459, label6.getPreferredSize().height);
//---- label7 ----
label7.setText("It\u2019s important to realize, when your are choosing a logo design, that your logo is more than just the ");
label7.setHorizontalAlignment(SwingConstants.CENTER);
label7.setFont(new Font("Aharoni", Font.ITALIC, 14));
label7.setForeground(new Color(255, 153, 0));
contentPane.add(label7);
label7.setBounds(15, 128, 699, label7.getPreferredSize().height);
//---- button1 ----
button1.setText("NEXT");
button1.setForeground(new Color(255, 153, 0));
button1.setFont(new Font("Tahoma", Font.BOLD, 22));
contentPane.add(button1);
button1.setBounds(455, 465, 282, button1.getPreferredSize().height);
//---- label8 ----
label8.setText("visual representation of your business name, it's will become one of your most valuable commercial assets. ");
label8.setHorizontalAlignment(SwingConstants.CENTER);
label8.setFont(new Font("Aharoni", Font.ITALIC, 14));
label8.setForeground(new Color(255, 153, 0));
contentPane.add(label8);
label8.setBounds(10, 138, 719, label8.getPreferredSize().height);
//---- label9 ----
label9.setText("Choose a logo: ");
label9.setForeground(new Color(0, 153, 255));
label9.setFont(new Font("Aharoni", Font.BOLD, 22));
contentPane.add(label9);
label9.setBounds(30, 185, 170, label9.getPreferredSize().height);
contentPane.add(separator1);
separator1.setBounds(110, 168, 569, 20);
//---- radioButton1 ----
radioButton1.setText("text");
contentPane.add(radioButton1);
radioButton1.setBounds(new Rectangle(new Point(100, 245), radioButton1.getPreferredSize()));
{ // compute preferred size
Dimension preferredSize = new Dimension();
for(int i = 0; i < contentPane.getComponentCount(); i++) {
Rectangle bounds = contentPane.getComponent(i).getBounds();
preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
}
Insets insets = contentPane.getInsets();
preferredSize.width += insets.right;
preferredSize.height += insets.bottom;
contentPane.setMinimumSize(preferredSize);
contentPane.setPreferredSize(preferredSize);
}
pack();
setLocationRelativeTo(getOwner());
// JFormDesigner - End of component initialization //GEN-END:initComponents
}
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
private JLabel label5;
private JLabel label3;
private JLabel label4;
private JLabel label6;
private JLabel label7;
private JButton button1;
private JLabel label8;
private JLabel label9;
private JComponent separator1;
private JRadioButton radioButton1;
// JFormDesigner - End of variables declaration //GEN-END:variables
public static void main (String[] args) {
project1part6 frame = new project1part6();
frame.setVisible(true);
}
}