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","");

Similar Messages

  • 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-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.

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

    I am receiving an exception error when launching ASDM. I have see on the web (and have experienced an issue similar to this before) where a reload resolves the issue. However, I did issue a reload and the error continues. Strange thing is, when I look at the uptime in SH TECH-SUPPORT it shows over a year . Now this firewall is on an active/passive cluster, so my question is, did the reload work on just one and the other took over and so a reload actually did not occur?
    We have an issue going on right now where it would be extremely helpful to have this console working.
    Thanks In Advance.
    JT                 
    Using JRE version 1.4.2 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\User
    c:   clear console window
    f:   finalize objects on finalization queue
    g:   garbage collect
    h:   display this help message
    m:   print memory usage
    q:   hide console
    s:   dump system properties
    ASDM Application Logging Started at Tue Apr 09 09:45:02 PDT 2013
    Local DM Launcher Version = 1.5.22
    Local DM Launcher Version Display = 1.5(22)
    OK button clicked
    Cache location = C:/Documents and Settings/User/.asdm/cache
    Checking the DM Launcher Version; url = https://10.1.1.1/admin/
    Server DM Version = 6.0(2)
    Server DM Launcher Version = 1.5.22, size = 318464 bytes
    DM Launcher version checking is successful.
    invoking SGZ Loader..
    java.lang.NumberFormatException: For input string: "1 year 16"
    at java.lang.NumberFormatException.forInputString(Unknown Source)
    at java.lang.Integer.parseInt(Unknown Source)
    at java.lang.Integer.parseInt(Unknown Source)
    at com.cisco.pdm.Check.h(DashoA10*..:1339)
    at com.cisco.pdm.Check.c(DashoA10*..:842)
    at com.cisco.pdm.Check.a(DashoA10*..:442)
    at com.cisco.pdm.Check.<init>(DashoA10*..:221)
    at com.cisco.pdm.PDMApplet.start(DashoA10*..:124)
    at com.cisco.nm.dice.loader.r.run(DashoA19*..:410)

    Hello Jason,
    It could actually be that you reloaded the primary ASA and you are now looking at the secondary(now active) ASA.
    do a "show version" and  "fail exec mate sho ver" to see the up time for both active and standby ASAs.
    You can also try switching to the primary (now standby ASA) using the command "no failover active" and try to access the ASDM again.
    Regards,
    Felipe

  • 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.

  • Make "Thread [AWT-EventQueue-0]" daemon.

    The program exits gracefully on jdk1.4.1.
    But it will hang up on jdk1.3.1.
    It is a bug of Jdk 1.3.1??
    import java.awt.GridBagConstraints;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    * @author vivid
    * To change this generated comment edit the template variable "typecomment":
    * Window>Preferences>Java>Templates.
    * To enable and disable the creation of type comments go to
    * Window>Preferences>Java>Code Generation.
    public class SwingTest extends JPanel implements Runnable {
         JFrame frame = null;
         Thread guiLoadThread = null;
         private javax.swing.JLabel jLabel = null;
         private javax.swing.JTextField jTextField = null;
         private javax.swing.JLabel jLabel1 = null;
         private javax.swing.JTextField jTextField1 = null;
         private javax.swing.JButton jButton = null;
         * This method initializes
         public SwingTest() {
              super();
              initialize();
         public void run() {
              frame = new JFrame();
              frame.setTitle("Test Frame");
              frame.getContentPane().add(this);
              frame.addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent event) {
                        frame.dispose();
                        guiLoadThread.interrupt();
              frame.pack();
              frame.show();
              try {
                   guiLoadThread.join();
              } catch (InterruptedException e) {
         * This method initializes this
         * @return void
         private void initialize() {
              GridBagConstraints consGridBagConstraints2 =
                   new java.awt.GridBagConstraints();
              java.awt.GridBagLayout layGridBagLayout1 = new java.awt.GridBagLayout();
              java.awt.GridBagConstraints consGridBagConstraints5 =
                   new java.awt.GridBagConstraints();
              java.awt.GridBagConstraints consGridBagConstraints10 =
                   new java.awt.GridBagConstraints();
              java.awt.GridBagConstraints consGridBagConstraints12 =
                   new java.awt.GridBagConstraints();
              java.awt.GridBagConstraints consGridBagConstraints11 =
                   new java.awt.GridBagConstraints();
              consGridBagConstraints11.weightx = 1.0;
              consGridBagConstraints11.fill = 2;
              consGridBagConstraints10.gridx = 0;
              consGridBagConstraints5.weightx = 1.0;
              consGridBagConstraints5.fill = 2;
              consGridBagConstraints5.gridx = 1;
              consGridBagConstraints5.gridy = 0;
              consGridBagConstraints5.insets = new java.awt.Insets(5, 0, 0, 5);
              consGridBagConstraints10.gridy = 1;
              consGridBagConstraints10.anchor = java.awt.GridBagConstraints.EAST;
              consGridBagConstraints10.insets = new java.awt.Insets(5, 5, 5, 0);
              consGridBagConstraints12.gridx = 1;
              consGridBagConstraints12.gridy = 2;
              consGridBagConstraints12.ipadx = 0;
              consGridBagConstraints12.insets = new java.awt.Insets(0, -40, 0, 0);
              consGridBagConstraints2.gridx = 0;
              consGridBagConstraints2.gridy = 0;
              consGridBagConstraints2.anchor = java.awt.GridBagConstraints.EAST;
              consGridBagConstraints2.insets = new java.awt.Insets(5, 5, 0, 0);
              consGridBagConstraints11.gridx = 1;
              consGridBagConstraints11.gridy = 1;
              consGridBagConstraints11.insets = new java.awt.Insets(5, 0, 5, 5);
              this.setLayout(layGridBagLayout1);
              this.add(getJLabel(), consGridBagConstraints2);
              this.add(getJTextField(), consGridBagConstraints5);
              this.add(getJLabel1(), consGridBagConstraints10);
              this.add(getJTextField1(), consGridBagConstraints11);
              this.add(getJButton(), consGridBagConstraints12);
              this.setSize(358, 196);
         * This method initializes jLabel
         * @return javax.swing.JLabel
         private javax.swing.JLabel getJLabel() {
              if (jLabel == null) {
                   jLabel = new javax.swing.JLabel();
                   jLabel.setText("Name: ");
              return jLabel;
         * This method initializes jTextField
         * @return javax.swing.JTextField
         private javax.swing.JTextField getJTextField() {
              if (jTextField == null) {
                   jTextField = new javax.swing.JTextField();
              return jTextField;
         * This method initializes jLabel1
         * @return javax.swing.JLabel
         private javax.swing.JLabel getJLabel1() {
              if (jLabel1 == null) {
                   jLabel1 = new javax.swing.JLabel();
                   jLabel1.setText("Password: ");
              return jLabel1;
         * This method initializes jTextField1
         * @return javax.swing.JTextField
         private javax.swing.JTextField getJTextField1() {
              if (jTextField1 == null) {
                   jTextField1 = new javax.swing.JTextField();
              return jTextField1;
         * This method initializes jButton
         * @return javax.swing.JButton
         private javax.swing.JButton getJButton() {
              if (jButton == null) {
                   jButton = new javax.swing.JButton();
                   jButton.setText("Login");
              return jButton;
         public static void main(String[] args) {
              SwingTest test = new SwingTest();
              test.guiLoadThread = new Thread(test, "GUI Daemon Loader");
              test.guiLoadThread.setDaemon(true);
              test.guiLoadThread.start();
              try {
                   test.guiLoadThread.join();
              } catch (InterruptedException e) {
    } // @jve:visual-info decl-index=0 visual-constraint="0,0"

    I am sorry for my laziness, but I like your style really.
    In a typical Java graphical app where the AWT (Abstract Windowing Toolkit) is involved, the program almost always calls System.exit() to terminate the program.
    I can make EventQueue Thread to be daemon if I create AWT/Swing component within daemon threads.
    The program run gracefully upon JRE 1.4.1, jvm will terminate normally after I close the window.
    But as for JRE 1.3.1, jvm will keep running after the window is closed.
    I am wondering whether this a bug.
    import java.awt.Dimension;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class SwingTest extends JPanel implements Runnable {
         JFrame frame = null;
         Thread guiLoadThread = null;
         public SwingTest() {
              super();
              initialize();
         public void run() {//All swing components are created here
              frame = new JFrame();
              frame.setTitle("Test Frame");
              frame.getContentPane().add(this);
              frame.addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent event) {
                        frame.dispose();
                        guiLoadThread.interrupt();
              frame.pack();
              frame.show();
              try {
                   guiLoadThread.join(); //wait itself to be interrupted
              } catch (InterruptedException e) {
         private void initialize() {
              this.setPreferredSize(new Dimension(358, 196));
         public static void main(String[] args) {
              SwingTest test = new SwingTest();
              test.guiLoadThread = new Thread(test, "GUI Daemon Loader");
              //Set the GUI Loader Thread to be Daemon
              test.guiLoadThread.setDaemon(true);
              test.guiLoadThread.start();
              try {
                   test.guiLoadThread.join();//wait GUI Loader to be interrupted
              } catch (InterruptedException e) {

  • Exception in thread "AWT-Event Queue 0" Mem Out of Bounds. Java Heap Space

    Hello,
    I'm not sure how to resolve this Java Heap Space Memory Out of Bounds error. Could someone please assist me with this error?
    A SCENARIO:
    I am reading in tons of data from 5 separate text files. The files have tons of rows (up to 64,220 in one). The data must be read into the program and assembled. When I have all of the files populated, I receive the OOM Error. If I remove the data from one of the 5 files the program runs successfully. If I add the data back into the file and then remove the data from some other file, the program runs successfully.
    Thanks
    RodneyM

    ff.skip(18);
    i = ff.read();
    i = ((ff.read() << 8) | i);
    i = ((ff.read() << 16) | i);
    i = ((ff.read() << 24) | i);
    xsize = i;
    System.out.println("width=" + xsize);
    i = 0;
    i = ff.read();
    i = ((ff.read() << 8) | i);
    i = ((ff.read() << 16) | i);
    i = ((ff.read() << 24) | i);
    ysize = i;
    System.out.println("Height=" + ysize);
    ff.skip(38);//62-(2+16+4+4=26)=36, actually total=62 Bytes header This is completely wrong. First an foremost you should not have this code in the paint(Graphics g) method. This is a GUI thing. The paint method may be called for any reason and you do not+ want to open a file stream, read it, and do the distance transformation every single time the method is called. There's also the issue that you have overridden the paint method as opposed to subclassing a component, overriding the paintComponent method, and adding it to the frame. But that can be ignored for right now (it will come back later and cause complications).
    Next, you've said that the header is 62 bytes. This is incorrect for a png file. The code you have posted assumes (very specifically) that you have inputted a BMP version 3 with 2-color entry palette. In other words you can only open a very specific type of image with that code. Definitely not a png. This is what was causing the out of memory error since it interprets the width and height wrong when reading the bytes and you end up trying to create a 2-D int array that will take up several hundred megabytes in size
    //xsize and ysize are interpreted wrongly
    pix=new int[xsize][ysize];
    mat1=new int[xsize][ysize]; Now granted, BMP v3 is the most common type you will encounter but you must admit that the code is not very robust at all (since it requires a very specific input).

  • 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-&#99;um-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-&#99;um-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.

  • 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

Maybe you are looking for

  • How to see the output of a FORM of REMITTANCE ADVICE ( PAYMENT ADVICE )??

    Hi Experts, I got a SAP Script of REMITTANCE ADVICE (also known as PAYMENT ADVICE). And I know the VENDOR #. I need to see the output of this SAP Script on the screen, so, let me know that, How to test it/see its output. (I know, seeing the Customer

  • Music load as ACC to 6233

    I've load Music as ACC's with PC-Suite (6.81) and Nokia Music Manager (V1.0) to my Handy. They are organized as an Musiclist in the Nokia Music Manager. After all clips are loaded to the Handy the Names of the clips appear in the Musicplayer of the h

  • What software should I leed to open attachments with format pps and wmv Thanks Jorge 07

    I Pad

  • VoiceOver - Better Voice?

    Is there any way to buy and load a better VoiceOver voice? The one on the iPad is pretty bad I have had better ones on my computers for over 10 years now. I would really appreciate having a decent voice and am more then willing to pay for it. Taking

  • Shape tween doesn't repeat..

    I created some blinking eyes last night with shape tweening.  I'm been working on a mouth and I got it to make the mouth open but unlike the blinking eyes  the mouth just stays open stays open.  Can someone gude me to what I may have done wrong in th