"Exception in "AWT-EventQueue-0""

friends,
i am getting an error when i want to handle an event(i.e. a button pressed). the error it throws is as follows
Exception in "AWT-EventQueue-0" java.lang.NullPointerException
at MyClass.actionPerformed(MyClass.java:12)
actually i want to place some text in a textarea when a mouse is pressed. it is urgent. thanks for reply.
regards
haricse

You're referencing a null on line 12 of MyClass.java
Don't do that. (I.e. fix the null)

Similar Messages

  • How to handle the exception in AWT-EventQueue-0?

    This is my code:
    import javax.swing.JFrame;
    public class MainFrame extends JFrame {
         public MainFrame(){
              init();
         public void init(){
              setSize(100,100);
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    public class SubFrame extends MainFrame implements ActionListener{
         private JButton button1 = null;
         public SubFrame(){
              super();
         public void init(){
              super.init();
              button1 = new JButton("button1");
              add(button1);
              button1.addActionListener(this);
         public void actionPerformed(ActionEvent e) {
              // TODO Auto-generated method stub
              button1.setEnabled(false);
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              (new SubFrame()).setVisible(true);
    }When I click the button, this exception will be thrown:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
         at swing.SubFrame.actionPerformed(SubFrame.java:23)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
         at java.awt.Component.processMouseEvent(Component.java:6038)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
         at java.awt.Component.processEvent(Component.java:5803)
         at java.awt.Container.processEvent(Container.java:2058)
         at java.awt.Component.dispatchEventImpl(Component.java:4410)
         at java.awt.Container.dispatchEventImpl(Container.java:2116)
         at java.awt.Component.dispatchEvent(Component.java:4240)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
         at java.awt.Container.dispatchEventImpl(Container.java:2102)
         at java.awt.Window.dispatchEventImpl(Window.java:2429)
         at java.awt.Component.dispatchEvent(Component.java:4240)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

    Darryl.Burke wrote:
    Hmm. Interesting sequence of execution.
    +-- new SubFrame () calls the sub class constructor
    +----  which calls the super class constructor explicitly
    +------  which calls init () of the sub class
    +--------  which calls init () of the super class
    and only after all these calls return, the declaration-cum-assignment of button1 is executed, which makes button1 null.
    (Discovered by putting a breakpoint on that line and debugging in NetBeans)
    With one change, button1 will not be null and the breakpont is not reached.private JButton button1;// = null;What's not clear is why the declaration-cum-initialization takes place after the constructor code executes, shouldn't it run before the constructor?
    It does run before the SubFrame constructor, but it runs after the super class constructor, which is exactly how the language specification says it should be.
    There was a similar thread a while back:
    http://forum.java.sun.com/thread.jspa?threadID=5190252&messageID=9745092
    Note that there is another "bad" habit involved (other than explicitly initializing member variables to null): that an overridden method is called from the super class constructor. That means that the overridden method will be executed before the object it belongs to has been fully initialized, and that will often lead to confusing behavior like this.

  • Exception in thread "AWT-EventQueue-0"  Invalid threat accces

    Hey,
    For my application I have created a menu in the system tray. When you click left you get some dynamic data and when you click right on my menu you get a screen to add a new dynamic menuitem to my system tray menu. but when I try to add something to that menu I get this error:
    Exception in thread "AWT-EventQueue-0" org.eclipse.swt.SWTException: Invalid thread access
    this is my code:
    import java.awt.Frame;
    import java.awt.Dimension;
    import javax.swing.JButton;
    import java.awt.BorderLayout;
    import javax.swing.SwingConstants;
    import java.awt.event.KeyEvent;
    import java.awt.Rectangle;
    import javax.swing.JTextField;
    import javax.swing.JLabel;
    import org.eclipse.swt.*;
    import org.eclipse.swt.graphics.*;
    import org.eclipse.swt.widgets.*;
    public class Test3 extends Frame {
         private static final long serialVersionUID = 1L;
         private JButton jButton = null;
         private JTextField txtInput = null;
         private JLabel lblInput = null;
         private JLabel lblResult2 = null;
         static Display display = new Display ();
         static Shell shell = new Shell (display);  //  @jve:decl-index=0:
         static MenuItem testMi = null;
          * This method initializes jButton     
          * @return javax.swing.JButton     
         private JButton getJButton() {
              if (jButton == null) {
                   jButton = new JButton();
                   jButton.setHorizontalTextPosition(SwingConstants.CENTER);
                   jButton.setMnemonic(KeyEvent.VK_UNDEFINED);
                   jButton.setBounds(new Rectangle(504, 246, 97, 29));
                   jButton.setText("Click");
                   //jButton.setSize(0,80);
                   //jButton.addActionListener(new java.awt.event.ActionListener());
                   jButton.addMouseListener(new java.awt.event.MouseAdapter() {
                        public void mouseClicked(java.awt.event.MouseEvent e) {
                             //System.out.println("mouseClicked()"); // TODO Auto-generated Event stub mouseClicked()
                             lblResult2.setText(txtInput.getText());
                             testMi.setText("Dynamic");
                   //jButton.setRolloverEnabled(false);
                   //jButton.setPreferredSize(new Dimension(50, 10));
              return jButton;
          * This method initializes txtInput     
          * @return javax.swing.JTextField     
         private JTextField getTxtInput() {
              if (txtInput == null) {
                   txtInput = new JTextField();
                   txtInput.setBounds(new Rectangle(187, 73, 416, 22));
              return txtInput;
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              Test3 application = new Test3();
              application.initialize();
              application.setVisible(true);
              Image image = new Image (display, 16, 16);
              final Tray tray = display.getSystemTray ();
              if (tray == null) {
                   System.out.println ("The system tray is not available");
              else {
                   final TrayItem item = new TrayItem (tray, SWT.NONE);
                   item.setToolTipText("SWT TrayItem");
                   item.addListener (SWT.Show, new Listener () {
                        public void handleEvent (Event event) {
                             System.out.println("show");
                   item.addListener (SWT.Hide, new Listener () {
                        public void handleEvent (Event event) {
                             System.out.println("hide");
                   final Menu mainMenu = new Menu (shell, SWT.POP_UP);
                   for (int i =0; i <= 3; i++){
                        MenuItem mi = new MenuItem(mainMenu, SWT.PUSH);
                        mi.setText("Main Menu Item " + i);
                        mi.setEnabled(false);
                        if (i == 3 ){
                             mi.setEnabled(true);
                             mi.setText("Exit program");
                             mi.addListener(SWT.Selection, new Listener (){
                                  public void handleEvent (Event event){
                                       System.exit(0);
                   testMi = new MenuItem(mainMenu, SWT.PUSH);
                   testMi.setText("Static text");
                   item.addListener (SWT.Selection, new Listener () {
                        public void handleEvent (Event event) {
                             System.out.println("selection");
                             mainMenu.setVisible(true);
                   item.addListener (SWT.DefaultSelection, new Listener () {
                        public void handleEvent (Event event) {
                             System.out.println("default selection");
                   final Menu menu = new Menu (shell, SWT.POP_UP);
                   for (int i = 0; i < 8; i++) {
                        MenuItem mi = new MenuItem (menu, SWT.PUSH);
                        mi.setText ("Item" + i);
                        mi.addListener (SWT.Selection, new Listener () {
                             public void handleEvent (Event event) {
                                  System.out.println("selection " + event.widget);
                        if (i == 0) menu.setDefaultItem(mi);
                   item.addListener (SWT.MenuDetect, new Listener () {
                        public void handleEvent (Event event) {
                             menu.setVisible (true);
                   item.setImage (image);
              shell.setBounds(50, 50, 300, 200);
              shell.open ();
              while (!shell.isDisposed ()) {
                   if (!display.readAndDispatch ()) display.sleep ();
              image.dispose ();
              display.dispose ();
          * This is the default constructor
         public Test3() {
              super();
              initialize();
          * This method initializes this
          * @return void
         private void initialize() {
              lblResult2 = new JLabel();
              lblResult2.setBounds(new Rectangle(16, 117, 586, 30));
              lblResult2.setText("");
              lblInput = new JLabel();
              lblInput.setBounds(new Rectangle(13, 70, 168, 26));
              lblInput.setText(" Voer een lappie text in:");
              this.setLayout(null);
              this.setSize(627, 302);
              this.setTitle("Frame");
              this.setVisible(true);
              this.add(getJButton(), null);
              this.add(getTxtInput(), null);
              this.add(lblInput, null);
              this.add(lblResult2, null);
              this.addWindowListener(new java.awt.event.WindowAdapter() {
                   public void windowClosing(java.awt.event.WindowEvent e) {
                        //lblResult2.setText("So you wanna close this window.. ;-) ");
                        System.exit(0);
    }  //  @jve:decl-index=0:visual-constraint="10,10"When you run this, you see a nice menu in the system tray..
    add some text in the screen that popup and click on save.. now you see the error.. (In this example ill try to change the static menu into a dynamic one)

    This is what I need for my application:
    - system tray menu
    - and some screens to infuence the system tray menu.. (add items to it, change setEnabled properties, etc)
    This is what I found on the Internet..
    Can you profide me (either an example or link to a page) where both is done?

  • Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException

    Hello everyone ... sorry for my English but I am an Italian boy with a problem that is not answered.
    I had to create a web application-service (created in Java with NetBeans 6.7) which is connected to a database postgresql (8.3.5) and for connection to the server using tomcat (3.2.4) through SOAP messages (2_2).
    OPERATING SYSTEM: WINXP
    I have created classes ... I created the database ... completed the project in NetBeans without any errors ... implemented the necessary libraries in the project (also ).... 8.3.604.jar jdbc tomcat configured and soap ... .. and set the environment variables (soap, mail, send in xerces )...... run the application on the NetBeans appears the login screen of my web service .....
    enter username and password (exactly!) and the NetBeans gives me an Exception:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at Intro.loginActionPerformed(Intro.java:522)
            at Intro.access$100(Intro.java:21)
            at Intro$2.actionPerformed(Intro.java:111)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6263)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6028)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4630)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4460)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
            at java.awt.Container.dispatchEventImpl(Container.java:2085)
            at java.awt.Window.dispatchEventImpl(Window.java:2475)
            at java.awt.Component.dispatchEvent(Component.java:4460)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 31 seconds)  The line 522 Intro class is as follows:
    private void loginActionPerformed(java.awt.event.ActionEvent evt) {                                     
            try {
                URL address= new URL("http://"+ip+":8080/soap/servlet/rpcrouter");
                //Costruzione della chiamata
                Call chiamata = new Call();
                chiamata.setTargetObjectURI("urn:server");
                chiamata.setMethodName("controllaAgenzia");
                chiamata.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
                //creazione parametri che dovro' passare al soap
                Vector<Parameter> params = new Vector<Parameter>();
                String u = user.getText();
                String p = String.valueOf(password.getPassword());
                params.addElement(new Parameter("user", String.class, u, null));
                params.addElement(new Parameter("password", String.class, p, null));
                chiamata.setParams(params);//parametri passati al soap
                try {
                    //Invocazione RPC
                    Response respons = chiamata.invoke(address, "");
                    //qui ho la risposta inviata dal server
                    *Parameter par = respons.getReturnValue();*
                    Object value = par.getValue();
                    String REP = String.valueOf(value);
                    System.out.println(REP);
                    if (REP.equals("ACK_agenzia")) {
                        new MainAgenzia(ip);
                        this.dispose();
                    } else if (REP.equals("NACK_agenzia")) {
                        JOptionPane.showMessageDialog(null, "I dati inseriti non sono corretti", "Errore", JOptionPane.ERROR_MESSAGE);
                        password.setText("");
                        user.setText("");
                    } The strange thing is that this web service was running just finished the project.
    After 4-5 days of its operation has stopped, creandomi this problem.
    I think the answer is, the server that is not the case.
    I thought all I thought was jdbc, but I can connect to the database, so I do not know what to do and how to proceed.
    thanks to all, and thanks to my translator. :P

    Parameter par = respons.getReturnValue();There is only one possible reason, "respons" is null.

  • Problem with recursive function & Exception in thread "AWT-EventQueue-0"

    I hope that title doesn't put everyone off :)
    I have a recursive function that takes in a list of words, and a reference to my current best board. I am kludging the escape function +(tryWords.size() == 0 || mTotalBlankBlocks < 200)+ atm, but eventually it will escape based on whether the current bestBoard meets certain requirements. The function makes iterates through a list of words, and finds all the spaces that the word would fit into the puzzle: getValidSpacedPositions(currentWord); - it then iterates through each of these; placing a word, removing that word from the iterator and the relevant arrayLists and then recurses the function and tries to do the same with the next word etc.
    private void computeBoards(ArrayList<Word> tryWords, Board bestBoard) {
         if (tryWords.size() == 0 || mTotalBlankBlocks < 200)
              return;
         for(Iterator<Word> iter = tryWords.iterator(); iter.hasNext(); ){
              Word currentWord = new Word();
              currentWord = iter.next();
              ArrayList<Position> positions = new ArrayList<Position>();
              positions = getValidSpacedPositions(currentWord);
              if (positions.size() != 0)
                   iter.remove();
              System.out.println();
              int placedWordsIndex = tryWords.indexOf(currentWord);
              System.out.print(placedWordsIndex+". "+currentWord.getString()+" with "+positions.size()+" positions / ");
              for (Position position : positions) {
                   System.out.println("Pos:"+(positions.indexOf(position)+1)+" of "+positions.size()+"  "+position.getX()+","+position.getY()+","+position.getZ());
                   int blankBlocksLeft = placeWord(currentWord, position);
                   if(blankBlocksLeft != 0)
                        mPlacedWords.add(currentWord);
                        // TODO: Kludge! Fix this.
                        mUnplacedWords.remove(placedWordsIndex+1);
                        System.out.println("adding "+currentWord.getString()+" to added words list");
                        Board compareBoard = new Board(blankBlocksLeft, mPlacedWords.size());
                        if (compareBoard.getPercFilled() > bestBoard.getPercFilled())
                             bestBoard = new Board(blankBlocksLeft, mPlacedWords.size());
                        //**RECURSE**//
                        computeBoards(tryWords, bestBoard);
                        mUnplacedWords.add(currentWord);
                        removeWord(currentWord);
                        System.out.println("removing "+currentWord.getString()+" from added words list");
                   else
                        System.out.println("strange error, spaces are there but word cannot place");
              System.out.println("**FINISHED ITERATING POSITIONS");
         System.out.println("**FINISHED ITERATING TRYWORDS");
    }This all seems to work fine, but I add it in for completeness because I am not sure if I have done this right. The Exception occurs in the placeWord function which is called from the recursive loop, on the line bolded. For some reason the Arraylist Words seems to initialise with size 1 even though it is a null's when I look at it, (hence all the redundant code here) and I can't seem to test for null either, it seems to works fine for a while until the recursive funciton above has to back up a few iterations, then it crashes with the exception below.
         private int placeWord(Word word, Position originPosition) {
              ArrayList<Word> words = new ArrayList<Word>();
              switch (originPosition.getAxis().getCurrInChar()) {
              case 'x':
                   // TODO: This is returning ONE!!!s
                   words = mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ()].getWords();
                   int tempword1 = mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ()].getWords().size();
                   for (int i = 0; i < word.getLength(); i++) {
                        *if (words.get(0) == null)*
                             mBlockCube[originPosition.getX() + i][originPosition.getY()][originPosition.getZ()] = new Block(word, word.getChar(i));
                        else
                             mBlockCube[originPosition.getX() + i][originPosition.getY()][originPosition.getZ()].addWord(word);
                   break;
              case 'y':
                   words = mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ()].getWords();
                   int tempword2 = mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ()].getWords().size();
                   for (int i = 0; i < word.getLength(); i++) {
                        *if (words.get(0) == null)*
                             mBlockCube[originPosition.getX()][originPosition.getY() + i][originPosition.getZ()] = new Block(word, word.getChar(i));
                        else
                             mBlockCube[originPosition.getX()][originPosition.getY() + i][originPosition.getZ()].addWord(word);
                   break;
              case 'z':
                   words = mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ()].getWords();
                   int tempword3 = mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ()].getWords().size();
                   for (int i = 0; i < word.getLength(); i++) {
                        *if (words.get(0) == null)*
                             mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ() + i] = new Block(word, word.getChar(i));
                        else
                             mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ() + i].addWord(word);
                   break;
              mTotalBlankBlocks -= word.getLength();
              word.place(originPosition);
              String wordStr = new String(word.getWord());
              System.out.println("Word Placed: " + wordStr + " on Axis: " + originPosition.getAxis().getCurrInChar() + " at pos: "
                        + originPosition.getX() + "," + originPosition.getY() + "," + originPosition.getZ());
              return mTotalBlankBlocks;
    Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
         at java.util.ArrayList.RangeCheck(Unknown Source)
         at java.util.ArrayList.get(Unknown Source)
         at com.edzillion.crossword.GameCube.placeWord(GameCube.java:189)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:740)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
         at com.edzillion.crossword.GameCube.generateGameCube2(GameCube.java:667)
         at com.edzillion.crossword.GameCube.<init>(GameCube.java:42)
         at com.edzillion.crossword.Crossword.actionPerformed(Crossword.java:205)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    Any ideas? I've looked up this exception which didn't shed any light...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    ArrayList<Word> words = new ArrayList<Word>();See the API Javadoc for ArrayList: this creates an empty ArrayList.
    if (words.get(0) == null)This tries to read the first element of the (still empty) array list -> throws IndexOutOFBoundsException
    If you want to stick to that logic (I am too lazy to proof-read your whole algorithm, but that should at least unblock you), you should first check whether the list actually contains at least one element:
    if (!words.isEmpty()) {...}

  • Exception JComboox :Exception in thread "AWT-EventQueue-0" java.lang.NullPo

    Hi, I mapped a vector object to the JComboBox. I'm using the observer pattern to update the ComboBox box whenever there is an message receives.If an update is received I just add the data to the vector and to refresh the ComboBox bu calling the UpdateUI() method. When more updates received same time i'm getting the following exception.
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
         at javax.swing.plaf.basic.BasicComboBoxUI.paintCurrentValue(BasicComboBoxUI.java:1059)
         at javax.swing.plaf.basic.BasicComboBoxUI.paint(BasicComboBoxUI.java:850)
         at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
         at javax.swing.JComponent.paintComponent(JComponent.java:740)
         at javax.swing.JComponent.paint(JComponent.java:1003)
         at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4930)
         at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4883)
         at javax.swing.JComponent._paintImmediately(JComponent.java:4826)
         at javax.swing.JComponent.paintImmediately(JComponent.java:4633)
         at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
         at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Please assist me in fixing this issue if anyone came across this issue.
    Thanks.

    I just add the data to the vector and to refresh the ComboBox bu calling the UpdateUI() methodYou should NOT be updating the vector.
    That is NOT what the updateUI() method is used for.
    The proper way to update a component is to udate the MODEL The model will then notify the VIEW so it can repaint itself. Also, make sure the code is executed on the EDT. Read the section from the Swing tutorial on Concurrency.

  • Why Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException?

    Hello,
    In my netbeans generated swing code I get the following stacktrace:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
         at javax.swing.text.PlainView.updateMetrics(PlainView.java:188)
         at javax.swing.text.PlainView.lineToRect(PlainView.java:589)
         at javax.swing.text.PlainView.modelToView(PlainView.java:327)
         at javax.swing.text.FieldView.modelToView(FieldView.java:248)
         at javax.swing.plaf.basic.BasicTextUI$RootView.modelToView(BasicTextUI.java:1498)
         at javax.swing.plaf.basic.BasicTextUI.modelToView(BasicTextUI.java:1036)
         at javax.swing.text.DefaultCaret.repaintNewCaret(DefaultCaret.java:1291)
         at javax.swing.text.DefaultCaret$1.run(DefaultCaret.java:1270)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:633)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)The code is @ http://code.google.com/p/memorizeasy/source/browse/trunk/MemorizEasy/src/com/mysimpatico/memorizeasy/engine/executables/Input.java

    So the problem is given by these two lines, of the Swing-X library:
    AutoCompleteDecorator.decorate(expField, exps, false);
    AutoCompleteDecorator.decorate(defField, exps, false);
    However, the functionality intended from them is given. The problem now seems to do with expField.setText() and expField.selectAll(). I've inline initialized expField, and now it works.
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    * Input1.java
    * Created on Feb 21, 2010, 11:56:00 AM
    import java.util.ArrayList;
    import javax.swing.*;
    import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
    public class Input1 extends javax.swing.JFrame {
         private static final long serialVersionUID = 2819528413930929081L;
         private static final ArrayList<String> exps = new ArrayList<String>();//Database.getAllExps();
         private static final Input1 instance  = new Input1();
         /* private void defFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_defFieldFocusGained
                 defField.selectAll();
         }//GEN-LAST:event_defFieldFocusGained
             private void expFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_expFieldActionPerformed
                final String exp = expField.getText();
               /* if (defField.isVisible() && exp != null && exps.contains(exp)){
                    status.setText("to change the spelling select Spelling from the Edit Menu.");
                else if (!defField.isVisible()){ //in spelling mode
                    Database.editExpression(exSpell, exp);
                    status.setText("spelling for " + exSpell + " changed to " + exp);
                    defField.setVisible(true);
                    spellingMenuItem.setEnabled(false);
             }//GEN-LAST:event_expFieldActionPerformed
         private void initComponents() {
              contentPanel = new javax.swing.JPanel();
              expField = new javax.swing.JTextField();
               expField.setText("expression");
                    /*  expField.addActionListener(new java.awt.event.ActionListener() {
                          public void actionPerformed(java.awt.event.ActionEvent evt) {
                              expFieldActionPerformed(evt);
                      expField.addFocusListener(new java.awt.event.FocusAdapter() {
                          public void focusGained(java.awt.event.FocusEvent evt) {
                              expFieldFocusGained(evt);
                      defField.setText("definition");
                      defField.addActionListener(new java.awt.event.ActionListener() {
                          public void actionPerformed(java.awt.event.ActionEvent evt) {
                              defFieldActionPerformed(evt);
                      defField.addFocusListener(new java.awt.event.FocusAdapter() {
                          public void focusGained(java.awt.event.FocusEvent evt) {
                              defFieldFocusGained(evt);
              setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
              contentPanel.add(expField);
              expField.setVisible(true);
              this.setContentPane(contentPanel);
              pack();
         }// </editor-fold>
         /** Creates new form Input1 */
         private Input1() {
              initComponents();
              AutoCompleteDecorator.decorate(expField, exps, false);
         private void expFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_expFieldFocusGained
                 expField.selectAll();
          * @param args the command line arguments
         public static void main(String args[]) {
              java.awt.EventQueue.invokeLater(new Runnable() {
                   public void run() {
                        instance.setVisible(true);
         // Variables declaration - do not modify
         private javax.swing.JPanel contentPanel;
         private javax.swing.JTextField expField;
         // End of variables declaration
    }Edited by: simpatico_gabriele on Mar 11, 2010 8:09 PM

  • Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError:

    hi,
    i have to build similar sql query analizer. i am using jdbc and swing.
    my frame contains jtable and jtree. jtree contains schemas and tables.
    Jtables show mysql table data, when user choose table in Jtree.
    its run first click and second.... But after a few click its doesnt run and i get this Exception:
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    at com.mysql.jdbc.Buffer.getBytes(Buffer.java:198)
    at com.mysql.jdbc.Buffer.readLenByteArray(Buffer.java:318)
    at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1345)
    at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:2330)
    at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:427)
    at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:2035)
    at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1421)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1772)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:2430)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:2359)
    at com.mysql.jdbc.Statement.executeQuery(Statement.java:1227)
    at Database.getQueryRs(Database.java:50)
    at Database.getColumnNames(Database.java:30)
    at NewJFrame.tableDegis(NewJFrame.java:221)
    at NewJFrame.jTree1ValueChanged(NewJFrame.java:196)
    at NewJFrame.access$000(NewJFrame.java:21)
    at NewJFrame$1.valueChanged(NewJFrame.java:93)
    at javax.swing.JTree.fireValueChanged(JTree.java:2825)
    at javax.swing.JTree$TreeSelectionRedirector.valueChanged(JTree.java:3196)
    at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:629)
    at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1078)
    at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(DefaultTreeSelectionModel.java:287)
    at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(DefaultTreeSelectionModel.java:170)
    at javax.swing.JTree.setSelectionPath(JTree.java:1600)
    at javax.swing.plaf.basic.BasicTreeUI.selectPathForEvent(BasicTreeUI.java:2410)
    at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(BasicTreeUI.java:3619)
    at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed(BasicTreeUI.java:3558)
    at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:262)
    at java.awt.Component.processMouseEvent(Component.java:6035)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
    at java.awt.Component.processEvent(Component.java:5803)
    at java.awt.Container.processEvent(Container.java:2058)
    private void jTree1ValueChanged(javax.swing.event.TreeSelectionEvent evt) {                                   
            try{
                DefaultMutableTreeNode node = (DefaultMutableTreeNode)
                                jTree1.getLastSelectedPathComponent();
                if (node == null) return;
                if (node.isLeaf()) {
                    if(node.getLevel() > 1){
                        System.out.println(node.getParent());
                        tableDegis(node.getParent().toString(),node.toString());
                } else {
            }catch(Exception e){
    private void tableDegis(String schema,String table){
             DefaultTableModel tablemodel = new DefaultTableModel();
             tablemodel.setDataVector(db.getData(schema,table),db.getColumnNames(schema,table));
             jTable1.setModel(tablemodel);
             System.out.println(db.getColumnNames(schema,table));
             System.gc();
    public Vector getColumnNames(String schemaName,String tableName){
              Vector<String> columnNames = new Vector<String>();
              try{
                   ResultSet rs = getQueryRs(schemaName,tableName);
                 ResultSetMetaData md = rs.getMetaData();
                   int columns = md.getColumnCount();
                 for (int i = 1; i <= columns; i++)             {
                     columnNames.addElement( md.getColumnName(i) );
              }catch(Exception e){}
              System.gc();
              return columnNames;
    public ResultSet getQueryRs(String schemaName,String tableName){
              ResultSet rs = null;
              try{
                   String sql = "Select * from "+tableName;
                            connection.setCatalog(schemaName);
                            Statement stmt3 = connection.createStatement();
                            rs = stmt3.executeQuery( sql );
              }catch(Exception e){
              System.gc();
              return rs;
    public Vector getData(String schemaName,String tableName){
            Vector<Vector<Object>> data = new Vector<Vector<Object>>();
              try{   
                        ResultSet rs = getQueryRs(schemaName,tableName);
                        ResultSetMetaData md = rs.getMetaData();
                        int columns = md.getColumnCount();
                        while (rs.next()){
                      Vector<Object> row = new Vector<Object>(columns);
                            for (int i = 1; i <= columns; i++){
                                row.addElement( rs.getObject(i) );
                            data.addElement( row );
              }catch(Exception e){}
              System.gc();
              return data;
         }

    lokesh_Kumar_Singh
    Welcome to the forum. Please don't post in old threads that are long dead. When you have a question, please start a topic of your own. Feel free to provide a link to an old thread if relevant.
    I'm locking this thread now. It's more than 1½ years old.
    db

  • Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException:

    Could anyone please explain me what is this error about
    Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.Integer
    at timetablegen.MainFrame.jButton17ActionPerformed(MainFrame.java:1816)
    at timetablegen.MainFrame.access$2100(MainFrame.java:16)
    at timetablegen.MainFrame$23.actionPerformed(MainFrame.java:1136)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
    at java.awt.Component.processMouseEvent(Component.java:5488)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
    at java.awt.Component.processEvent(Component.java:5253)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Window.dispatchEventImpl(Window.java:1774)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    I am taking an object from jComboBox as a String and then converting it to integer & adding to the database.
    It is not getting added in database to & throwing above exception.

    Hello,
    First parse the string taken from combo box using Integer.parseInt(str), not directly cast it to Integer.
    Regards

  • Exception in thread "AWT-EventQueue-0

    I am receiving the [Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException] from my code.
    a button press triggers this exception, the thing is, the press of the button executes some xqueries and does not have any potential null variables. the variables used on the xquery are taken from a combox and are not null.
    the error message iam getting is
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at wizard.Wizard1.jButton2ActionPerformed(Wizard1.java:2915)
            at wizard.Wizard1.access$3400(Wizard1.java:54)
            at wizard.Wizard1$35.actionPerformed(Wizard1.java:2663)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6041)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
            at java.awt.Component.processEvent(Component.java:5806)
            at java.awt.Container.processEvent(Container.java:2058)
            at java.awt.Component.dispatchEventImpl(Component.java:4413)
            at java.awt.Container.dispatchEventImpl(Container.java:2116)
            at java.awt.Component.dispatchEvent(Component.java:4243)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
            at java.awt.Container.dispatchEventImpl(Container.java:2102)
            at java.awt.Window.dispatchEventImpl(Window.java:2440)
            at java.awt.Component.dispatchEvent(Component.java:4243)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)my code on the button is
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
            try {
                String minorfunctionality;
                String majorfunctionality;
                String roomstyle;
                String floortype;
                String driver = "org.exist.xmldb.DatabaseImpl";
                Class cl = Class.forName(driver);
                Database database = (Database) cl.newInstance();
                DatabaseManager.registerDatabase(database);
                Collection col = DatabaseManager.getCollection("xmldb:exist://localhost:8080/exist/xmlrpc/db/XMLroom","admin","");          
                XPathQueryService service = (XPathQueryService) col.getService("XPathQueryService", "1.0");
                service.setProperty("indent", "yes");
                    XMLResource document = (XMLResource)col.createResource("Example 1", "XMLResource"); 
                    String path2= "C:\\Configuration\\XML_29_4_09.xml";
                    File f2 = new File(path2);
                    if(!f2.canRead()) { 
                   System.out.println("cannot read file " + path2 ); 
                   return; 
                  document.setContent(f2); 
                 System.out.print("storing document " + document.getId() + "..."); 
                   col.storeResource(document); 
                majorfunctionality = jComboBox1.getSelectedItem().toString();
                minorfunctionality = jComboBox2.getSelectedItem().toString();
                floortype = jComboBox15.getSelectedItem().toString();
                roomstyle = jComboBox3.getSelectedItem().toString();
                ResourceSet result = service.query(" update replace doc('XML_29_4_09.xml')//functionality/MajorFunctionality with <MajorFunctionality>" + majorfunctionality + "</MajorFunctionality>");
                ResourceSet result2 = service.query(" update replace doc('XML_29_4_09.xml')//functionality/MinorFunctionality with <MinorFunctionality>" + minorfunctionality + "</MinorFunctionality>");
                ResourceSet result3 = service.query(" update replace doc('XML_29_4_09.xml')//room/style with <style>" + roomstyle + "</style>");
                ResourceSet result4 = service.query(" update replace doc('XML_29_4_09.xml')//floor/material/texture with <texture>" + floortype + "</texture>");
                ResourceIterator i = result.getIterator();
                while (i.hasMoreResources()) {
                Resource r = i.nextResource();
                System.out.println((String) r.getContent());
            } catch (XMLDBException ex) {
                Logger.getLogger(Wizard1.class.getName()).log(Level.SEVERE, null, ex);
            } catch (InstantiationException ex) {
                Logger.getLogger(Wizard1.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IllegalAccessException ex) {
                Logger.getLogger(Wizard1.class.getName()).log(Level.SEVERE, null, ex);
            } catch (ClassNotFoundException ex) {
                Logger.getLogger(Wizard1.class.getName()).log(Level.SEVERE, null, ex);
        }any ideas why im getting this? thank you in advance.

    ok , in line 2915
    XPathQueryService service = (XPathQueryService) col.getService("XPathQueryService", "1.0");this declaration is standard when writing an xquery.
    and col has been declared before this line
    Collection col = DatabaseManager.getCollection("xmldb:exist://localhost:8080/exist/xmlrpc/db/XMLroom","admin","");

  • Had to un-install JRE, again. "AWT-EventQueue-13" exception.

    Hello every body readers,
    and a Happy Christmas from me in Sweden.
    I installed latest JRE "jre1.5.0_01".
    Had to uninstall and use Microsoft java instead, AGAIN.
    Those who said to me in past: "Use IE Java. Works better" was probably right.
    As now Sun Java only occupies a considerable amont of space in my PC.
    You will probably ask me to re-write my HTMLs to fit JRE.
    Suppose IExplorer6 wasn't backwards compitable with HTML-pages.
    Most .html pages in world would have to be re-written!!!!!!!!!
    JRE makes error when trying to update MyClass.class.
    "at DJClock.update(E:\Msdev\projects\DJClock\DJClock.java:552)"
    A leftover from development stage of this software.
    Well!
    And this you offer millions of poor users around the world to download?????
    Maybe you will not recognize this fault,
    and try some political jargong 'we never do anything bad" non-excuse.
    I would simple say: "we are very sorry!" to all potential users reading this thread.
    We humans are NOT perfect. When try to appear perfect, we deny the truth.
    And we would not be credible in fellow men's eyes.
    Isn't it pathetic hear someone say:
    "I did not have seex with that woman"
    when it is obviously a big lie. :D :D
    I hope you're human at this developers site.
    I have a slight hope some few around here
    are not only "living effective programming robot machines".
    Regards and thanks for your FREE, although not working software
    /halojoy - Sweden 2004-12-29
    FACTS follows:
    In my htdocs:
    APP1-folder
         MyClass.class
         index.html(<applet codebase="." code="MyClass.class"</applet>)
    APP2-folder
         MyClass.class
         index.html(<applet codebase="." code="MyClass.class"</applet>)
    Uses same class, but I have copy at 2 places.
    First applet will run correctly.
    Second applet will generate following message:
    Exception in thread "AWT-EventQueue-13" java.lang.NullPointerException
         at sun.font.FontDesignMetrics.stringWidth(Unknown Source)
         at DJClock.update(E:\Msdev\projects\DJClock\DJClock.java:552)
         at sun.awt.RepaintArea.updateComponent(Unknown Source)
         at sun.awt.RepaintArea.paint(Unknown Source)
         at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)

    Thanks, alvareze.
    But I think you haven't read my post correctly.
    I think I provided enough information for eanyone to repeat my situation in their own computer.
    Anf find out there is a bug.
    I wish I was wrong, on behalf of users suffering from this,
    but I am sure I am right!
    So here is what you do.
    1) Take an applet, xxxxxx.class, intended for showing in a html-page.
    2) Create 2 folders at your server. Lets call them: APPL1 and APPL2
    3) Write 2 different index.html containing applet xxxxxx.class
    4) You make a copy of this Class: xxxxxx.class in EACH of two folders APPL1, APPL2
    5) Each index.html in separate folders Calls their own copy of xxxxxx.class
    in respective folder.
    6) The structure you have now is, what I ALREADY told you. (am I talking to children. No!):
    In my htdocs:
    APP1-folder
         MyClass.class
         index.html(<applet codebase="." code="MyClass.class"</applet>)
    APP2-folder
         MyClass.class
         index.html(<applet codebase="." code="MyClass.class"</applet>)
    6) Now you can visit your both websites:
    - http://root/APPL1/index.html
    running applet.
    Then visit
    - http://root/APPL2/index.html
    running same applet.
    And I am sure you will end up with same error message.
    AWT-EventQueue-13" exception.
    (see Above. And below. LISTEN CAREFULLY, I will only say this TWICE):
    Uses same class, but I have copy at 2 places.
    ##) My EXPLANATION:
    possibly causing this error, and making JRE useless for me:
    When JRE runs into a Class with same name again,
    it will update that class in its library.
    But when it does it searches, STILL, in the developers Drive E:\
    A leftover code, from developing stage.
    Instead JRE should look for MyClass.class in drive where,
    I put JRE files. In this case Drive C:\
    ##) In other words:
    - at MyClass.update(E:\Msdev\projects\MyClass\MyClass.java:552)
    should be, to avoid error
    - at MyClass.update(C:\my path to JRE\MyClass\MyClass.java:552)
    ##) First applet will run correctly.
    ##)Second applet will generate following message:
    Exception in thread "AWT-EventQueue-13" java.lang.NullPointerException
         at sun.font.FontDesignMetrics.stringWidth(Unknown Source)
         at MyClass.update(E:\Msdev\projects\MyClass\MyClass.java:552)
         at sun.awt.RepaintArea.updateComponent(Unknown Source)
         at sun.awt.RepaintArea.paint(Unknown Source)
         at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    I wont bother with this again,
    as I do not like to explain myself over and over
    to people that are not REALLY interested in getting my information.
    And it will not effect me in any way, as I no longer use this free JRE from great Sun Java Laboratories.
    I stick to Microsoft Java, until you find your bugs, yourselves, fixes this software version.
    Then you tell me to download it again, please!
    Thanks again for you wish to provide us users with a super software.
    nothing wrong with your aim or goal, but ...
    maybe can strike back, when releasing not properly debugged sotware
    to millions and millions of potential users.
    Better no reputation, than bad reputation= badwill.
    So sometimes better late release than too early.
    Have seen this happen with other software version around www.
    By the time bugs are corected, customers are happily using another similiar software.
    No hard feelings.
    Happy Ne Year everybody!
    computer and internet freaks, like me
    /halojoy - in snowy northern part of Sweden (had a white christmas, as always)
    Sorry, will not be here again, talking to deaf? people :)
    in same subject
    GoodBye

  • "AWT-EventQueue-0" Exception

    Hi, I've been working on a GUI panel.. My exception is this:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at freedom$Test$5.actionPerformed(freedom.java:598)
            at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
            at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
            at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
            at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
    ce)
            at java.awt.Component.processMouseEvent(Unknown Source)
            at javax.swing.JComponent.processMouseEvent(Unknown Source)
            at java.awt.Component.processEvent(Unknown Source)
            at java.awt.Container.processEvent(Unknown Source)
            at java.awt.Component.dispatchEventImpl(Unknown Source)
            at java.awt.Container.dispatchEventImpl(Unknown Source)
            at java.awt.Component.dispatchEvent(Unknown Source)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
            at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
            at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
            at java.awt.Container.dispatchEventImpl(Unknown Source)
            at java.awt.Window.dispatchEventImpl(Unknown Source)
            at java.awt.Component.dispatchEvent(Unknown Source)
            at java.awt.EventQueue.dispatchEvent(Unknown Source)
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.run(Unknown Source)Now, line 598 is the following:
    fd.log();The code surrounding it is as follows:
                button_5 = new JButton("Log  Out");
                button_5.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent event) {
                             fd.log();
                add(button_5);Any idea on how I can handle this exception error?
    Thanks.

    I'm having a problem with my JButtons appearing to be null when working with the doClick() method.That would be because the class variable is null.
    You also created a local variable, which you can't access outside the init() method.

  • Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException

    Hi gurus,
    I am using mouse event in oracle forms 10g.I am getting following error in java console when loading java applet.I am using java plugin 1.6.0_29-b02.Oracle forms version is 10.1.2.0.Kindly give me solution to overcome this.
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    Loaded image: jar:http://trl1th6m8k34j.trafford.ford.com:8889/forms/java/frmall.jar!/oracle/forms/icons/oracle_logo.gif
    Loaded image: http://trl1th6m8k34j.trafford.ford.com:8889/forms/yes
    proxyHost=null
    proxyPort=0
    connectMode=HTTP, native.
    Forms Applet version is : 10.1.2.0
    Loaded image: jar:http://trl1th6m8k34j.trafford.ford.com:8889/forms/java/frmall.jar!/oracle/forms/icons/frame.gif
    Trace level set to 5: all ... completed.
    network: Cache entry not found [url: http://trl1th6m8k34j.trafford.ford.com:8889/forms/java/oracle/ewt/alert/resource/AlertBundle_en_GB.class, version: null]
    network: Connecting http://trl1th6m8k34j.trafford.ford.com:8889/forms/java/oracle/ewt/alert/resource/AlertBundle_en_GB.class with proxy=DIRECT
    network: Connecting http://trl1th6m8k34j.trafford.ford.com:8889/ with proxy=DIRECT
    network: Connecting http://trl1th6m8k34j.trafford.ford.com:8889/forms/java/oracle/ewt/alert/resource/AlertBundle_en_GB.class with cookie "AFRSOComplete2011=1; WSL-credential=TZGxuU2SPlkBAPIABHVzZXJpZD1tdmlub2QAaXBhZGRyPTE5LjE1MS4xNTQuODQAYWNpZ3JvdXA9Tk9OT1ZWTQBkZXB0PTUwMDFGODlENTQAb3JnY29kZT0/AGVtcGNvZGU9RgBtcnJvbGU9TgBvcmc9QVBBAGNvbXBhbnk9Rk9SRC5CVVNJTkVTUy5TRVJWSUNFUy4tLklORElBAGRpdmFiYnI9QVBBAHNpdGVjb2RlPTc1MjQAY2l0eT1DSEVOTkFJAHN0YXRlPT8AY291bnRyeT1JTkQAc3ViamVjdGlkPW12aW5vZEBmb3JkLmNvbQAAAENOPXdzbHY0LWludGVybmFsAKgKrgQwd9XHGJmWswb3374C3ITXa8zKKOrGTmAp81O3ud1qjAsiquyL112PSA7FPHknAfBpgpkpCWa5AA3+3Gy906j/qh6cna01esWGot27Tf6TXQEJvxKiY81H/Hhx8xGzApYE6iEFR1g6eUjvRP1QZJhgaJw6dPfFlrxJmF6q; Ford-WSL-MIG=TZGxuU2SPllwcm9mc3B3MkB3ZWJmYXJtLmRlYXJib3JuLmZvcmQuY29tAG12aW5vZAAxOS4xNTEuMTU0Ljg0AE5PTk9WVk0ANTAwMUY4OUQ1NAA/AEYATgBBUEEARk9SRC5CVVNJTkVTUy5TRVJWSUNFUy4tLklORElBAEFQQQA3NTI0AENIRU5OQUkAPwBJTkQATlVMTC5jZW50b2tzAACvVWxUpXzzdrT6KgM5tvDc1l3mGobUxj+eOvcIt2JL3LQOyr0rnYQV1oFVkPFd7GOBoUzqgqr0Zd4Ta7KXVLIj"
    network: Cache entry not found [url: http://trl1th6m8k34j.trafford.ford.com:8889/forms/java/oracle/ewt/alert/resource/AlertBundle_en_GB.properties, version: null]
    network: Connecting http://trl1th6m8k34j.trafford.ford.com:8889/forms/java/oracle/ewt/alert/resource/AlertBundle_en_GB.properties with proxy=DIRECT
    network: Connecting http://trl1th6m8k34j.trafford.ford.com:8889/forms/java/oracle/ewt/alert/resource/AlertBundle_en_GB.properties with cookie "AFRSOComplete2011=1; WSL-credential=TZGxuU2SPlkBAPIABHVzZXJpZD1tdmlub2QAaXBhZGRyPTE5LjE1MS4xNTQuODQAYWNpZ3JvdXA9Tk9OT1ZWTQBkZXB0PTUwMDFGODlENTQAb3JnY29kZT0/AGVtcGNvZGU9RgBtcnJvbGU9TgBvcmc9QVBBAGNvbXBhbnk9Rk9SRC5CVVNJTkVTUy5TRVJWSUNFUy4tLklORElBAGRpdmFiYnI9QVBBAHNpdGVjb2RlPTc1MjQAY2l0eT1DSEVOTkFJAHN0YXRlPT8AY291bnRyeT1JTkQAc3ViamVjdGlkPW12aW5vZEBmb3JkLmNvbQAAAENOPXdzbHY0LWludGVybmFsAKgKrgQwd9XHGJmWswb3374C3ITXa8zKKOrGTmAp81O3ud1qjAsiquyL112PSA7FPHknAfBpgpkpCWa5AA3+3Gy906j/qh6cna01esWGot27Tf6TXQEJvxKiY81H/Hhx8xGzApYE6iEFR1g6eUjvRP1QZJhgaJw6dPfFlrxJmF6q; Ford-WSL-MIG=TZGxuU2SPllwcm9mc3B3MkB3ZWJmYXJtLmRlYXJib3JuLmZvcmQuY29tAG12aW5vZAAxOS4xNTEuMTU0Ljg0AE5PTk9WVk0ANTAwMUY4OUQ1NAA/AEYATgBBUEEARk9SRC5CVVNJTkVTUy5TRVJWSUNFUy4tLklORElBAEFQQQA3NTI0AENIRU5OQUkAPwBJTkQATlVMTC5jZW50b2tzAACvVWxUpXzzdrT6KgM5tvDc1l3mGobUxj+eOvcIt2JL3LQOyr0rnYQV1oFVkPFd7GOBoUzqgqr0Zd4Ta7KXVLIj"
    network: Connecting http://trl1th6m8k34j.trafford.ford.com:8889/forms/lservlet;jsessionid=13979a5422b982f5c03763394a95824eb74a032e698e with proxy=DIRECT
    network: Connecting http://trl1th6m8k34j.trafford.ford.com:8889/forms/lservlet;jsessionid=13979a5422b982f5c03763394a95824eb74a032e698e with cookie "AFRSOComplete2011=1; WSL-credential=TZGxuU2SPlkBAPIABHVzZXJpZD1tdmlub2QAaXBhZGRyPTE5LjE1MS4xNTQuODQAYWNpZ3JvdXA9Tk9OT1ZWTQBkZXB0PTUwMDFGODlENTQAb3JnY29kZT0/AGVtcGNvZGU9RgBtcnJvbGU9TgBvcmc9QVBBAGNvbXBhbnk9Rk9SRC5CVVNJTkVTUy5TRVJWSUNFUy4tLklORElBAGRpdmFiYnI9QVBBAHNpdGVjb2RlPTc1MjQAY2l0eT1DSEVOTkFJAHN0YXRlPT8AY291bnRyeT1JTkQAc3ViamVjdGlkPW12aW5vZEBmb3JkLmNvbQAAAENOPXdzbHY0LWludGVybmFsAKgKrgQwd9XHGJmWswb3374C3ITXa8zKKOrGTmAp81O3ud1qjAsiquyL112PSA7FPHknAfBpgpkpCWa5AA3+3Gy906j/qh6cna01esWGot27Tf6TXQEJvxKiY81H/Hhx8xGzApYE6iEFR1g6eUjvRP1QZJhgaJw6dPfFlrxJmF6q; Ford-WSL-MIG=TZGxuU2SPllwcm9mc3B3MkB3ZWJmYXJtLmRlYXJib3JuLmZvcmQuY29tAG12aW5vZAAxOS4xNTEuMTU0Ljg0AE5PTk9WVk0ANTAwMUY4OUQ1NAA/AEYATgBBUEEARk9SRC5CVVNJTkVTUy5TRVJWSUNFUy4tLklORElBAEFQQQA3NTI0AENIRU5OQUkAPwBJTkQATlVMTC5jZW50b2tzAACvVWxUpXzzdrT6KgM5tvDc1l3mGobUxj+eOvcIt2JL3LQOyr0rnYQV1oFVkPFd7GOBoUzqgqr0Zd4Ta7KXVLIj"
    basic: Applet started
    basic: Told clients applet is started
    Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException
         at oracle.forms.fd.HandleMouseEvent2.handleComponent(HandleMouseEvent2.java:312)
         at oracle.forms.fd.HandleMouseEvent2.access$6000171(HandleMouseEvent2.java:39)
         at oracle.forms.fd.HandleMouseEvent2$2.mouseEntered(HandleMouseEvent2.java:139)
         at java.awt.AWTEventMulticaster.mouseEntered(Unknown Source)
         at java.awt.AWTEventMulticaster.mouseEntered(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider.processMouseGrabs(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp._redispatchEvent(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp._checkTarget(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp._checkTarget(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp.mouseEntered(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processEventImpl(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Proxy.processEventImpl(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.trackMouseEnterExit(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException
         at oracle.forms.fd.HandleMouseEvent2.handleComponent(HandleMouseEvent2.java:312)
         at oracle.forms.fd.HandleMouseEvent2.access$6000171(HandleMouseEvent2.java:39)
         at oracle.forms.fd.HandleMouseEvent2$2.mouseExited(HandleMouseEvent2.java:135)
         at java.awt.AWTEventMulticaster.mouseExited(Unknown Source)
         at java.awt.AWTEventMulticaster.mouseExited(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider.processMouseGrabs(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp._redispatchEvent(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp._redispatchEvent(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp._checkTarget(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp._checkTarget(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp.mouseExited(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processEventImpl(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Proxy.processEventImpl(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.trackMouseEnterExit(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)

    You need to initialize your array:
    double [][] expLevels = new double[10][10]; // whatever size.For an array of 'double', all values will be initialized to 0.
    It appears that the size of your array can't be known until runtime. You could maybe use an ArrayList of ArrayList of Double objects. Or, if you do know the size (if array_string will have a fixed format), you could use that size.

  • Null pointer Exception with Custom EventQueue

    I created a simple class customEventQueue which is extended from EventQueue class and pushed it using
    Toolkit.getDefaultToolkit().getSystemEventQueue().push(customEventQueue);
    Now, whenever there are three modal dialogs on top of a frame and if I click on top dialog that closes all three dialog boxes, I get nullpointer exception in console. The custom event class does not have any method in it. It just extends from EventQueue.
    I checked it in different JRE and it happens only in JRE1.3.1.
    Has anybody tried the same thing with custom event queue? Any help is most welcome. Thanks...
    java.lang.NullPointerException
    at sun.awt.windows.WInputMethod.dispatchEvent(Unknown Source)
    at sun.awt.im.InputContext.dispatchEvent(Unknown Source)
    at sun.awt.im.InputMethodContext.dispatchEvent(Unknown Source)

    Hi Chandel me having the same problem
    java.lang.NullPointerException
    at sun.awt.windows.WInputMethod.dispatchEvent(Unknown Source)
    at sun.awt.im.InputContext.dispatchEvent(Unknown Source)
    at sun.awt.im.InputMethodContext.dispatchEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown
    Source)
    at
    java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Sour
    ce)
    at
    java.awt.DefaultKeyboardFocusManager.pumpApprovedKeyEvents(Unknown So
    urce)
    at
    java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Sour
    ce)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown
    Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.SequencedEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
    Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
    Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Th bigger problem is that i don't know what is causing this exception, cause the stack trace doesn't mention the line of code where the exception occurred.
    In earlier version of java we had pData null pointer exception. This bug manifests when the pull down menu doesn't fit completely into the frame's bounds and swing has to create a seaprate window for the pull-down.
    The problem is that WInputMethod caches a reference to peer and that that reference becomes stale when peer is destroyed and recreated.
    In this bug cached peer reference becomes stale as the Window for the menu is hidden (and its peer is destroyed) and shown again (with new peer this time).
    WInputMethod have a cached reference to the old peer but that old peer is not connected to the underlying native window used to display the menu.
    But it's been fixed. I want to know if our problem is in some way related to this pData bug.
    Thanx.

  • Is there any significance to the thread "AWT-EventQueue-0"

    I just got an exception "java.lang.ArrayIndexOutOfBoundsException: 3" but It didn't give me any lines of code that it said the error was thrown. Its a long program, and I have no Idea where it is so I'll just post the exception:
    Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 3
         at javax.swing.plaf.basic.BasicListUI.updateLayoutState(Unknown Source)
         at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(Unknown Source)
         at javax.swing.plaf.basic.BasicListUI.getPreferredSize(Unknown Source)
         at javax.swing.JComponent.getPreferredSize(Unknown Source)
         at java.awt.FlowLayout.layoutContainer(Unknown Source)
         at java.awt.Container.layout(Unknown Source)
         at java.awt.Container.doLayout(Unknown Source)
         at java.awt.Container.validateTree(Unknown Source)
         at java.awt.Container.validateTree(Unknown Source)
         at java.awt.Container.validateTree(Unknown Source)
         at java.awt.Container.validateTree(Unknown Source)
         at java.awt.Container.validateTree(Unknown Source)
         at java.awt.Container.validate(Unknown Source)
         at javax.swing.RepaintManager.validateInvalidComponents(Unknown Source)
         at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
         at java.awt.event.InvocationEvent.dispatch(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)

    It seems you have added an swing object to your gui but you have not instantiated it before adding it.
    Make sure you use something like JButton jBtn = new JButton("click"); I mean using the keyword new before adding to the gui.
    There is also a chance that you use array of object and you missed to instantiate some of them before use
    JButton jBtnArray[] = new JButton[10];
    for (int i=0; i<10; i++){
        jBtnArray[i] = new JButton(String.valueOf(i));
    }You can also check if your actionlistener is added correctly.

Maybe you are looking for

  • Help mini wont play songs

    This is a new ipod mini i have and it will not play songs although the music is on there. Its not that sound doesnt work, i look at the ipod and the time doesnt change = doesnt play. Can someone please help me

  • Billing Documents Archiving

    Hello Folks, Could some one let me know about Billing Output Archiving? I want to know the concept of  archiving, and whats the transaction code to view the archieved outputs. Points rewarded. Regards, Krishna

  • Upgrade from CF 8 to CF 10 Enterprise or Standard?

    Trying to decide whether to go with CF10 Enterprise or Standard. If we were to develop our web applications using the additional features that only Enterprise provides and a client wants to host the site on their own server, would they have to be lic

  • Junk characters in Dropdown list

    Hi, I am using the following code to display the values in drop down. But at the end i am getting some junk charactes. like 1 2 3%$% or 5 6 1&^& It is nothing like 3 or 1 has some junk characters. But which ever value is in last, the junk characters

  • Unable to order prints from iPhoto online

    After I download photos from my camera to iPhoto and attempt to upload to Walgreens, Wal-Mart, Costco, etc., I receive an error indicating that the resolution is too low. I've recently converted over to the mac from PC and didn't have this problem be