Need help in Simple Java JDialog...

have 3 classes..
One class extend JFrame
One class extend JPanel
One class extend JDialog
My JFrame is like my Main Frame...
I have my JPanel that is always changing in my JFrame..
How do i pass the JFrame into my JDialog constructor???
(btw, is upon one of my JPanel click button, my JDialog appears)
Thanks.

have 3 classes..
One class extend JFrame
One class extend JPanel
One class extend JDialog
My JFrame is like my Main Frame...
I have my JPanel that is always changing in my
JFrame..
How do i pass the JFrame into my JDialog
constructor???
(btw, is upon one of my JPanel click button, my
JDialog appears)
Thanks.You can pass the reference of JFrame in JDialog constructor as below:
1) JDialog dialog = new JDialog(ClassName.this, "Title', true);
where ClassName is the name of class that extends the JFrame. Thus you can capture reference of the parent.
2) You can also get reference of JFrame by invoking method on your panel as:
Container parent = jPanel.getParent();
JDialog dialog = new JDialog(parent , "Title', true);
where jPanel is instance of your JPanel.
Post whether u need anything else.

Similar Messages

  • Need Help with simple array program!

    Hi, I have just recently started how to use arrays[] in Java and I'm a bit confused and need help designing a program.
    What this program does, it reads in a range of letters specified by the user. The user then enters the letters (a, b or c) and stores these characters into an array, which the array's length is equal to the input range the user would enter at the start of the program. The program is then meant to find how many times (a,b and c) appears in the array and the Index it first appears at, then prints these results.
    Here is my Code for the program, hopefully this would make sense of what my program is suppose to do.
    import B102.*;
    class Letters
         static int GetSize()
              int size = 0;
              boolean err = true;
              while(err == true)
                   Screen.out.println("How Many Letters would you like to read in?");
                   size = Keybd.in.readInt();
                   err = Keybd.in.fail();
                   Keybd.in.clearError();
                   if(size <= 0)
                        err = true;
                        Screen.out.println("Invalid Input");
              return(size);
         static char[] ReadInput(int size)
              char input;
              char[] letter = new char[size];
              for(int start = 1; start <= size; start++)
                   System.out.println("Please enter a letter (a, b or c) ("+size+" max), enter # to stop:");
                   input = Keybd.in.readChar();
                   while((input != 'a') && (input != 'b') && (input != 'c') && (input != '#'))
                        Screen.out.println("Invalid Input");
                        System.out.println("Please enter a letter (a, b or c) ("+size+" max, enter # to stop:");
                        input = Keybd.in.readChar();
                                    while(input == '#')
                                                 start == size;
                                                 break;
                   for(int i = 0; i < letter.length; i++)
                        letter[i] = input;
              return(letter);
         static int CountA(char[] letter)
              int acount = 0;
              for(int i = 0; i < letter.length; i++)
                   if(letter[i] == 'a')
                        acount++;
              return(acount);
         static int CountB(char[] letter)
              int bcount = 0;
              for(int i = 0; i < letter.length; i++)
                   if(letter[i] == 'b')
                        bcount++;
              return(bcount);
         static int CountC(char[] letter)
              int ccount = 0;
              for(int i = 0; i < letter.length; i++)
                   if(letter[i] == 'c')
                        ccount++;
              return(ccount);
         static int SearchA(char[] letter)
              int ia;
              for(ia = 0; ia < letter.length; ia++)
                   if(letter[ia] == 'a')
                        return(ia);
              return(ia);
         static int SearchB(char[] letter)
              int ib;
              for(ib = 0; ib < letter.length; ib++)
                   if(letter[ib] == 'b')
                        return(ib);
              return(ib);
         static int SearchC(char[] letter)
              int ic;
              for(ic = 0; ic < letter.length; ic++)
                   if(letter[ic] == 'c')
                        return(ic);
              return(ic);
         static void PrintResult(char[] letter, int acount, int bcount, int ccount, int ia, int ib, int ic)
              if(ia <= 1)
                   System.out.println("There are "+acount+" a's found, first appearing at index "+ia);
              else
                   System.out.println("There are no a's found");
              if(ib <= 1)
                   System.out.println("There are "+bcount+" b's found, first appearing at index "+ib);
              else
                   System.out.println("There are no b's found");
              if(ic <= 1)
                   System.out.println("There are "+ccount+" c's found, first appearing at index "+ic);
              else
                   System.out.println("There are no c's found");
              return;
         public static void main(String args[])
              int size;
              char[] letter;
              int acount;
              int bcount;
              int ccount;
              int ia;
              int ib;
              int ic;
              size = GetSize();
              letter = ReadInput(size);
              acount = CountA(letter);
              bcount = CountB(letter);
              ccount = CountC(letter);
              ia = SearchA(letter);
              ib = SearchB(letter);
              ic = SearchC(letter);
              PrintResult(letter, acount, bcount, ccount, ia, ib, ic);
              return;
    }     Some errors i get with my program are:
    When reading in the letters to store into the array, I get the last letter I entered placed into the entire array. Also I believe my code to find the Index is incorrect.
    Example Testing: How many letters would you like to read? 3
    Enter letter (a, b or c) (# to quit): a
    Enter letter (a, b or c) (# to quit): b
    Enter letter (a, b or c) (# to quit): c
    It prints "There are no a's'" (there should be 1 a at index 0)
    "There are no b's" (there should be 1 b at index 1)
    and "There are 3 c's, first appearing at index 0" ( there should be 1 c at index 2)
    The last thing is that my code for when the user enters "#" that the input of letters would stop and the program would then continue over to the counting and searching part for the letters, my I believe is correct but I get the same problem as stated above where the program takes the character "#" and stores it into the entire array.
    Example Testing:How many letters would you like to read? 3
    Enter letter (a, b or c) (# to quit): a
    Enter letter (a, b or c) (# to quit): #
    It prints "There are no a's'" (should have been 1 a at index 0)
    "There are no b's"
    and "There are no c's"
    Can someone please help me??? or does anyone have a program simular to this they have done and would'nt mind showing me how it works?
    Thanks
    lou87.

    Without thinking too much...something like this
    for(int start = 0; start < size; start++) {
                System.out.println("Please enter a letter (a, b or c) ("+size+" max), enter # to stop:");
                input = Keybd.in.readChar();
                while((input != 'a') && (input != 'b') && (input != 'c') && (input != '#')) {
                    Screen.out.println("Invalid Input");
                    System.out.println("Please enter a letter (a, b or c) ("+size+" max, enter # to stop:");
                    input = Keybd.in.readChar();
                if(input == '#') {
                        break;
                letter[start] = input;
            }you dont even need to do start = size; coz with the break you go out of the for loop.

  • Need help in solving java.io.NotSerializableException

    Hi,
    Weblogic 9.2
    I need help in solving the java.io.NotSerializableException: weblogic.jndi.internal.ApplicationNamingNode
    I dont know why ApplicationNamingNode has to be serialized.
    Full stack trace will be provided if needed.
    thank you

    Here is the stack trace
    Remote service [com.gfs.corp.component.price.customerbid.PCBMaint] threw exception
    weblogic.rjvm.PeerGoneException: ; nested exception is:
         java.rmi.UnmarshalException: Incoming message header or abbreviation processing failed ; nested exception is:
         java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: weblogic.jndi.internal.ApplicationNamingNode
         at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:211)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:338)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)
         at com.gfs.corp.component.price.maint.customerbid.ejb.PCBMaint_q9igfc_EOImpl_922_WLStub.createBid(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.springframework.remoting.rmi.RmiClientInterceptorUtils.doInvoke(RmiClientInterceptorUtils.java:107)
         at org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor.doInvoke(SimpleRemoteSlsbInvokerInterceptor.java:75)
         at org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor.invoke(AbstractRemoteSlsbInvokerInterceptor.java:119)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy47.createBid(Unknown Source)
         at com.gfs.corp.bid.price.controller.DefaultBidPriceUpdater.awardBid(DefaultBidPriceUpdater.java:83)
         at com.gfs.corp.bid.price.ejb.AwardQueueMessageHandler.onMessage(AwardQueueMessageHandler.java:98)
         at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:429)
         at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:335)
         at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:291)
         at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4072)
         at weblogic.jms.client.JMSSession.execute(JMSSession.java:3962)
         at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:4490)
         at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    Caused by: java.rmi.UnmarshalException: Incoming message header or abbreviation processing failed ; nested exception is:
         java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: weblogic.jndi.internal.ApplicationNamingNode
         at weblogic.rjvm.MsgAbbrevJVMConnection.dispatch(MsgAbbrevJVMConnection.java:441)
         at weblogic.rjvm.t3.MuxableSocketT3.dispatch(MuxableSocketT3.java:368)
         at weblogic.socket.AbstractMuxableSocket.dispatch(AbstractMuxableSocket.java:378)
         at weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:105)
         at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:29)
         at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:42)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
    Caused by: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: weblogic.jndi.internal.ApplicationNamingNode
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1309)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
         at weblogic.transaction.internal.PropagationContext.readRollbackReason(PropagationContext.java:804)
         at weblogic.transaction.internal.PropagationContext.readExternal(PropagationContext.java:376)
         at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
         at weblogic.rmi.provider.BasicServiceContext.readExternal(BasicServiceContext.java:56)
         at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
         at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:195)
         at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:565)
         at weblogic.rjvm.MsgAbbrevInputStream.readExtendedContexts(MsgAbbrevInputStream.java:224)
         at weblogic.rjvm.MsgAbbrevInputStream.init(MsgAbbrevInputStream.java:188)
         at weblogic.rjvm.MsgAbbrevJVMConnection.dispatch(MsgAbbrevJVMConnection.java:435)
         ... 7 more
    Caused by: java.io.NotSerializableException: weblogic.jndi.internal.ApplicationNamingNode
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
         at weblogic.jndi.internal.WLContextImpl.writeExternal(WLContextImpl.java:453)
         at weblogic.jndi.internal.WLEventContextImpl.writeExternal(WLEventContextImpl.java:422)
         at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1310)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1288)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
         at weblogic.transaction.internal.PropagationContext.convertRollbackReasonToBytes(PropagationContext.java:735)
         at weblogic.transaction.internal.PropagationContext.writeRollbackReason(PropagationContext.java:819)
         at weblogic.transaction.internal.PropagationContext.writeExternal(PropagationContext.java:183)
         at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1310)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1288)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
         at weblogic.rmi.provider.BasicServiceContext.writeExternal(BasicServiceContext.java:48)
         at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1310)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1288)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
         at weblogic.rjvm.MsgAbbrevOutputStream.writeObject(MsgAbbrevOutputStream.java:614)
         at weblogic.rjvm.MsgAbbrevOutputStream.marshalCustomCallData(MsgAbbrevOutputStream.java:319)
         at weblogic.rjvm.MsgAbbrevOutputStream.transferThreadLocalContext(MsgAbbrevOutputStream.java:149)
         at weblogic.rmi.internal.BasicServerRef.postInvoke(BasicServerRef.java:606)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:455)
         at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:58)
         at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:975)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    2007-10-18 08:38:04,931 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] WARN org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean - Could not invoke 'remove' on remote EJB proxy
    weblogic.rjvm.PeerGoneException: ; nested exception is:
         java.rmi.UnmarshalException: Incoming message header or abbreviation processing failed ; nested exception is:
         java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: weblogic.jndi.internal.ApplicationNamingNode
         at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:211)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:338)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)
         at com.gfs.corp.component.price.maint.customerbid.ejb.PCBMaint_q9igfc_EOImpl_922_WLStub.remove(Unknown Source)
         at org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor.removeSessionBeanInstance(AbstractRemoteSlsbInvokerInterceptor.java:227)
         at org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor.releaseSessionBeanInstance(SimpleRemoteSlsbInvokerInterceptor.java:118)
         at org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor.doInvoke(SimpleRemoteSlsbInvokerInterceptor.java:95)
         at org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor.invoke(AbstractRemoteSlsbInvokerInterceptor.java:119)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy47.createBid(Unknown Source)
         at com.gfs.corp.bid.price.controller.DefaultBidPriceUpdater.awardBid(DefaultBidPriceUpdater.java:83)
         at com.gfs.corp.bid.price.ejb.AwardQueueMessageHandler.onMessage(AwardQueueMessageHandler.java:98)
         at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:429)
         at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:335)
         at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:291)
         at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4072)
         at weblogic.jms.client.JMSSession.execute(JMSSession.java:3962)
         at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:4490)
         at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    Caused by: java.rmi.UnmarshalException: Incoming message header or abbreviation processing failed ; nested exception is:
         java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: weblogic.jndi.internal.ApplicationNamingNode
         at weblogic.rjvm.MsgAbbrevJVMConnection.dispatch(MsgAbbrevJVMConnection.java:441)
         at weblogic.rjvm.t3.MuxableSocketT3.dispatch(MuxableSocketT3.java:368)
         at weblogic.socket.AbstractMuxableSocket.dispatch(AbstractMuxableSocket.java:378)
         at weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:105)
         at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:29)
         at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:42)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
    Caused by: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: weblogic.jndi.internal.ApplicationNamingNode
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1309)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
         at weblogic.transaction.internal.PropagationContext.readRollbackReason(PropagationContext.java:804)
         at weblogic.transaction.internal.PropagationContext.readExternal(PropagationContext.java:376)
         at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
         at weblogic.rmi.provider.BasicServiceContext.readExternal(BasicServiceContext.java:56)
         at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
         at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:195)
         at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:565)
         at weblogic.rjvm.MsgAbbrevInputStream.readExtendedContexts(MsgAbbrevInputStream.java:224)
         at weblogic.rjvm.MsgAbbrevInputStream.init(MsgAbbrevInputStream.java:188)
         at weblogic.rjvm.MsgAbbrevJVMConnection.dispatch(MsgAbbrevJVMConnection.java:435)
         ... 7 more
    Caused by: java.io.NotSerializableException: weblogic.jndi.internal.ApplicationNamingNode
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
         at weblogic.jndi.internal.WLContextImpl.writeExternal(WLContextImpl.java:453)
         at weblogic.jndi.internal.WLEventContextImpl.writeExternal(WLEventContextImpl.java:422)
         at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1310)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1288)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
         at weblogic.transaction.internal.PropagationContext.convertRollbackReasonToBytes(PropagationContext.java:735)
         at weblogic.transaction.internal.PropagationContext.writeRollbackReason(PropagationContext.java:819)
         at weblogic.transaction.internal.PropagationContext.writeExternal(PropagationContext.java:183)
         at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1310)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1288)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
         at weblogic.rmi.provider.BasicServiceContext.writeExternal(BasicServiceContext.java:48)
         at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1310)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1288)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
         at weblogic.rjvm.MsgAbbrevOutputStream.writeObject(MsgAbbrevOutputStream.java:614)
         at weblogic.rjvm.MsgAbbrevOutputStream.marshalCustomCallData(MsgAbbrevOutputStream.java:319)
         at weblogic.rjvm.MsgAbbrevOutputStream.transferThreadLocalContext(MsgAbbrevOutputStream.java:149)
         at weblogic.rmi.internal.ReplyOnError.run(ReplyOnError.java:54)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    2007-10-18 08:38:05,244 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] DEBUG org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean - Could not connect to remote EJB [com.gfs.corp.component.price.customerbid.PCBMaint] - retrying
    org.springframework.remoting.RemoteConnectFailureException: Could not connect to remote service [com.gfs.corp.component.price.customerbid.PCBMaint]; nested exception is weblogic.rjvm.PeerGoneException: ; nested exception is:
         java.rmi.UnmarshalException: Incoming message header or abbreviation processing failed ; nested exception is:
         java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: weblogic.jndi.internal.ApplicationNamingNode
    thank you

  • I need help with simple problems. im a student.

    i'd like to be advanced with my studies so i will post questions.. i need help on how to answer. thank you.
    1. create a java program that will evaluate if the value entered is a positive, negative, vowel, consonant and special characters.
    im actually done with the positive and negative using if else statements.. i used an integer data type. now my question is how do conjoin the characters when i need to evaluate a vowel and a consonant. i cant use char either. please help. i dont know what to do yet.
    2. create java program that will translate the input from numbers to words. e.g. input:123 output: one hundred twenty-three.
    i have an idea to use a switch case statement. but i have no idea on how will i be able to do it. so if you guys can help me.. well then thankies..

    Welcome to the Sun forums. First, please note that you have posted in the wrong forum. This forum is for topics related to Sun's JavaHelp product. You should post your questions in the New to Java forum.
    As part of your learning, you will have to develop the ability to select an approach to a problem, create a design that reflects that approach, and then implement the design with code that you create.
    So, it's inappropriate for us to take the problem statement that you have been given and short-circuit your learning process by giving you the implemented problem solution. We can comment on the individual questions that you may have, and point out problems and errors that we see in the code that you develop.
    As a hint, when you are stuck, forget about Java and programming. Just start with a sheet of paper and a pencil, and figure out how to layout the task on paper. The consider how to translate that to programming.
    If you have problems, post short example code that shows the problem, and explain your question clearly. We can't read minds.
    Make sure you post code correctly so that it's not mangled by the forum software, and so that formatting is maintained. Select your typed or pasted code block and press the CODE button above the typing area.

  • Need help to handle java FX stuffs...........??

    i am very much new to Java FX i want to do a login acceptance and rejection operation.like ::
    client will click on the button it will open up the window of created by java FX which will give the login screen*(in this case i would like to mention one thing i all ready have a page like usercheck.jsp which is checking if the user is already loged in or not so need to call this JAVA FX window from that page.)*.This java FX window should have a text field and a password field to match with database.it will show a progressber while it is matching the user name password with database.If the login is correct it will give the user the session stuff and allow him to access**(ie.it will be forworded to the page say,cart.jsp)** otherwise it will give a alert message "login faild".any idea about it..............what should i do now???my database is in access and it connected to my program by DA.java.please guide me what should i do,step by step?and consulting with [http://jfx.wikia.com/wiki/SwingComponents]
    now guide me.............
    i have just created a swing button say "click me to login" on a UNDECORATED window............so what next.........
    Edited by: coolsayan.2009 on May 7, 2009 3:35 PM

    my DA.java is like::
    package shop;
    import java.sql.*;
    public class DAClass {
         private static Connection conn;
         private static ResultSet rs;
         private static PreparedStatement ps;
         public static void connect(String dsn, String un, String pwd) {
              try {
                   //access
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   conn=DriverManager.getConnection("jdbc:odbc:"+dsn,un,pwd);
              catch(Exception e) {
         public static boolean chkPwd(String un, String pwd) {
              try {
                   boolean b=false;
                   ps=conn.prepareStatement("select * from cust_info where cust_name=? and cust_pwd=?");               
                   ps.setString(1,un);
                   ps.setString(2,pwd);
                   rs=ps.executeQuery();
                   while(rs.next()) {
                        b=true;
                   return b;
              catch(Exception e) {
                   return false;
         public static ResultSet getCat(){
              try {
                   ps=conn.prepareStatement("select * from item_category where cat_parent=0 order by cat_name");               
                   rs=ps.executeQuery();
                   return rs;
              catch(Exception e) {
                   return null;
         public static ResultSet getSubCat(int cat_id){
              try {
                   ps=conn.prepareStatement("select * from item_category where cat_parent=? order by cat_name");               
                   ps.setInt(1,cat_id);
                   rs=ps.executeQuery();
                   return rs;
              catch(Exception e) {
                   return null;
         public static ResultSet getItems(int cat_id){
              try {
                   ps=conn.prepareStatement("select * from item_info where cat_id=? order by title");               
                   ps.setInt(1,cat_id);
                   rs=ps.executeQuery();
                   return rs;
              catch(Exception e) {
                   return null;
         public static boolean insertOd(int order_id,String cust_id, String dt, String st, double amt,String pro)
              try{
                   ps=conn.prepareStatement("insert into cust_order values (?,?,?,?,?,?)");
                   ps.setInt(1,order_id);
                   ps.setString(2,cust_id);
                   ps.setString(3,dt);
                   ps.setString(4,st);
                   ps.setDouble(5,amt);
                   ps.setString(6,pro);
                   ps.executeUpdate();
                   return true;
                   catch(Exception e)
                        return false;
         public static boolean draft_det(int order_id,String bank_name,String draft_no,String draft_date,String branch,double amount)
              try{
                   ps=conn.prepareStatement("insert into draft_det values (?,?,?,?,?,?)");
                   ps.setInt(1,order_id);
                   ps.setString(2,bank_name);
                   ps.setString(3,draft_no);
                   ps.setString(4,draft_date);
                   ps.setString(5,branch);
                  ps.setDouble(6,amount);
                   ps.executeUpdate();
                   return true;
                   catch(Exception e)
                        return false;
         public static int getOrderId()
              try{
                   int id=0;
                   ps=conn.prepareStatement("select Max(order_id) from cust_order");
                   rs=ps.executeQuery();
                   while(rs.next()){
                        id= rs.getInt(1);
                   return id;
              catch(Exception e)
                   return 0;
    public static boolean credit_det(int order_id,String credit_no,String credit_type,String pin_no)
              try{
                   ps=conn.prepareStatement("insert into credit_det values (?,?,?,?)");
                   ps.setInt(1,order_id);
                   ps.setString(2,credit_no);
                   ps.setString(3,credit_type);
                   ps.setString(4,pin_no);
                   ps.executeUpdate();
                   return true;
                   catch(Exception e)
                        return false;
         public static boolean detailOrder(int order_id,int item_id,int item_number,double item_price)
              try{
                   ps=conn.prepareStatement("insert into order_det values (?,?,?,?)");
                   ps.setInt(1,order_id);
                   ps.setInt(2,item_id);
                   ps.setInt(3,item_number);
                   ps.setDouble(4,item_price);
                   ps.executeUpdate();
                   return true;
                   catch(Exception e)
                        return false;
         public static UserInfo getUserDet(String un) {
              try {
                   ps=conn.prepareStatement("select * from cust_info where cust_name=?");
                   ps.setString(1,un);
                   rs=ps.executeQuery();
                   UserInfo user=null;
                   while(rs.next()) {
                        String uname=rs.getString(1);
                        String pass=rs.getString(2);
                        String fname=rs.getString(3);
                        String lname=rs.getString(4);
                        String addr=rs.getString(5);
                        String city=rs.getString(6);
                        String state=rs.getString(7);
                        String country=rs.getString(8);
                        String contact=rs.getString(9);
                        String question=rs.getString(10);
                        String answer=rs.getString(11);
                        String email=rs.getString(12);
                        String mobile=rs.getString(13);
                        user=new UserInfo(0,fname,lname,addr,city,state,country,contact,question,answer,email,mobile,uname,pass);
                        return user;
              catch(Exception e) {
                   return null;
         public static boolean userInsert(String fname,String lname,String addr,String city,String state,String country,String contact,String question,String answer,String email,String mobile,String uname,String pass ){
              try{
                   ps=conn.prepareStatement("insert into cust_info  values (?,?,?,?,?,?,?,?,?,?,?,?,?)");
                   ps.setString(1,uname);
                   ps.setString(2,pass);
                   ps.setString(3,fname);
                   ps.setString(4,lname);
                   ps.setString(5,addr);
                   ps.setString(6,city);
                   ps.setString(7,state);
                   ps.setString(8,country);
                   ps.setString(9,contact);
                   ps.setString(10,question);
                   ps.setString(11,answer);
                   ps.setString(12,email);     
                   ps.setString(13,mobile);
                   ps.executeUpdate();     
                   return true;               
              catch(Exception e)
                   return false;
         public static boolean chackuname(String un) {
              try {
                   boolean b=false;
                   ps=conn.prepareStatement("select * from cust_info where cust_name=?");
                   ps.setString(1,un);
                   rs=ps.executeQuery();
                   while(rs.next()) {
                        b=true;
                   return b;               
              catch(Exception e) {
                   return false;
         public static boolean adminChk(String un,String pass){
         try{
              boolean b=false;
              ps=conn.prepareStatement("select * from admin where username=? and password=?");
                   ps.setString(1,un);
                   ps.setString(2,pass);
                   rs=ps.executeQuery();
                   while(rs.next())
                        b=true;
                   return b;
         catch(Exception e){
              return false;
         public static String getStatus(int cust_id)
              try{
                   String status=null;
                   ps=conn.prepareStatement("select order_status from cust_order where cust_id=?");
                   ps.setInt(1,cust_id);
                   rs=ps.executeQuery();
                   while(rs.next()){
                        status= rs.getString(1);
                   return status;
              catch(Exception e)
                   return null;
         public static boolean chkCatagory(String cat)
              boolean b=false;
              try{
                   ps=conn.prepareStatement("select * from item_category where cat_name=? ");
                   ps.setString(1,cat);
                   rs=ps.executeQuery();
                   while(rs.next())
                        b=true;
                   return b;     
              catch(Exception e)
                   return false;
         public static int getMaxCatId(){
              try{
                   int id=0;
                   ps=conn.prepareStatement("select MAX(cat_id) from item_category");
                   rs=ps.executeQuery();
                   while(rs.next())
                        id=rs.getInt(1);
                   return id;     
              catch(Exception e)
                   return -1;
         public static boolean catInsert(int catId, String cat, int par)
              boolean flag=false;
              try{
                        ps=conn.prepareStatement("insert into item_category values(?,?,?)");
                        ps.setInt(1,catId);
                        ps.setString(2,cat);
                        ps.setInt(3,par);
                        ps.executeUpdate();
                        flag=true;
                        return flag;
              catch(Exception e)
                   return false;

  • Need Help in Simple SQL

    Hi,
    I need help. I did not know how to make this select statement run without error.
    select iif(max(numberseries) is null,'0',numberseries+ 1) from registration
    Thank

    Hi ,
    May i know what are you trying to do ,
    if you are trying to use if else in query, then it wont work
    if else is not valid in query.
    try to use decode or case , such that your need can be full filled
    Thank you
    Raj Deep.A

  • Need Help With Simple ABAP Code

    Hello,
    I'm loading data from a DSO (ZDTBMAJ) to an Infocube (ZCBRAD06). I need help with ABAP code to some of the logic in Start Routine. DSO has 2 fields: ZOCTDLINX & ZOCBRDMAJ.
    1. Need to populate ZOCPRODCD & ZOCREFNUM fields in Infocube:
        Logic:-
        Lookup /BI0/PMATERIAL, if /BIC/ZOCBRDMAJ = /BIC/OIZOCBRDMAJ
        then /BIC/ZOCPRODCD = ZOCPRODCD in Infocube
               /BIC/ZOCREFNUM = ZOCREFNUM in Infocube         
    2. Need to populate 0G_CWWTER field in Infocube:
        Logic:
        Lookup /BIC/PZOCTDLINX, if /BIC/ZOCTDLINX = BIC/OIZOCTDLINX
        then G_CWWTER = 0G_CWWTER in Infocube.
    I would need to read single row at a time.
    Thanks!

    I resolved it.

  • Need help! Algorithm java implementation

    Hi,
    I am trying to make a simple java program based on an algorithm which will print out all the odd numbers in a stack. But first it should put all the numbers into an auxiliary stack from the original stack but in reverse order. Then the algorithm should put the odd numbers into the new stack (copystack)
    Algorithm
    To obtain a stack containing only the elements in Stack thisStack which are at odd depth
    where thisStack has depth depth
    1. Let copyStack and sAux be empty ArrayStacks
    2. Let size be equal to depth
    3. Repeat size times
    3.1 Let elem be the Object returned by popping thisStack
    3.2 Push elem into sAux.
    4. Let oddPosition = 1 ? size modulo 2.
    5. Repeat from numReps = 0 to numReps = size - 1
    5.1 Let elem be the result of popping sAux
    5.2 Push elem into thisStack
    5.2 if numReps mod 2 equals oddPosition
    5.3.1 Push elem into copyStack
    6. Terminate with answer copyStack
    Use the ?push? (i.e. void addLast(Object)) and ?pop? (i.e. Object removeLast()) methods already available
    from class ArrayStack to implement the new method as follows: Take all the elements, one at a time, from the
    original stack into an auxiliary stack. The auxiliary stack now contains the same elements as the original stack,
    but in reverse order. Take the elements from the auxiliary stack onto both the original stack and the new (copy)
    stack if appropriate

    Indeed. It's much less likely he'd double-post too.
    http://forum.java.sun.com/thread.jspa?threadID=5278338&tstart=0

  • Need help writing a Java rule in PDF Forms

    I have created an invoice for my contractors via "forms", and in turn made each cell either a drop down list or "read only" field so they cannot change the rate of pay, etc.  Here is my issue...My first drop down cell is titled "Job Description".  When the contractor selects one of the 8 dropdown options within the Job Description field, I would like it to automatically fill in the hourly rate that is associated with that particular job description (or skill).  I currently have my "rate" cell as a drop down, and I want to make that a read only, and when you select the A1 position from Job Description, it will populate the "rate" field with the appropriate amount for that A1 rate.  I believe this can be done with writing some Java script, but I have never played with Java and I don't really have the time to teach myself.  If anyone can help with me a quick tutorial, or even the formula I should use, so that I can just plug and play, that would be super helpful.  If this is a time consuming issue, I would be interested in paying someone to do it for me. Thank you!

    Hi George,
    I was able to copy my data over to a fresh document, and now it works just fine....thank you so much for your insight and help!
    I have another question if you have a moment. 
    I am trying to do a simple calculation of start time and end time for my employees.  Do I need to do this via a javascript, and if so, what area in properties of the result field should I copy it to?  for the purpose of the script, the fields are as follows:
    DataField1 = start time
    DataField2 = end time
    DataField3 = total time
    I would like to use the h:MM tt format for my time fields if possible.
    I've attached a link to the file through my dropbox account, and you'll notice that I created three new fields at the top of the invoice just to test the time calculations before i mock up the whole document.
    Dropbox - Contractor Invoice Template (1).pdf
    Any help you can give me would awesome! 
    Thank you!!

  • Help me please need help on my java applet

    hi there i have started a final year project on java.
    it is a simple drawing applet however i need to be able to
    save my drawings to a local hard disk. i have tried going through the tutorial but i dnt get it. please can any1 out there help me. my email address is [email protected] if you give me your email address i will mail you my program and maybe you could help me
    Aj

    If you want an applet to write to user's local hard drive, there are many securiy issues that need to be resolved. How to resolve these issues depend on whether the applet uses a plugin (swing) or the browser's native JVM (no plugin, uses AWT only). In any event, the applet will probably need to be signed and the user's browser must be correctly configured. The following link gives you some detail on how to sign an applet that doesn't use swing:
    http://home.attbi.com/~aokabc/FileIO/FileIOdemo.htm
    The instructions on the first two links should point you to the right direction...
    V.V.

  • Need help with simple file sharing application

    I have an assignment to build a Java File Sharing application. Since I'm relatively new to programming, this is not gonna be an easy task for me.
    Therefore I was wondering if there are people willing to help me in the next few days. I will ask questions in this thread, there will be loads of them.
    I already have something done but I'm not nearly halfway finished.
    Is there a code example of a simple file sharing application somewhere? I didn't manage to find it.
    More-less, this is what it needs to contain:
    -client/server communication (almost over)
    -file sending (upload, download)
    -file search function (almost over)
    -GUI of an application.
    GUI is something I will do at the end, hopefully.
    I hope someone will help me. Cheers
    One more thing, I'm not asking for anyone to do my homework. I will only be needing some help in the various steps of building an application.
    As I said code examples are most welcome.
    This is what I have done so far
    Server:
    package ToJeTo;
    import java.io.*;
    import java.net.*;
    public class MultiServer {
        public static ServerSocket serverskiSoket;
        public static int PORT = 1233;
        public static void main(String[] args) throws IOException {
            try {
                serverskiSoket = new ServerSocket(PORT);
            }catch (IOException e) {
                System.out.println("Connection impossible");
                System.exit(1);
            do {
                Socket client = serverskiSoket.accept();
                System.out.println("accepted");
                ClientHandler handler = new ClientHandler(client);
                handler.start();
            } while(true);
    }Client:
    package ToJeTo;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.net.*;
    import java.util.Scanner;
    public class MultiClient {
        public static InetAddress host;
        public static int PORT = 1233;
        public static void main(String[] args) {
            try {
                host = InetAddress.getLocalHost();
            }catch (UnknownHostException uhe) {
                System.out.println("Error!");
                System.exit(1);
            sendMessages();
        private static void sendMessages() {
            Socket soket = null;
            try {
                soket = new Socket(host, PORT);
                Scanner networkInput = new Scanner(soket.getInputStream());
                PrintWriter networkOutput = new PrintWriter(soket.getOutputStream(), true);
                Scanner unos = new Scanner(System.in);
                String message, response;
                do {
                    System.out.println("Enter message");
                    message = unos.nextLine();
                    networkOutput.println(message);
                    response = networkInput.nextLine();
                    System.out.println("Server: " + response);
                }while (!message.equals("QUIT"));
            } catch (IOException e) {
                e.printStackTrace();
            finally {
                try{
                    System.out.println("Closing..");
                    soket.close();
                } catch (IOException e) {
                    System.out.println("Impossible to disconnect!");
                    System.exit(1);
    }ClientHandler:
    package ToJeTo;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class ClientHandler extends Thread {
        private Socket client;
        private Scanner input;
        private PrintWriter output;
        public ClientHandler(Socket serverskiSoket) {
            client = serverskiSoket;
            try {
            input = new Scanner(client.getInputStream());
            output = new PrintWriter(client.getOutputStream(), true);
            } catch (IOException e) {
                e.printStackTrace();
            public void run() {
                String received;
                do {
                received = input.nextLine();
                output.println("Reply: " + received);
                } while (!received.equals("QUIT"));
                try {
                    if (client != null)
                        System.out.println("Closing the connection...");
                        client.close();
                }catch (IOException e) {
                    System.out.println("Error!");
    }Those three classes are simple client server multi-threaded connection.

    Now the other part that contains the search function looks like this:
    package ToJeTo;
    import java.io.*;
    import java.util.*;
    public class User {
        String nickname;
        String ipAddress;
        static ArrayList<String> listOfFiles = new ArrayList<String>();
        File sharedFolder;
        String fileLocation;
        public User(String nickname, String ipAddress, String fileLocation) {
            this.nickname = nickname.toLowerCase();
            this.ipAddress = ipAddress;
            sharedFolder = new File(fileLocation);
            File[] files = sharedFolder.listFiles();
            for (int i = 0; i < files.length; i++) {
                listOfFiles.add(i, files.toString().substring(fileLocation.length()+1));
    public static void showTheList() {
    for (int i = 0; i < listOfFiles.size(); i++) {
    System.out.println(listOfFiles.get(i).toString());
    @Override
    public String toString() {
    return nickname + " " + ipAddress;
    User Manager:
    package ToJeTo;
    import java.io.*;
    import java.util.*;
    class UserManager {
        static ArrayList<User> allTheUsers = new ArrayList<User>();;
        public static void addUser(User newUser) {
            allTheUsers.add(newUser);
        public static void showAndStoreTheListOfUsers() throws FileNotFoundException, IOException {
            BufferedWriter out = new BufferedWriter(new FileWriter("List Of Users.txt"));
            for (int i = 0; i < allTheUsers.size(); i++) {
                    System.out.println(allTheUsers.get(i));
                    out.write(allTheUsers.get(i).toString());
                    out.newLine();
            out.close();
    }Request For File
    package ToJeTo;
    import java.util.*;
    public class RequestForFile {
        static ArrayList<String> listOfUsersWithFile = new ArrayList<String>();
        Scanner input;
        String fileName;
        public RequestForFile() {
            System.out.println("Type the wanted filename here: ");
            input = new Scanner(System.in);
            fileName = input.nextLine();
            for (User u : UserManager.allTheUsers) {
                for (String str : User.listOfFiles) {
                    if (str.equalsIgnoreCase(fileName))
                        listOfUsersWithFile.add(u.nickname);
        public RequestForFile(String fileName) {
            for (User u : UserManager.allTheUsers) {
                for (String str : User.listOfFiles) {
                    if (str.equalsIgnoreCase(fileName))
                        listOfUsersWithFile.add(u.nickname);
        public static List<String> getAll() {
            for (int i = 0; i < listOfUsersWithFile.size(); i++) {
                //System.out.println("User that has the file: " + listOfUsersWithFile.get(i));
            return listOfUsersWithFile;
    }Now this is the general idea.
    The user logs in with his nickname and ip address. He defines his own shared folder and makes it available for other users that log on to server.
    Now each user has their own list of files from a shared folder. It's an ArrayList.
    User manager class is there to store another list, a list of users that are connected with server.
    When the user is searching for a particular file, he is searching through all the users and their respective files lists. Therefore for each loop inside a for each loop.
    Now the problem is how to connect all that with Client and Server class and put it into one piece.
    GUI should look somewhat like this:

  • Need Help with Simple Chat Program

    Hello Guys,
    I'm fairly new to Java and I have a quick question regarding a simple chat program in java. My problem is that I have a simple chat program that runs from its own JFrame etc. Most of you are probably familiar with the code below, i got it from one of my java books. In any case, what I'm attempting to do is integrate this chat pane into a gui that i have created. I attempted to call an instace of the Client class from my gui program so that I can use the textfield and textarea contained in my app, but it will not allow me to do it. Would I need to integrate this code into the code for my Gui class. I have a simple program that contains chat and a game. The code for the Client is listed below.
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    import javax.swing.*;
    public class Client
    extends JPanel {
    public static void main(String[] args) throws IOException {
    String name = args[0];
    String host = args[1];
    int port = Integer.parseInt(args[2]);
    final Socket s = new Socket(host, port);
    final Client c = new Client(name, s);
    JFrame f = new JFrame("Client : " + name);
    f.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent we) {
    c.shutDown();
    System.exit(0);
    f.setSize(300, 300);
    f.setLocation(100, 100);
    f.setContentPane(c);
    f.setVisible(true);
    private String mName;
    private JTextArea mOutputArea;
    private JTextField mInputField;
    private PrintWriter mOut;
    public Client(final String name, Socket s)
    throws IOException {
    mName = name;
    createUI();
    wireNetwork(s);
    wireEvents();
    public void shutDown() {
    mOut.println("");
    mOut.close();
    protected void createUI() {
    setLayout(new BorderLayout());
    mOutputArea = new JTextArea();
    mOutputArea.setLineWrap(true);
    mOutputArea.setEditable(false);
    add(new JScrollPane(mOutputArea), BorderLayout.CENTER);
    mInputField = new JTextField(20);
    JPanel controls = new JPanel();
    controls.add(mInputField);
    add(controls, BorderLayout.SOUTH);
    mInputField.requestFocus();
    protected void wireNetwork(Socket s) throws IOException {
    mOut = new PrintWriter(s.getOutputStream(), true);
    final String eol = System.getProperty("line.separator");
    new Listener(s.getInputStream()) {
    public void processLine(String line) {
    mOutputArea.append(line + eol);
    mOutputArea.setCaretPosition(
    mOutputArea.getDocument().getLength());
    protected void wireEvents() {
    mInputField.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    String line = mInputField.getText();
    if (line.length() == 0) return;
    mOut.println(mName + " : " + line);
    mInputField.setText("");

    Thanks for ur help!i have moved BufferedReader outside the loop. I dont think i am getting exception as i can c the output once.What i am trying to do is repeat the process which i m getting once.What my method does is first one sends the packet to multicasting group (UDP) and other method receives the packets and prints.

  • Beginner needs help with simple code.

    I just statrted learnind java, and I need some help with this simple program. For some reason everytime I enter my Farenheit value, the Celsius conversion returns as 0.0. Would really appreciate the help. Thanks.
    Here's the code:
    public class TempConverter
    public static void main(String[] args)
    double F = Double.parseDouble(args[0]);
    System.out.println("Temperature in Farenheit is: " + F);
    double C = 5 / 9;
    C *= (F - 32);
    System.out.println("Temperature in Celsius is: " + C);
    }

    double C = 5 / 9This considers "5" and "9" to be integers and does an integer division, discarding the remainder. The result of that division is 0. Trydouble C = 5.0/9.0;

  • Need help with a java chat software!!! Anyone pls give ideas

    I need to implement a chat protocol with sockets for my course!!
    As of now i have only got to the simple client server application with sockets and have a user interface with panels.
    How could I proceed...
    How should i use login names and passwords??
    Should i use if else loops to specify :
    various headers like
    login
    pass
    send
    exit
    if you could point out som esite that will be helpful or even a book it would be of great help!!

    Don't use if/else loops, they have this nasty habit of not existing.
    My quarter-pence:
    For passwords, use a map which maps name/hashed password. That way, you'll never actually store the password.

  • Need Help with a JAVA programming assignment

    How do I write a JAVA program that could be used as the start of an MS-DOS/Windows simulation of the IEEE 802.3 protocol? I am to only code the parts necessary to build the 802.3 frame. For the initial implementation, the Checksum function need not be a CRC function, and the Destination and Source addresses wil be in input, stored, and output, and in dotted-decimal format.
    I need:
    1. A record to describe the frame, with each field being a (byte-) string of the required size, except that the Data field is of variable size. Although the "Source address" and "Destination address" would be 6 bytes for a real implementation, for this first implementation you can either assume they'll be text strings in the usual "dotted decimal" form (e.g. "14.04.05.18.01.25" as a typical example--from Tanenbaum, p. 429), or 6 hex digits.
    2. Suitable constant declarations for values such as the standard "Preamble" and "Start of Frame" values.
    3. Suitable functions to Get the three variable values "Destination address", "Source address", and "Data" from the standard input device.
    4. A suitable function to display each of the fields of a given frame in a format such as:
    Preamble: ...
    StartofFrame: ...
    Destination: ...
    etc.
    5. A suitable function to generate a "Pad" field if necessary.
    6. A "dummy" Checksum-generating function which just takes the first 32 bits (4 bytes) of the Data (or Data+Pad, if necessary) rather than an actual CRC algorithm.
    I have no experience with Java. Can you help me or start me in the right direction?
    Thanks...........TK

    If you have no experience with Java, then it seems to me your first step should be to start learning the language. But it's difficult to advise how, since we don't know anything about your background. There are many good books available on Java, some are for beginners and some are for advanced programmers, so I'd suggest you go somewhere that has a large selection and start looking for something that doesn't seem completely over your head.

Maybe you are looking for