StackOverflowError-help!!!!

been trying to compile my program from a long time and i'm coming across this error during runtime ...the exact error dat's coming when i run it is

Exception in thread"main" java.lang.StackOverflowError

at sun.awt.X11GraphicsConfig.pGetBounds(Native Method)

at sun.awt.X11GraphicsConfig.getBounds(X11GraphicsConfig.java:336)

at java.awt.Window.init(Window.java:277)

at java.awt.Window.<init>(Window.java:311)

at java.awt.Frame.<init>(Frame.java:419)

at java.awt.Frame.<init>(Frame.java:384)

at javax.swing.JFrame.<init>(JFrame.java:150)

at jukeboxproject.UI.<init>(UI.java:30)

at jukeboxproject.UI.<init>(UI.java:15)

at jukeboxproject.UI.<init>(UI.java:15)

at jukeboxproject.UI.<init>(UI.java:15)

at jukeboxproject.UI.<init>(UI.java:15)

this isn't exactly it....it keeps repeating this line //at jukeboxproject.UI.<init>(UI.java:15)// over and over again till the end ....i have absolutely no idea about this exception. CAn someobne plz tell me when and howthis exception occues and what could have possibly gone wrong wit my program to generate it.

i'm kinda a beginner at JAva as such and am using the netbeans GUI drag and drog form...a lot of the code is generated by netbeans in this process. I;'m postin my code so plzzzzzzzzzzzzzzzzz tell me wht's wrong...i'm really desperate rght now!!!

[1485 byte] By [developer_chica] at [2007-10-3 5:01:50]
# 1

THE CODE

package jukeboxproject;

/*

* UI.java

*

* Created on July 17, 2006, 3:17 PM

*/

public class UI extends javax.swing.JFrame implements Runnable{

//creating boolean value

boolean descision;

//class objects

UI ui=new UI();

static Audio a=new Audio();

FileChooserForm c=new FileChooserForm(new javax.swing.JFrame(), true);

//creating a thread object that controls the scrolling of the title of the song in the label

Thread scroll=new Thread(this);

String variable=c.title;

public void run() {

ui.nameScroll(c.title);

}

public UI() {

initComponents();

//adding items to the create combo box

create.addItem("");

create.addItem("Create Playlist");

create.addItem("Save Playlist");

create.addItem("Rate Playlist");

create.addItem("Bookmark your playlist");

boolean descision=false;

//initially sets the text on the scrolling field to null

scrollfield.setText(null);

/*when file chooser icon clicked then the value of descision changes

from false to true and thus if true starts scrolling name*/

if(descision=true) {

scrollfield.setText(variable);

scroll.start();

}

}

//don't bother bout this list...a list of all the components in my GUI

private void initComponents() {

//component list generated by netbeans ...initializes and declares componenets

pack();

}

//file is the name of the button that is clicked on to open the file chooser

private void fileActionPerformed(java.awt.event.ActionEvent evt) {

FileChooserForm c=new FileChooserForm(new javax.swing.JFrame(), true);

descision=true;

}

private void loopButtonActionPerformed(java.awt.event.ActionEvent evt) {

a.loop();

}

private void stopActionPerformed(java.awt.event.ActionEvent evt) {

a.stop();

}

private void playActionPerformed(java.awt.event.ActionEvent evt) {

a.play();

}

public String nameScroll(String t ) {

try {

for(int i=t.length(); i>0; --i) {

scrollfield.setText(t.substring(i));

scroll.sleep(1000);

}

} catch (InterruptedException ex) {

ex.printStackTrace();

}

return null;

}

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new UI().setVisible(true);

}

});

}

// Variables declaration - do not modify (generated by netbeans)

private javax.swing.JComboBox create;

public javax.swing.JButton file;

private javax.swing.JDialog jDialog1;

private javax.swing.JFrame jFrame1;

private javax.swing.JFrame jFrame2;

private javax.swing.JLabel jLabel1;

private javax.swing.JLabel jLabel2;

private javax.swing.JLabel jLabel3;

private javax.swing.JLabel jLabel4;

private javax.swing.JMenu jMenu1;

private javax.swing.JMenu jMenu10;

private javax.swing.JMenu jMenu11;

private javax.swing.JMenu jMenu12;

private javax.swing.JMenu jMenu13;

private javax.swing.JMenu jMenu14;

private javax.swing.JMenu jMenu2;

private javax.swing.JMenu jMenu3;

private javax.swing.JMenu jMenu4;

private javax.swing.JMenu jMenu5;

private javax.swing.JMenu jMenu6;

private javax.swing.JMenu jMenu7;

private javax.swing.JMenu jMenu8;

private javax.swing.JMenu jMenu9;

private javax.swing.JMenuBar jMenuBar1;

private javax.swing.JMenuBar jMenuBar2;

private javax.swing.JMenuBar jMenuBar3;

private javax.swing.JMenuBar jMenuBar4;

private javax.swing.JMenuBar jMenuBar5;

private javax.swing.JMenuItem jMenuItem1;

private javax.swing.JMenuItem jMenuItem10;

private javax.swing.JMenuItem jMenuItem11;

private javax.swing.JMenuItem jMenuItem12;

private javax.swing.JMenuItem jMenuItem13;

private javax.swing.JMenuItem jMenuItem2;

private javax.swing.JMenuItem jMenuItem3;

private javax.swing.JMenuItem jMenuItem4;

private javax.swing.JMenuItem jMenuItem5;

private javax.swing.JMenuItem jMenuItem6;

private javax.swing.JMenuItem jMenuItem7;

private javax.swing.JMenuItem jMenuItem8;

private javax.swing.JMenuItem jMenuItem9;

private javax.swing.JPanel jPanel1;

private javax.swing.JScrollPane jScrollPane1;

private javax.swing.JSlider jSlider1;

private javax.swing.JToolBar jToolBar1;

private javax.swing.JRadioButton loopButton;

private javax.swing.JButton pause;

public javax.swing.JButton play;

public javax.swing.JList playlist;

private javax.swing.JTextField scrollfield;

public javax.swing.JButton search;

private javax.swing.JTextField searchField;

private javax.swing.JButton stop;

// End of variables declaration

}

developer_chica at 2007-7-14 23:07:28 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2

I don't think this is correct string:

if(descision=true) {

Do you mean:

if(descision==true) {

BTW it's good practice to place constant before variable:

if(true == descision) {

to catch such errors during compilation.

Michael.Nazarov@sun.coma at 2007-7-14 23:07:29 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 3

> >

> //class objects

>UI ui=new UI();

>

That's the problem. When you instantaite your first UI object, it creates a member UI object.

The newly created UI object also has a member UI object, so it creates one. The newly created UI object also has a member UI object, so it creates one. The newly created UI object also has a member UI object, so it creates one. The newly created UI object also has a member UI object, so it creates one. The newly created UI object also has a member UI object, so it creates one. The newly created UI object also has a member UI object, so it creates one. The newly created UI object also has a member UI object, so it creates one. The newly created UI object also has a member UI object, so it creates one. The newly created UI object also has a member UI object, so it creates one. The newly created UI object also has a member UI object, so it creates one. The newly created UI object also has a member UI object, so it creates one. The newly created UI object also has a member UI object, so it creates one. The newly created UI object also has a member UI object, so it creates one. The newly created UI object also has a member UI object, so it creates one. The newly created UI object also has a member UI object, so it creates one. The newly created UI object also has a member UI object, so it creates one. The newly created UI object also has a member UI object, so it creates one. The newly created UI object also has a member UI object, so it creates one. The newly created UI object also has a member UI object, so it creates one. The newly created UI object also has a member UI object, so it creates one.

And so on until you have stack overflow.

BillKriegera at 2007-7-14 23:07:29 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...