Why the nullpointer exception

I have a login screen where when i put information into the username and password field and then press login it calls the method below sendLogin(), but when I do so I get a nullpointer exception on the first patient.setUsername. I do get the println of what was entered into the txt fields. The txtFldUsername is a jtxtfield, and I have put information into it, yet it doesn't seem to be accepting it.
here is the error lines i have
username = hello
password = world
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at mmsi.loginScreen.sendLogin(loginScreen.java:217)
at mmsi.loginScreen.btnLoginActionPerformed(loginScreen.java:165)
at mmsi.loginScreen.access$000(loginScreen.java:16)
at mmsi.loginScreen$1.actionPerformed(loginScreen.java:67)
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)
also, when i put no information in, the program hangs, and i get no output.
public void sendLogin(){
        if (txtFldUsername.getText().trim().equals("") || pswrdFldPassword.getText().trim().equals("")){
            JOptionPane.showMessageDialog(null,"Complete empty field(s)","Warning",JOptionPane.WARNING_MESSAGE);
        } else {
           System.out.println("username = " + txtFldUsername.getText());
           System.out.println("password = " + pswrdFldPassword.getText());
            patient.setUsername(txtFldUsername.getText().trim());
            patient.setPassword(pswrdFldPassword.getText().trim());
            patient.setAction("login");
            trans.sendPatient(objOut, patient);
    }

patient.setUsername(txtFldUsername.getText().trim());
sorry didn't note it very well in my description

Similar Messages

  • Why the NullPointer on a method call?

    Can anybody tell me why it's throwing a NullPointerException when it attempts to call MyTableModel.valueChanged(...) during construction?
    package scratch;
    import javax.swing.JTable;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.event.ListSelectionEvent;
    public class Scratch extends Base
      void test()
        baseCall();
        MyTableModel m = new MyTableModel();
    //    m.addRow(new Object[] { "monkey", "dude", "har" });
        MyTable mt = new MyTable(m);
      public static void main(String[] args) {
        new Scratch().test();
      class MyTable extends JTable
        public MyTable(MyTableModel m)
          super(m);
        public void valueChanged(ListSelectionEvent e)
          baseCall();
      class MyTableModel extends DefaultTableModel
    class Base {
      public void baseCall()
        System.out.println("baseCall()");
    }Thanks

    Answer:
    The value for Scratch.this isn't assigned until just before the constructor for MyTable returns.

  • JUTreeNodeBinding question (nullpointer exception in getAttribute)

    Hi,
    I've got a question about a piece of code. I've used a JTree which displays a recursive tree, which is working fine. I want to do something when a node is selected. I have the following piece of code:
    jTree1.addTreeSelectionListener(
       new TreeSelectionListener()
         public void valueChanged(TreeSelectionEvent e)
           DefaultMutableTreeNode node = (DefaultMutableTreeNode)jTree1.getLastSelectedPathComponent();
           if (node != null)
             JUTreeNodeBinding tnb = (JUTreeNodeBinding)(node.getUserObject());
             if (tnb!=null)
       });this code is taken from some example I've read on this forum and slightly modified (I can't find the original posting).
    Now, according to the sourcecompletion feature, tnb has methods like getAttribute, getAttributeDef. But when I call one of these methods on tnb (where the '...' is in the example above), I always get a nullpointer exception , somewhere inside the getAttribute call. (the variable 'tnb' itself is not null)
    Why wouldn't this work? Shouldn't the getAttribute calls give me access to the attributes of the row from the view that corresponds the selected element?
    The logwindow shows this for the nullpointer exception:
    Exception occurred during event dispatching:
    java.lang.NullPointerException
         oracle.jbo.AttributeDef[] oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeDefs()
              JUCtrlValueBinding.java:173
         oracle.jbo.AttributeDef oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeDef(int)
              JUCtrlValueBinding.java:239
         void mypackage.PMyData$1.valueChanged(javax.swing.event.TreeSelectionEvent)
              PMyData.java:332
         void javax.swing.JTree.fireValueChanged(javax.swing.event.TreeSelectionEvent)
              JTree.java:2269
         void javax.swing.JTree$TreeSelectionRedirector.valueChanged(javax.swing.event.TreeSelectionEvent)
              JTree.java:2575
         void javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(javax.swing.event.TreeSelectionEvent)
              DefaultTreeSelectionModel.java:612
         void javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(java.util.Vector, javax.swing.tree.TreePath)
              DefaultTreeSelectionModel.java:1006
         void javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(javax.swing.tree.TreePath[])
              DefaultTreeSelectionModel.java:288
         void javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(javax.swing.tree.TreePath)
              DefaultTreeSelectionModel.java:171
         void javax.swing.JTree.setSelectionPath(javax.swing.tree.TreePath)
              JTree.java:1088
         void javax.swing.plaf.basic.BasicTreeUI.selectPathForEvent(javax.swing.tree.TreePath, java.awt.event.MouseEvent)
              BasicTreeUI.java:2117
         void javax.swing.plaf.basic.BasicTreeUI$MouseHandler.mousePressed(java.awt.event.MouseEvent)
              BasicTreeUI.java:2683
         void java.awt.Component.processMouseEvent(java.awt.event.MouseEvent)
              Component.java:3712
         void java.awt.Component.processEvent(java.awt.AWTEvent)
              Component.java:3544
         void java.awt.Container.processEvent(java.awt.AWTEvent)
              Container.java:1164
         void java.awt.Component.dispatchEventImpl(java.awt.AWTEvent)
              Component.java:2593
         void java.awt.Container.dispatchEventImpl(java.awt.AWTEvent)
              Container.java:1213
         void java.awt.Component.dispatchEvent(java.awt.AWTEvent)
              Component.java:2497
         void java.awt.LightweightDispatcher.retargetMouseEvent(java.awt.Component, int, java.awt.event.MouseEvent)
              Container.java:2451
         boolean java.awt.LightweightDispatcher.processMouseEvent(java.awt.event.MouseEvent)
              Container.java:2210
         boolean java.awt.LightweightDispatcher.dispatchEvent(java.awt.AWTEvent)
              Container.java:2125
         void java.awt.Container.dispatchEventImpl(java.awt.AWTEvent)
              Container.java:1200
         void java.awt.Window.dispatchEventImpl(java.awt.AWTEvent)
              Window.java:926
         void java.awt.Component.dispatchEvent(java.awt.AWTEvent)
              Component.java:2497
         void java.awt.EventQueue.dispatchEvent(java.awt.AWTEvent)
              EventQueue.java:339
         boolean java.awt.EventDispatchThread.pumpOneEventForHierarchy(java.awt.Component)
              EventDispatchThread.java:131
         void java.awt.EventDispatchThread.pumpEventsForHierarchy(java.awt.Conditional, java.awt.Component)
              EventDispatchThread.java:98
         void java.awt.EventDispatchThread.pumpEvents(java.awt.Conditional)
              EventDispatchThread.java:93
         void java.awt.EventDispatchThread.run()
              EventDispatchThread.java:85

    Bit of a coincidence.. I was just running into the same problem. But if you check getAttributeDefs(), you'll see that there only is one attribute available, namely the one that is being displayed in the tree. (the 'description'-attribute)
    Or at least, that's the case with my sitation.
    I would love to be able to address all available attributes, eg. foreign key fields, but that doesn't seem possible.
    At the moment, I'm using the following work-around, which of course is far from ideal:
    Key key = tnb.getRowKey();
    ViewObject vo = panelBinding.getApplicationModule().findViewObject("SomeVO");
    Row[] rows = vo.findByKey(key);
    if (rows == null || rows.length != 1)
      System.out.println("Notice: not 1 rows");
      return;
    Row row = rows[0];
    // now you can fetch all the attributes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Java.lang.NullPointer exception and operating systems

    Do different operating systems handle the NullPointer exception differently? I have an application that has a screen come up when you click a button. However, the app attempts to process some data before bring up the screen. Sometimes the data is null. The application works fine on linux red hat. However, the screen does not come up on HP Unix. I am not looking to fix the code (even though it may need fixed), but I am looking for an explanation why app works differently in this regard.

    Do different operating systems handle the NullPointer
    exception differently? Nope.
    My guess is that the different OSes have different threading models. In one case X amount of work gets done in the non-GUI thread before the GUI thread tries to do its thing. In the other OS, X+1 amount of work gets done, leading to different states for the GUIs to act on. This is almost certainly a bug in your app.

  • NullPointer Exception in  SetCharacterEncodingFilter

    Hi All..!
    Can any one help me out in Fixing the Nullpointer Exception raised from SetCharacterEncodingFilter class which was taken by me from the Tomact ServletExamples. What should be the reason for this exception ? and how to fix this problem. Thanks in Advance to all the Gurus..!
    Please find the Stacktrace of the generated Exception
    java.lang.NullPointerException
    at org.apache.jsp.welcome_jsp._jspService(welcome_jsp.java:65)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at MalikJspPackages.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:81)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
    at java.lang.Thread.run(Thread.java:595)
    NotifyUtil::java.net.SocketException: Software caused connection abort: recv failed
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:313)
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:606)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:554)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:571)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:928)
    at org.netbeans.modules.web.monitor.server.NotifyUtil$RecordSender.run(NotifyUtil.java:248)

    Look up the createImage(int width, int height) method in the Component api abd follow the link to its description in the Method Detail section. Note that this method will return null if the component is not displayable. Try placing your inspection code after the call to setVisible.

  • CLOB.createTemporary gives Nullpointer Exception

    Hello,
    I'm trying to create a temporary clob in my java code, but when I run the program I get the following exception.
    java.lang.NullPointerException
         at oracle.sql.LobPlsqlUtil.plsql_createTemporaryLob(LobPlsqlUtil.java:1354)
         at oracle.jdbc.dbaccess.DBAccess.createTemporaryLob(DBAccess.java:997)
         at oracle.sql.LobDBAccessImpl.createTemporaryClob(LobDBAccessImpl.java:240)
         at oracle.sql.CLOB.createTemporary(CLOB.java:527)
         at org.tennet.utils.bc4j.ApplicationModuleImpl.createClob(ApplicationModuleImpl.java:278)
         at org.tennet.utils.bc4j.ApplicationModuleImpl.createClobDomain(ApplicationModuleImpl.java:299)
         at org.tennet.nevada.loader.ResultLoader.executeProcedure(ResultLoader.java:243)
         at org.tennet.nevada.loader.ResultLoader.process(ResultLoader.java:77)
         at org.tennet.nevada.broker.processor.RequestProcessor.processResult(RequestProcessor.java:374)
         at org.tennet.nevada.broker.processor.LoadFlowVAProcessor.process(LoadFlowVAProcessor.java:132)
         at org.tennet.nevada.broker.RequestHandler.processRequest(RequestHandler.java:289)
         at org.tennet.nevada.broker.RequestHandler.run(RequestHandler.java:137)
    This error started when I began using Data Sources instate of direct JDBC Connections.
    The problem is there is no source available for this class so I can’t look what is causing the Nullpointer Exception.
    Can someone tell me what is causing this problem?
    Regards,
    Dennis Labordus

    Hi Dennis,
    I have had the same problem as this. I am going to get onto Oracle via Metalink about it.
    However - there is a work around.
    We are using OC4J with its data sources.
    There is a method on the OC4J Connection called getCoreConnection(Connection). This returns the underlying Oracle connection.
    If you then pass this underlying oracle connection to CLOB.createTemporary() it works.
    We had to use reflection to call the method as I couldn't seem to cast it statically.
    Paul McHugh
    * getOracleConnection
    * Derive oracle connection from DataSource connection
    private static OracleConnection getOracleConnection (Connection connection) throws SQLException
    System.err.println ("UserTypeImpl.getOracleConnection: " + connection);
    * Check for an existing oracle connection
    * This should be the case in a database deployment
    if (connection instanceof oracle.jdbc.driver.OracleConnection)
    System.err.println (" Connection is already the base Oracle Connection" + connection);
    return (OracleConnection) connection;
    * Check for an OC4J deployment
    else
    System.err.println (" Searching for core connection ...");
    Object conObj = (Object) connection;
    Class conclass = conObj.getClass();
    OracleConnection coreCon = null;
    Method meth = null;
    // Locate method getCoreConnection on Orion data source
    try {
    Class[] parameterTypes = new Class[] {java.sql.Connection.class};
    meth = conclass.getMethod("getCoreConnection", parameterTypes);
    } catch (NoSuchMethodException e)
    e.printStackTrace();
    throw new SQLException ("UserTypeImpl.getOracleConnection: No such method: getCoreConnection: " + e);
    // Invoke method getCoreConnection on orion data source
    try {
    Object[] args = new Object[] {connection};
    coreCon = (OracleConnection) meth.invoke(conObj, args);
    catch (InvocationTargetException e)
    e.printStackTrace();
    throw new SQLException ("UserTypeImpl.getOracleConnection: Invoke: getCoreConnection: " + e);
    catch (IllegalAccessException e)
    e.printStackTrace();
    throw new SQLException ("UserTypeImpl.getOracleConnection: Invoke: getCoreConnection: " + e);
    if (coreCon != null)
    System.err.println (" Core connection found: " + coreCon);
    return coreCon;
    } else
    System.err.println (" Unable to locate core connection.");
    throw new SQLException ("UserTypeImpl.getOracleConnection: Unable to locate core oracle connection.");

  • NullPointer Exception on Selecting Table

    I get this exception now whenever I select (left-click) a table from my tree to open a sheet showing the column names, data, etc.
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at oracle.javatools.dialogs.progress.AbstractProgressMonitor.createDialog(AbstractProgressMonitor.java:358)
            at oracle.javatools.dialogs.progress.AbstractProgressMonitor.mav$createDialog(AbstractProgressMonitor.java:39)
            at oracle.javatools.dialogs.progress.AbstractProgressMonitor$1.run(AbstractProgressMonitor.java:325)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
            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)Any ideas?
    -Tim

    Just to add to the problems :)
    Noticed that SQL Dev hangs a while when I am trying to select a table to view from the tree... so I did a stack dump. The NullPointer Exception from the OP shows up at the end as well...
    "Background Parser" prio=6 tid=0x2eb91000 nid=0x1cd4 waiting on condition [0x3314f000..0x3314fa14]
       java.lang.Thread.State: TIMED_WAITING (sleeping)
            at java.lang.Thread.sleep(Native Method)
            at oracle.dbtools.raptor.plsql.BackgroundParser$1.construct(BackgroundParser.java:124)
            at oracle.dbtools.raptor.utils.NamedSwingWorker$2.run(NamedSwingWorker.java:115)
            at java.lang.Thread.run(Thread.java:619)
    "Background Parser" prio=6 tid=0x31172400 nid=0x1b1c waiting on condition [0x32e4f000..0x32e4fc14]
       java.lang.Thread.State: TIMED_WAITING (sleeping)
            at java.lang.Thread.sleep(Native Method)
            at oracle.dbtools.raptor.plsql.BackgroundParser$1.construct(BackgroundParser.java:124)
            at oracle.dbtools.raptor.utils.NamedSwingWorker$2.run(NamedSwingWorker.java:115)
            at java.lang.Thread.run(Thread.java:619)
    "Background Parser" prio=6 tid=0x2eb86c00 nid=0x194c waiting on condition [0x32d4f000..0x32d4fc14]
       java.lang.Thread.State: TIMED_WAITING (sleeping)
            at java.lang.Thread.sleep(Native Method)
            at oracle.dbtools.raptor.plsql.BackgroundParser$1.construct(BackgroundParser.java:124)
            at oracle.dbtools.raptor.utils.NamedSwingWorker$2.run(NamedSwingWorker.java:115)
            at java.lang.Thread.run(Thread.java:619)
    "Background Parser" prio=6 tid=0x2eb7f400 nid=0x14e0 waiting on condition [0x32c4f000..0x32c4fd94]
       java.lang.Thread.State: TIMED_WAITING (sleeping)
            at java.lang.Thread.sleep(Native Method)
            at oracle.dbtools.raptor.plsql.BackgroundParser$1.construct(BackgroundParser.java:124)
            at oracle.dbtools.raptor.utils.NamedSwingWorker$2.run(NamedSwingWorker.java:115)
            at java.lang.Thread.run(Thread.java:619)
    "Background Parser" prio=6 tid=0x2eb85400 nid=0x19a8 waiting on condition [0x32b4f000..0x32b4fc94]
       java.lang.Thread.State: TIMED_WAITING (sleeping)
            at java.lang.Thread.sleep(Native Method)
            at oracle.dbtools.raptor.plsql.BackgroundParser$1.construct(BackgroundParser.java:124)
            at oracle.dbtools.raptor.utils.NamedSwingWorker$2.run(NamedSwingWorker.java:115)
            at java.lang.Thread.run(Thread.java:619)
    "Background Parser" prio=6 tid=0x2eb7d800 nid=0xf04 waiting on condition [0x3244f000..0x3244fb14]
       java.lang.Thread.State: TIMED_WAITING (sleeping)
            at java.lang.Thread.sleep(Native Method)
            at oracle.dbtools.raptor.plsql.BackgroundParser$1.construct(BackgroundParser.java:124)
            at oracle.dbtools.raptor.utils.NamedSwingWorker$2.run(NamedSwingWorker.java:115)
            at java.lang.Thread.run(Thread.java:619)
    "Background Parser" prio=6 tid=0x2eb7a800 nid=0x1fb8 waiting on condition [0x32a4f000..0x32a4fc94]
       java.lang.Thread.State: TIMED_WAITING (sleeping)
            at java.lang.Thread.sleep(Native Method)
            at oracle.dbtools.raptor.plsql.BackgroundParser$1.construct(BackgroundParser.java:124)
            at oracle.dbtools.raptor.utils.NamedSwingWorker$2.run(NamedSwingWorker.java:115)
            at java.lang.Thread.run(Thread.java:619)
    "Background Parser" prio=6 tid=0x2ec1e400 nid=0x2dc waiting on condition [0x3294f000..0x3294fd94]
       java.lang.Thread.State: TIMED_WAITING (sleeping)
            at java.lang.Thread.sleep(Native Method)
            at oracle.dbtools.raptor.plsql.BackgroundParser$1.construct(BackgroundParser.java:124)
            at oracle.dbtools.raptor.utils.NamedSwingWorker$2.run(NamedSwingWorker.java:115)
            at java.lang.Thread.run(Thread.java:619)
    "Background Parser" prio=6 tid=0x31247c00 nid=0x410 waiting on condition [0x3284f000..0x3284fa14]
       java.lang.Thread.State: TIMED_WAITING (sleeping)
            at java.lang.Thread.sleep(Native Method)
            at oracle.dbtools.raptor.plsql.BackgroundParser$1.construct(BackgroundParser.java:124)
            at oracle.dbtools.raptor.utils.NamedSwingWorker$2.run(NamedSwingWorker.java:115)
            at java.lang.Thread.run(Thread.java:619)
    "Background Parser" prio=6 tid=0x2ec47400 nid=0x116c waiting on condition [0x3274f000..0x3274fb94]
       java.lang.Thread.State: TIMED_WAITING (sleeping)
            at java.lang.Thread.sleep(Native Method)
            at oracle.dbtools.raptor.plsql.BackgroundParser$1.construct(BackgroundParser.java:124)
            at oracle.dbtools.raptor.utils.NamedSwingWorker$2.run(NamedSwingWorker.java:115)
            at java.lang.Thread.run(Thread.java:619)
    "Background Parser" prio=6 tid=0x2ead8800 nid=0x113c waiting on condition [0x3264f000..0x3264fb94]
       java.lang.Thread.State: TIMED_WAITING (sleeping)
            at java.lang.Thread.sleep(Native Method)
            at oracle.dbtools.raptor.plsql.BackgroundParser$1.construct(BackgroundParser.java:124)
            at oracle.dbtools.raptor.utils.NamedSwingWorker$2.run(NamedSwingWorker.java:115)
            at java.lang.Thread.run(Thread.java:619)
    "Background Parser" prio=6 tid=0x2eaeec00 nid=0x334 waiting on condition [0x2ff6f000..0x2ff6fb14]
       java.lang.Thread.State: TIMED_WAITING (sleeping)
            at java.lang.Thread.sleep(Native Method)
            at oracle.dbtools.raptor.plsql.BackgroundParser$1.construct(BackgroundParser.java:124)
            at oracle.dbtools.raptor.utils.NamedSwingWorker$2.run(NamedSwingWorker.java:115)
            at java.lang.Thread.run(Thread.java:619)
    "Background Parser" prio=6 tid=0x2ec78c00 nid=0x1230 waiting on condition [0x2f12f000..0x2f12fc14]
       java.lang.Thread.State: TIMED_WAITING (sleeping)
            at java.lang.Thread.sleep(Native Method)
            at oracle.dbtools.raptor.plsql.BackgroundParser$1.construct(BackgroundParser.java:124)
            at oracle.dbtools.raptor.utils.NamedSwingWorker$2.run(NamedSwingWorker.java:115)
            at java.lang.Thread.run(Thread.java:619)
    "WeakDataReference polling" prio=2 tid=0x2e98e000 nid=0x149c in Object.wait() [0x3234f000..0x3234fa94]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
            - locked <0x082c4b08> (a java.lang.ref.ReferenceQueue$Lock)
            at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
            at oracle.ide.util.WeakDataReference$Cleaner.run(WeakDataReference.java:88)
            at java.lang.Thread.run(Thread.java:619)
    "Background Parser" prio=6 tid=0x2e97d400 nid=0x1128 waiting on condition [0x3036f000..0x3036fb14]
       java.lang.Thread.State: TIMED_WAITING (sleeping)
            at java.lang.Thread.sleep(Native Method)
            at oracle.dbtools.raptor.plsql.BackgroundParser$1.construct(BackgroundParser.java:124)
            at oracle.dbtools.raptor.utils.NamedSwingWorker$2.run(NamedSwingWorker.java:115)
            at java.lang.Thread.run(Thread.java:619)
    "pool-2-thread-1" prio=6 tid=0x2e970000 nid=0x12d8 waiting on condition [0x3224f000..0x3224fc94]
       java.lang.Thread.State: WAITING (parking)
            at sun.misc.Unsafe.park(Native Method)
            - parking to wait for  <0x069b6a28> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
            at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
            at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
            at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358)
            at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:946)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:906)
            at java.lang.Thread.run(Thread.java:619)
    "IconOverlayTracker Timer" prio=6 tid=0x2e99f400 nid=0x12d4 in Object.wait() [0x30f4f000..0x30f4fd14]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            at java.lang.Object.wait(Object.java:485)
            at java.util.TimerThread.mainLoop(Timer.java:483)
            - locked <0x069b6b60> (a java.util.TaskQueue)
            at java.util.TimerThread.run(Timer.java:462)
    "Timer-2" prio=6 tid=0x2eabe800 nid=0x12b8 in Object.wait() [0x3104f000..0x3104fa94]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            at java.lang.Object.wait(Object.java:485)
            at java.util.TimerThread.mainLoop(Timer.java:483)
            - locked <0x0691d3d8> (a java.util.TaskQueue)
            at java.util.TimerThread.run(Timer.java:462)
    "Timer queue for AWT thread" daemon prio=6 tid=0x2ea57000 nid=0x1278 in Object.wait() [0x30e4f000..0x30e4fb94]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            - waiting on <0x0691d458> (a java.lang.Object)
            at java.lang.Object.wait(Object.java:485)
            at ice.util.awt.TimedAWTExecutor.nextElem(TimedAWTExecutor.java:108)
            - locked <0x0691d458> (a java.lang.Object)
            at ice.util.awt.TimedAWTExecutor.runScheduler(TimedAWTExecutor.java:130)
            at ice.util.awt.TimedAWTExecutor$1.run(TimedAWTExecutor.java:19)
    "TextBufferScavenger" prio=6 tid=0x2e6cac00 nid=0x1190 in Object.wait() [0x30d4f000..0x30d4fc14]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
            - locked <0x0683df28> (a java.lang.ref.ReferenceQueue$Lock)
            at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
            at oracle.ide.model.TextNode$FacadeBufferReference$PollingThread.run(TextNode.java:1886)
    "Native Directory Watcher" prio=2 tid=0x2d8e4400 nid=0x6ac runnable [0x30b4f000..0x30b4fd14]
       java.lang.Thread.State: RUNNABLE
            at oracle.ide.natives.NativeHandler.enterWatcherThread(Native Method)
            at oracle.ide.natives.NativeHandler$2.run(NativeHandler.java:252)
            at java.lang.Thread.run(Thread.java:619)
    "Swing-Shell" daemon prio=6 tid=0x2e870000 nid=0xd20 waiting on condition [0x3077f000..0x3077fd94]
       java.lang.Thread.State: WAITING (parking)
            at sun.misc.Unsafe.park(Native Method)
            - parking to wait for  <0x06046f08> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
            at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
            at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
            at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358)
            at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:946)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:906)
            at sun.awt.shell.Win32ShellFolderManager2$ComInvoker$3.run(Win32ShellFolderManager2.java:458)
            at java.lang.Thread.run(Thread.java:619)
    "IconOverlayTracker Timer" prio=6 tid=0x2e6c3c00 nid=0x968 in Object.wait() [0x3067f000..0x3067fa14]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            at java.lang.Object.wait(Object.java:485)
            at java.util.TimerThread.mainLoop(Timer.java:483)
            - locked <0x05fc6728> (a java.util.TaskQueue)
            at java.util.TimerThread.run(Timer.java:462)
    "IconOverlayTracker Timer" prio=6 tid=0x2e533400 nid=0x728 in Object.wait() [0x3046f000..0x3046fa94]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            at java.lang.Object.wait(Object.java:485)
            at java.util.TimerThread.mainLoop(Timer.java:483)
            - locked <0x05fc67a8> (a java.util.TaskQueue)
            at java.util.TimerThread.run(Timer.java:462)
    "Meter Updater" prio=6 tid=0x2e7d5800 nid=0x2c0 waiting on condition [0x3026f000..0x3026fc14]
       java.lang.Thread.State: TIMED_WAITING (sleeping)
            at java.lang.Thread.sleep(Native Method)
            at elephant.insider.view.impl.MeterUpdater$Updater.run(MeterUpdater.java:131)
            at java.lang.Thread.run(Thread.java:619)
    "Meter Dispatcher" prio=6 tid=0x2e7d5400 nid=0x5a4 waiting on condition [0x3016f000..0x3016fc94]
       java.lang.Thread.State: TIMED_WAITING (sleeping)
            at java.lang.Thread.sleep(Native Method)
            at elephant.insider.view.impl.MeterUpdater$Dispatcher.run(MeterUpdater.java:282)
            at java.lang.Thread.run(Thread.java:619)
    "Adapter Monitor" prio=6 tid=0x2dbf2400 nid=0x910 waiting on condition [0x3006f000..0x3006fd14]
       java.lang.Thread.State: TIMED_WAITING (parking)
            at sun.misc.Unsafe.park(Native Method)
            - parking to wait for  <0x05e083e0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
            at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
            at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1963)
            at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:395)
            at elephant.insider.server.monitor.impl.AdapterMonitorImpl$Monitor.run(AdapterMonitorImpl.java:247)
            at java.lang.Thread.run(Thread.java:619)
    "TimerQueue" daemon prio=6 tid=0x2db1b800 nid=0x1dc in Object.wait() [0x2e4df000..0x2e4dfb14]
       java.lang.Thread.State: TIMED_WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            at javax.swing.TimerQueue.run(TimerQueue.java:236)
            - locked <0x058b2d98> (a javax.swing.TimerQueue)
            at java.lang.Thread.run(Thread.java:619)
    "AWT-Windows" daemon prio=6 tid=0x2dabd000 nid=0xc34 runnable [0x2e0bf000..0x2e0bfc94]
       java.lang.Thread.State: RUNNABLE
            at sun.awt.windows.WToolkit.eventLoop(Native Method)
            at sun.awt.windows.WToolkit.run(WToolkit.java:290)
            at java.lang.Thread.run(Thread.java:619)
    "AWT-Shutdown" prio=6 tid=0x2dabc800 nid=0xc4c in Object.wait() [0x2dfbf000..0x2dfbfd14]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            at java.lang.Object.wait(Object.java:485)
            at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
            - locked <0x058b2eb0> (a java.lang.Object)
            at java.lang.Thread.run(Thread.java:619)
    "Java2D Disposer" daemon prio=6 tid=0x2daa5400 nid=0xbec in Object.wait() [0x2debf000..0x2debfd94]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
            - locked <0x058b2f40> (a java.lang.ref.ReferenceQueue$Lock)
            at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
            at sun.java2d.Disposer.run(Disposer.java:125)
            at java.lang.Thread.run(Thread.java:619)
    "Low Memory Detector" daemon prio=6 tid=0x00e49800 nid=0x938 runnable [0x00000000..0x00000000]
       java.lang.Thread.State: RUNNABLE
    "CompilerThread0" daemon prio=6 tid=0x00e3b800 nid=0xa8c waiting on condition [0x00000000..0x2d5bf83c]
       java.lang.Thread.State: RUNNABLE
    "Attach Listener" daemon prio=6 tid=0x00e3a400 nid=0x83c runnable [0x00000000..0x00000000]
       java.lang.Thread.State: RUNNABLE
    "Signal Dispatcher" daemon prio=6 tid=0x00e39800 nid=0xbfc waiting on condition [0x00000000..0x00000000]
       java.lang.Thread.State: RUNNABLE
    "Finalizer" daemon prio=8 tid=0x00e2a000 nid=0xdb8 in Object.wait() [0x2d2bf000..0x2d2bfc94]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
            - locked <0x05820298> (a java.lang.ref.ReferenceQueue$Lock)
            at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
            at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
    "Reference Handler" daemon prio=6 tid=0x00e25c00 nid=0x388 in Object.wait() [0x2d1bf000..0x2d1bfd14]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            at java.lang.Object.wait(Object.java:485)
            at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
            - locked <0x05820320> (a java.lang.ref.Reference$Lock)
    "main" prio=6 tid=0x008c6c00 nid=0x3ac waiting on condition [0x00000000..0x0012fb3c]
       java.lang.Thread.State: RUNNABLE
    "VM Thread" prio=6 tid=0x00e22800 nid=0xc64 runnable
    "VM Periodic Task Thread" prio=6 tid=0x00e4a800 nid=0x954 waiting on condition
    JNI global references: 2275
    Heap
    def new generation   total 9280K, used 4553K [0x030c0000, 0x03ad0000, 0x05820000)
      eden space 8256K,  49% used [0x030c0000, 0x034c07d0, 0x038d0000)
      from space 1024K,  44% used [0x038d0000, 0x03941ca8, 0x039d0000)
      to   space 1024K,   0% used [0x039d0000, 0x039d0000, 0x03ad0000)
    tenured generation   total 121840K, used 90709K [0x05820000, 0x0cf1c000, 0x230c0000)
       the space 121840K,  74% used [0x05820000, 0x0b0b5450, 0x0b0b5600, 0x0cf1c000)
    compacting perm gen  total 50944K, used 50643K [0x230c0000, 0x26280000, 0x2b0c0000)
       the space 50944K,  99% used [0x230c0000, 0x26234db0, 0x26234e00, 0x26280000)
    No shared spaces configured.
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at oracle.javatools.dialogs.progress.AbstractProgressMonitor.createDialog(AbstractProgressMonitor.java:358)
            at oracle.javatools.dialogs.progress.AbstractProgressMonitor.mav$createDialog(AbstractProgressMonitor.java:39)
            at oracle.javatools.dialogs.progress.AbstractProgressMonitor$1.run(AbstractProgressMonitor.java:325)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
            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)-Tim

  • When I import a commercial CD itunes will create 2 identical albums and put all of the songs except one into one album and put the other song into the other album by it self. How can I combine them all into one album and why is itunes doing this?

    When I import a commerical CD Itunes will create 2 identical albums and put all of the songs except one into one album and put the other song into the second album that it created.  Why is itunes doing this and what can I do to combine them into one album?

    I found this to be somewhat helpful: Grouping Tracks into Albums
    What I did was to put in the same name for Album Artist in every track.  That seemed to do the trick (previously all those fields were empty).  It seems like a lot of work for a simple thing.
    iTunes knows (or should know) that these tracks were imported from one CD. So why is it relying on incomplete data from the gracenote database?

  • Why do I get the following exception when I press the cancel buuton?

    My code is not complete as I am stubbing my code. Can someone tell me why i get the following exception
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at Phonebook.createNew(Phonebook.java:244)
            at Phonebook.actionPerformed(Phonebook.java:222)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:19
    95)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.jav
    a:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
    .java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
    istener.java:236)
            at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:2
    72)
            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(EventDispatchThre
    ad.java:273)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
    java:183)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.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)in the following code whenever I press the cancel button in the part of code that tests fro when a user clicks the create button.
         Filename:     ContactsListInterface.java
         Date:           16 March 2008
         Programmer:     Yucca Nel
         Purpose:     Provides a GUI for entering names and contact numbers into a telephone directory.
                        Also allows options for searching for a specific name and deleting of data from the record
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class Phonebook extends JFrame implements ActionListener
    { //start of class
         // construct fields, buttons, labels,text boxes, ArrayLists etc
         JTextPane displayPane = new JTextPane();
         JLabel listOfContacts = new JLabel("List Of Contacts");               // creates a label for the scrollpane
         JButton createButton = new JButton("Create");
         JButton searchButton = new JButton("Search");
         JButton modifyButton = new JButton("Modify");
         JButton deleteButton = new JButton("Delete");
         ArrayList fNameList = new ArrayList();
         ArrayList sNameList = new ArrayList();
         ArrayList hList = new ArrayList();
         ArrayList wList = new ArrayList();
         ArrayList cList = new ArrayList();
         public String name, surname, home, work, cell;
         // create an instance of the ContactsListInterface
         public Phonebook()
         { // start of cli()
              super("Phonebook Interface");
         } // end of cli()
         public JMenuBar createMenuBar()
         { // start of the createMenuBar()
              // construct and populate a menu bar
              JMenuBar mnuBar = new JMenuBar();                    // creates a menu bar
              setJMenuBar(mnuBar);
              JMenu mnuFile = new JMenu("File",true);               // creates a file menu in the menu bar which is visible
                   mnuFile.setMnemonic(KeyEvent.VK_F);
                   mnuFile.setDisplayedMnemonicIndex(0);
                   mnuFile.setToolTipText("File Options");
                   mnuBar.add(mnuFile);
              JMenuItem mnuFileExit = new JMenuItem("Save And Exit");     // creates an exit option in the file menu
                   mnuFileExit.setMnemonic(KeyEvent.VK_X);
                   mnuFileExit.setDisplayedMnemonicIndex(1);
                   mnuFileExit.setToolTipText("Close Application");
                   mnuFile.add(mnuFileExit);
                   mnuFileExit.setActionCommand("Exit");
                   mnuFileExit.addActionListener(this);
              JMenu mnuEdit = new JMenu("Edit",true);               // creates a menu for editing options
                   mnuEdit.setMnemonic(KeyEvent.VK_E);
                   mnuEdit.setDisplayedMnemonicIndex(0);
                   mnuEdit.setToolTipText("Edit Options");
                   mnuBar.add(mnuEdit);
              JMenu mnuEditSort = new JMenu("Sort",true);          // creates an option for sorting entries
                   mnuEditSort.setMnemonic(KeyEvent.VK_S);
                   mnuEditSort.setDisplayedMnemonicIndex(0);
                   mnuEdit.add(mnuEditSort);
              JMenuItem mnuEditSortByName = new JMenuItem("Sort By Name");          // to sort entries by name
                   mnuEditSortByName.setMnemonic(KeyEvent.VK_N);
                   mnuEditSortByName.setDisplayedMnemonicIndex(8);
                   mnuEditSortByName.setToolTipText("Sort entries by first name");
                   mnuEditSortByName.setActionCommand("Name");
                   mnuEditSortByName.addActionListener(this);
                   mnuEditSort.add(mnuEditSortByName);
              JMenuItem mnuEditSortBySurname = new JMenuItem("Sort By Surname");     // to sort entries by surname
                   mnuEditSortBySurname.setMnemonic(KeyEvent.VK_R);
                   mnuEditSortBySurname.setDisplayedMnemonicIndex(10);
                   mnuEditSortBySurname.setToolTipText("Sort entries by surname");
                   mnuEditSortBySurname.setActionCommand("Surname");
                   mnuEditSortBySurname.addActionListener(this);
                   mnuEditSort.add(mnuEditSortBySurname);
              JMenu mnuHelp = new JMenu("Help",true);                    // creates a menu for help options
                   mnuHelp.setMnemonic(KeyEvent.VK_H);
                   mnuHelp.setDisplayedMnemonicIndex(0);
                   mnuHelp.setToolTipText("Help options");
                   mnuBar.add(mnuHelp);
              JMenuItem mnuHelpHelp = new JMenuItem("Help");          // creates a help option for help topic
                   mnuHelpHelp.setMnemonic(KeyEvent.VK_P);
                   mnuHelpHelp.setDisplayedMnemonicIndex(3);
                   mnuHelpHelp.setToolTipText("Help Topic");
                   mnuHelpHelp.setActionCommand("Help");
                   mnuHelpHelp.addActionListener(this);
                   mnuHelp.add(mnuHelpHelp);
              JMenuItem mnuHelpAbout = new JMenuItem("About");     // creates a about option for info about api
                   mnuHelpAbout.setMnemonic(KeyEvent.VK_T);
                   mnuHelpAbout.setDisplayedMnemonicIndex(4);
                   mnuHelpAbout.setToolTipText("About this program");
                   mnuHelpAbout.setActionCommand("About");
                   mnuHelpAbout.addActionListener(this);
                   mnuHelp.add(mnuHelpAbout);
              return mnuBar;
         } // end of the createMenuBar()
         // create the content pane
         public Container createContentPane()
         { // start of createContentPane()
              //construct and populate panels and content pane
              JPanel labelPanel = new JPanel(); // panel is only used to put the label for the textpane in
                   labelPanel.setLayout(new FlowLayout());
                   labelPanel.add(listOfContacts);
              JPanel displayPanel = new JPanel();// panel is used to display all the contacts and thier numbers
                   setTabsAndStyles(displayPane);
                   displayPane = addTextToTextPane();
                   displayPane.setEditable(false);
              JScrollPane scrollPane = new JScrollPane(displayPane);
                   scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); // pane is scrollable vertically
                   scrollPane.setWheelScrollingEnabled(true);// pane is scrollable by use of the mouse wheel
                   scrollPane.setPreferredSize(new Dimension(400,320));
              displayPanel.add(scrollPane);
              JPanel workPanel = new JPanel();// panel is used to enter, edit and delete data
                   workPanel.setLayout(new FlowLayout());
                   workPanel.add(createButton);
                        createButton.setToolTipText("Create a new entry");
                        createButton.addActionListener(this);
                   workPanel.add(searchButton);
                        searchButton.setToolTipText("Search for an entry by name number or surname");
                        searchButton.addActionListener(this);
                   workPanel.add(modifyButton);
                        modifyButton.setToolTipText("Modify an existing entry");
                        modifyButton.addActionListener(this);
                   workPanel.add(deleteButton);
                        deleteButton.setToolTipText("Delete an existing entry");
                        deleteButton.addActionListener(this);
              labelPanel.setBackground(Color.red);
              displayPanel.setBackground(Color.red);
              workPanel.setBackground(Color.red);
              // create container and set attributes
              Container c = getContentPane();
                   c.setLayout(new BorderLayout(30,30));
                   c.add(labelPanel,BorderLayout.NORTH);
                   c.add(displayPanel,BorderLayout.CENTER);
                   c.add(workPanel,BorderLayout.SOUTH);
                   c.setBackground(Color.red);
              // add a listener for the window closing and save
              addWindowListener(
                   new WindowAdapter()
                        public void windowClosing(WindowEvent e)
                             int answer = JOptionPane.showConfirmDialog(null,"Are you sure you would like to save all changes and exit?","File submission",JOptionPane.YES_NO_OPTION);
                             if(answer == JOptionPane.YES_OPTION)
                                  System.exit(0);
              return c;
         } // end of createContentPane()
         protected void setTabsAndStyles(JTextPane displayPane)
         { // Start of setTabsAndStyles()
              // set Font style
              Style fontStyle = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE);
              Style regular = displayPane.addStyle("regular", fontStyle);
              StyleConstants.setFontFamily(fontStyle, "SansSerif");
              Style s = displayPane.addStyle("bold", regular);
              StyleConstants.setBold(s,true);
         } // End of setTabsAndStyles()
         public JTextPane addTextToTextPane()
         { // start of addTextToTextPane()
              Document doc = displayPane.getDocument();
              try
              { // start of tryblock
                   // clear previous text
                   doc.remove(0,doc.getLength());
                   // insert titles of columns
                   doc.insertString(0,"NAME\tSURNAME\tHOME NO\tWORK NO\tCELL NO\n",displayPane.getStyle("bold"));
              } // end of try block
              catch(BadLocationException ble)
              { // start of ble exception handler
                   System.err.println("Could not insert text.");
              } // end of ble exception handler
              return displayPane;
         } // end of addTextToTextPane()
         // code to process user clicks
         public void actionPerformed(ActionEvent e)
         { // start of actionPerformed()
              String arg = e.getActionCommand();
              // user clicks create button
              if(arg.equals("Create"))
                   createNew();
              if(arg.equals("Search"))
              if(arg.equals("Modify"))
              if(arg.equals("Delete"))
              if(arg.equals("Exit"))
         } // end of actionPerformed()
         // method to create a new contact
         public void createNew()
         { // start of create new contact()
              name = JOptionPane.showInputDialog(null,"Please enter the new contacts first name or press cancel to exit.");
              if(name == null)     finish();                         // if user clicks cancel
              if(name.length() <=0)
                   JOptionPane.showMessageDialog(null,"You did not enter a valid name.\nPlease make sure you enter data correctly.","Error",JOptionPane.ERROR_MESSAGE);
                   createNew();                                   // To return to the create method
              surname = JOptionPane.showInputDialog(null,"Please enter the new contacts surname or press cancel to exit.");
              if(surname == null)     finish();                         // if user clicks cancel
              if(surname.equals(""))
                   int answer = JOptionPane.showConfirmDialog(null,"You did not enter a surname.\nAre you sure you wish to leave the surname empty?","No data entered",JOptionPane.YES_NO_OPTION);   // Asks if data was valid
                   if(answer == JOptionPane.NO_OPTION)
                        surname = JOptionPane.showInputDialog(null,"Please enter the new contacts surname.");
              home = JOptionPane.showInputDialog(null,"Please enter the new contacts home number or press cancel to exit.");
              if(home == null)   finish();                    // if user clicks cancel
              work = JOptionPane.showInputDialog(null,"Please enter the new contacts work number or press cancel to exit.");
              if(work == null)     finish();                    // if user clicks cancel
              cell = JOptionPane.showInputDialog(null,"Please enter the new contacts cell number or press cancel to exit.");
              if(cell == null)     finish();                    // if user clicks cancel
         } // end of create new contact()
         // method to close applicatin
         public void finish()
         // method to search a contact
         public static void main(String[] args)
         { // start of main()
              // Set look and feel of interface
              try
              { // start of try block
                   UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
              } // end of try block
              catch(Exception e)
              { // start of catch block
                   JOptionPane.showMessageDialog(null,"There was an error in setting the look and feel of this application","Error",JOptionPane.INFORMATION_MESSAGE);
              } // end  of catch block
              Phonebook p = new Phonebook();
              p.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
              p.setJMenuBar(p.createMenuBar());
              p.setContentPane(p.createContentPane());
              p.setSize(520,500);
              p.setVisible(true);
              p.setResizable(false);
         } // end of main()
    } //end of class

    Yucca wrote:
    Line 244 is where I test for if the user actuallu entered a String at all. Is there an alternative way of writing that code?
    if(name.length() <=0)
                   JOptionPane.showMessageDialog(null,"You did not enter a valid name.\nPlease make sure you enter data correctly.","Error",JOptionPane.ERROR_MESSAGE);
                   createNew();                                   // To return to the create method
    Change:
    if(name == null)     finish();     To
    if(name == null) {
        finish();
        return;
    }

  • I just updated iMovie to 10.0.2. while attempting to import clips from my camera every clip shows up in the window EXCEPT the one I want to download. Its on may camera but won't show up why?

    i had just updated imovie to 10.0.2. While attempting to import clips from my camera the computer froze so I tried to eject the usb cord hooked to my camera. Even though it said it was OK to do so, when I pulled it out I got a message it was done prematurely. When I restarted the computer and tried to import again, evey clip shows up in the window EXCEPT the very one I want to import. I have no idea why and Ive tried everyting( restart, turn off, etc) nothing works. The wanted clip shows up fine on my camera but not in the imovie import window. please help

    How much free space do you have on your hard drive?
    LN

  • I am facing a problem while deploying an Entity bean in iPlanet(sp3).I have attached the exception thrown.Why has this exception occured?

    [04/Dec/2001 10:54:00:2] error: EBFP-marshal_internal: internal exception caught in kcp skeleton, ex
    ception = java.lang.NullPointerException
    [04/Dec/2001 10:54:00:2] error: Exception Stack Trace:
    java.lang.NullPointerException
    at java.util.Hashtable.get(Hashtable.java:321)
    at com.netscape.server.ejb.SQLPersistenceManager.<init>(Unknown Source)
    at com.netscape.server.ejb.SQLPersistenceManagerFactory.newInstance(Unknown Source)
    at com.netscape.server.ejb.EntityDelegateManagerImpl.getPersistenceManager(Unknown Source)
    at com.netscape.server.ejb.EntityDelegateManagerImpl.doPersistentFind(Unknown Source)
    at com.netscape.server.ejb.EntityDelegateManagerImpl.find(Unknown Source)
    at com.kivasoft.eb.EBHomeBase.findSingleByParms(Unknown Source)
    at samples.test.ejb.Entity.ejb_home_samples_test_ejb_Entity_TestEntityBean.findByPrimaryKey(
    ejb_home_samples_test_ejb_Entity_TestEntityBean.java:126)
    at samples.test.ejb.Entity.ejb_kcp_skel_TestEntityHome.findByPrimaryKey__samples_test_ejb_En
    tity_TestEntity__int(ejb_kcp_skel_TestEntityHome.java:266)
    at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
    at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
    at samples.test.ejb.Entity.ejb_kcp_stub_TestEntityHome.findByPrimaryKey(ejb_kcp_stub_TestEnt
    ityHome.java:338)
    at samples.test.ejb.Entity.ejb_stub_TestEntityHome.findByPrimaryKey(ejb_stub_TestEntityHome.
    java:85)
    at samples.test.ejb.TestEJB.getGreeting(TestEJB.java:51)

    Hi,
    I think you are trying to test the Hello world EJB example shipped with the product. As a first
    step I would recomend you to go through every line of the document on deploying this application,
    since, I too have experienced many errors while trying to deploy the sample applications, but on
    following the documentation, I subsequently overcame all the errors and have been working with the
    applications. So please follow the steps in documentation and let me know, if you still encounter any
    issues.
    Regards
    Raj
    Sandhya S wrote:
    I am facing a problem while deploying an Entity bean in iPlanet(sp3).I
    have attached the exception thrown.Why has this exception occured?
    [04/Dec/2001 10:54:00:2] error: EBFP-marshal_internal: internal
    exception caught in kcp skeleton, ex
    ception = java.lang.NullPointerException
    [04/Dec/2001 10:54:00:2] error: Exception Stack Trace:
    java.lang.NullPointerException
    at java.util.Hashtable.get(Hashtable.java:321)
    at
    com.netscape.server.ejb.SQLPersistenceManager.<init>(Unknown Source)
    at
    com.netscape.server.ejb.SQLPersistenceManagerFactory.newInstance(Unknown
    Source)
    at
    com.netscape.server.ejb.EntityDelegateManagerImpl.getPersistenceManager(Unknown
    Source)
    at
    com.netscape.server.ejb.EntityDelegateManagerImpl.doPersistentFind(Unknown
    Source)
    at
    com.netscape.server.ejb.EntityDelegateManagerImpl.find(Unknown Source)
    at com.kivasoft.eb.EBHomeBase.findSingleByParms(Unknown
    Source)
    at
    samples.test.ejb.Entity.ejb_home_samples_test_ejb_Entity_TestEntityBean.findByPrimaryKey(
    ejb_home_samples_test_ejb_Entity_TestEntityBean.java:126)
    at
    samples.test.ejb.Entity.ejb_kcp_skel_TestEntityHome.findByPrimaryKey__samples_test_ejb_En
    tity_TestEntity__int(ejb_kcp_skel_TestEntityHome.java:266)
    at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
    at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
    at
    samples.test.ejb.Entity.ejb_kcp_stub_TestEntityHome.findByPrimaryKey(ejb_kcp_stub_TestEnt
    ityHome.java:338)
    at
    samples.test.ejb.Entity.ejb_stub_TestEntityHome.findByPrimaryKey(ejb_stub_TestEntityHome.
    java:85)
    at samples.test.ejb.TestEJB.getGreeting(TestEJB.java:51)
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • I'm wondering..why does the outermost exception always catch the error?

    hi
    why do sometimes (or everytime) i create a code which looks something like this..
    try{
        try{
              //some error here
        } catch (Exception e){
               System.out.println("got it here: " + e.getMessage();
    }catch (Exception e){
          System.out.println("got it here instead: " + e.getMessage();
    }it's always the outermost catch block caughts the error. In this example the line got it here instead: some error messageis displayed.
    I really thought for sure the inner exception is the one who should catch the error first, right? Furthermore they both catch the same thing (Exception).
    Any information is greatly appreciated. thanks

    No, you're wrong.I'm relieved to hear that. But why does my code always does what I mentioned above? here's my code (it's a partial code, actually. it takes too many lines to put all the codes here):
    void generatePIN(String Date){
              char currentCodeChar;
              int seeder=0, serialNumber=0000000;
              int currentNumberInt=0, nextNumber=0, currentCodeInt=0;
              String voucherSerial=null, PINnumber=null, currentNumber=null, currentCode=null, nextCode=null, currentSerial=null, nextSerial=null;
              int PIN1=0,PIN2=0;
              String query=null;
              PreparedStatement ps=null;
              ResultSet rs=null;
              try{
                   //this portion here is used for proper seeding random number
                   SecureRandom sr1 = SecureRandom.getInstance("SHA1PRNG");
                   seeder=sr1.nextInt();
                   if (seeder<0){
                        seeder=seeder*-1;
              }catch (Exception e){
                   System.out.println(e.getMessage());
                   System.exit(1);
              random = new Random(seeder);
              PIN1 = random.nextInt(89999999)+10000000;
              PIN2 = random.nextInt(89999999)+10000000;
              PINnumber = "" + PIN1 + PIN2;
              System.out.println("PIN number: " + PINnumber);
              //check serial number first before storing the pin & serial number in database
              //if serial number exist, regenerate the serial number
              try{
                   try{
                   query = "select * from data1";
                   ps = con.prepareStatement(query);     
                   rs = ps.executeQuery();
                             while (rs.next()){
                             currentSerial = rs.getString("SerialNo");
                   }catch (SQLException ex){
                        System.out.println("error here?" + ex.getMessage());
                   while (currentNumberInt<=9999999){
                        currentNumberInt++;                    
              }catch (Exception e){
                   JOptionPane.showMessageDialog(null,"Database error 1: " + e.getMessage());
                   return;
         }the database is empty. hence it returns an error when i tried getting some data from it. but i expected the error message should be:
    error here? some error message..instead of the
    Database error 1: some error message pop-up being displayed.
    Did i make any mistake in my code? I've spent hours on this..
    thanks for helping

  • Why the exception is being caught - Suggestion is required.

    hi,
    Acording to the knowledge i have both theoretical and practial
    when a method declares that it throws an ExceptionType then that method never handles that exception at all even though there exists a catch(Exception e) block in the try block.
    The above scenario and ethics is violated when i run the following program.
    I want to knw why the Exception block is catching the IllegalArgumentException ?
    public class TestClass {
    private void testMethod() throws IllegalArgumentException {
    try {
    int i = 0;
    throw new IllegalArgumentException("IA");
    } catch (Exception e) {
    System.out.println("Test message 2");
    e.printStackTrace();
    public static void main(String[] args) {
    try {
    new TestClass().testMethod();
    } catch (IllegalArgumentException iae) {
    System.out.println("Exception caught in main method");
    When I run the above program the exception being thrown is caught in the testMethod only and the message Test message 2" is being printed
    Why is it happening ?
    Thanx in advance
    Mahesh

    Hi,
    What ever u said is not real. When a method declares that it throws an exception it will never be caught by the generic Exception method.
    This what is happened.
    Generally in my programming i throw a BusinnesException when input data violates some business exception. ( I declare that my method throws BusinessException ).
    I also catch Exception as generic to avoid abnormal termination due to other exception causes.
    What i knw is that if a method declares that it is throws an exception ti will never handle that even though it has a catch block to catch parent exception class
    mahesh

  • I am walking through Apples tutorial getting started with iOS development. I am at the storyboard area and can't seem to drag the cancel button to the green exit. I am not sure why the exit button doesn't except it. Is anyone else having this issue?

    I am walking through Apples tutorial getting started with iOS development. I am at the storyboard area and can't seem to drag the cancel button to the green exit. I am not sure why the exit button doesn't except it. Is anyone else having this issue? Is there a work around? I have done this app twice and still cant get the exit to except the Cancel or Done  bar buttons

    Yes I checked it.  As far as I can see I did everything Apple said to do.  I took some screen shot so you can see how the screens are connected and what and where the code is, and what it does when I drag the cancel and done bar buttons to the exit

  • Rethrowing the same exception - how, when and why?

    Hi,
    I have just gone through the Exception Handling chapter and found don't understand when should I use the rethrowing of same exception?
    e.g.
    catch(NullPointerException e) {
    e.printStackTrace();
    throw e;
    or
    catch(NullPointerException e) {
    e.printStackTrace();
    Throwable changedE = e.fillInStackTrace();
    throw changedE;
    I am not sure how, why and when should I use this syntax?
    Any advice and a given example is much appreciated.
    Thanks in advance.
    gogo

    Think about the information you would want when this exception occurs; if you rethrow the exception then the entire stack trace will be available which will allow you to find the root of the problem more easily than if you have filled in the stack trace at an intermediate point in the call graph. Never throw away information in an exception.
    Note also that fillInStackTrace() does not actually create a new instance of the Throwable. It just returns the same instance but with it's stack trace modified.
    There are two other points to note about your example:
    First, catching NullPointerExceptions or any subclass of RuntimeException (except for the curseworthy NumberFormatException) is generally a bad thing to do. RuntimeExceptions usually indicate that something is wrong with your code or with the VM and catching them is just masking the real problem. They're not like checked exceptions (subclasses of Exception that are not RuntimeExceptions) which can occur because of something 'unexpected' happening in the environment which has nothing to do with bad code and for which recovery from the problem is often possible.
    Second, consider whether you really want to catch an Exception anyway. Exceptions should only be caught when:
    a) you want to try to recover from the problem i.e. you can handle the exception
    b) you want to transform the exception into something more meaningful to client code, i.e. if the exception comes from deep in some library code and you can't handle the exception but the actual class of exception won't be meaningful to the client code, then you might want to create your own Exception subclass and throw an instance of that in place of the original exception. If you do this, then you should chain the original exception so that you still preserve all the stack information and the original message (this is why all Throwables in JDK 1.4 have constructors that take a Throwable 'cause' parameter)
    Lance

Maybe you are looking for

  • I have Adobe Acrobat 9 Pro on my desktop.  Can I also load into onto my laptop for working remotely with the same serial number?

    I use Adobe Pro on my desktop daily at the office and now will be handling work remotely from a laptop as well.  Adobe Pro is essential for my work (bates stamping, redaction, advanced editing, etc). Can I use the same serial number and installation

  • Multiple Valid Signatures

    I have a few forms that required multiple signatures. Is there anyway to make a signature field validate only certain controls? If I sign one signature field, the signature is valid. If I sign another signature field, the original field has the check

  • PSE 7 -  Saving Online Gallery locally on disk

    New in PSE7 I am missing the old PSE 2 feature to first open the gallery locally with the browser (saving on disk) istead of instantly starting ftp transfer or creating a CD. Any idea? Thanks!

  • JAVAscript MM_goToURL iframe function has stopped working

    I've been using a piece of javascript generated as part of an old version of Dreamweaver for a few years now with no problems. However, I visited my site the other day and discovered that one of the functions for 'MM_goToURL' has stopped working. I u

  • New Os X Mavericks and trackpad problem

    Hi everybody, yesterday i have installed maverick in my macbook white 2010. Today, after didn't use my mac for 20 hours, the trackpad is going crazy. It moves and click alone without any human contact. Can maverik create this problem? Sorry for the b