JFrame instance called from a Thread

Hi All,
I have an application that fetches data from a database. I have a thread that displays a 'Please wait' message in a JFrame while the software fetches data from the databse.
The trouble is that the message does not appear on the JPanel untill the data is completely fetched from the database.
The frame appears with a button, but no message on it!
Please help.
Thanks.
Anuj.
Code :
// calling method
InformationBox ib = new InformationBox("Please wait while the software fetches data from the database");
ib.setTitle("Please wait");
ib.setLocation(100,100);
ib.setVisible(true);
ib.pack();
public class InformationBox extends javax.swing.JFrame implements ActionListener {
JButton ok = new JButton("OK");
JPanel text = new JPanel();
JPanel okp = new JPanel();
JLabel center = new JLabel();
FlowLayout f1 = new FlowLayout();
FlowLayout f2 = new FlowLayout();
BorderLayout b1 = new BorderLayout();
String comments ="" ;
public InformationBox(String sd) {
this.comments=sd;
jbInit();
public void jbInit() {
this.getContentPane().setLayout(b1);
text.setLayout(f1);
text.add(center);
center.setLayout(new FlowLayout());
center.setText(comments);
ok.addActionListener(this);
okp.setLayout(new FlowLayout());
okp.add(ok);
getContentPane().add(center, BorderLayout.CENTER);
getContentPane().add(okp, BorderLayout.SOUTH);
public void actionPerformed(ActionEvent e) {
if (e.getSource() == ok) {
//eq.setEnabled(true);
this.setVisible(false);
}

// calling method
InformationBox ib = new InformationBox("Please wait while the software fetches data from the database");
ib.setTitle("Please wait");
ib.setLocation(100,100);
ib.setVisible(true);
ib.pack();--------------------------------
public class InformationBox extends javax.swing.JFrame implements ActionListener {
JButton ok = new JButton("OK");
JPanel text = new JPanel();
JPanel okp = new JPanel();
JLabel center = new JLabel();
FlowLayout f1 = new FlowLayout();
FlowLayout f2 = new FlowLayout();
BorderLayout b1 = new BorderLayout();
String comments ="" ;
public InformationBox(String sd) {
this.comments=sd;
jbInit();
public void jbInit() {
this.getContentPane().setLayout(b1);
text.setLayout(f1);
text.add(center);
center.setLayout(new FlowLayout());
center.setText(comments);
ok.addActionListener(this);
okp.setLayout(new FlowLayout());
okp.add(ok);
getContentPane().add(center, BorderLayout.CENTER);
getContentPane().add(okp, BorderLayout.SOUTH);
public void actionPerformed(ActionEvent e) {
if (e.getSource() == ok) {
//eq.setEnabled(true);
this.setVisible(false);
}

Similar Messages

  • Independent stateful calls from different threads on one destination

    Hello SAP-Experts,
    i'm dealing with the problem on the Web AS to guarantee some independent stateful call sequences for different calling threads.
    One application running on a WAS (the WAS-app) is called by different clients to pass some data. The WAS-app has to distribute the data to another system by using one RFC-destination.
    As i have understood i have to guarantee thread-safe sessions for stateful calls from different thread by implementing a custom SessionReferenceProvider that binds the session to the thread. I have done this.
    My problem is to register my custom SessionReferenceProvider to the WAS environment. By trying i get the following error:
    [java.lang.IllegalStateException: SessionReferenceProvider already registered [com.sap.engine.sessionmgmt.jco.applib.impl.SessionReferenceProviderImpl]]
    Does anyone can tell me how to register the custom SessionReferenceProvider on a WAS?
    Thanks and greetings
    Robert

    Hi Robert,
    You can first try stopping a Java application named sessionmgmtjcoapplib from Star&Stop, then register yours sessionReferenceProvider again.
    Jian

  • Make Calls From Message Threads

    Regard From Sweden
    I love the phone, I've had it almost a week now and the communication possibilities are endless.  My job just got so much easier. Today however, I received an SMS from someone and then I was going to try to call them and realized that I could not do it. On my old Android, all I had to do was swipe the message. But that did not work here. I have been searching in Google and here under the following titles:
    “Make calls from message threads”
    “Ring from SMS”
    I have found nothing. Part of the problem is always coming up with the right search words. Surely one should be able to dial the number of a recieved SMS Thread  without having to memorize the number.  I also have had the problem of being unable to send longer SMS/Chat messages but I shall try turning off the WiFi as some have met with success with that measure
    My last problem is with Nokia’s City Lens. It worked fine the first 3 days that I had it, but now it won’t go past the Figure 8 page.
    Happy to report that battery life gets better and better with every charge. It's fun to be a telephone pioneer, I'm happy to be at the forefront for once instead of at the back. All my Iphone friends gawked at the new phone saying "What is that?"
    S-E

    Figured out the City Lens problem too. I have the phone i a Black Vegan Folio Wallet Case  even though the lens and camera are not covered by the case, the remainder of the backside is covered by a black plastic cóver. City Lens works out of the case, but not in it.

  • WCF called from Sharepoint - thread abort exception

    Hello,
    we have an SP web part calling WCF service using simple http binding. SP and WCF are located on different servers in different countries, so not at the same machine. Using WCF we send/receive some files, which are processed at the WCF server site, parsed
    and stored to database. It takes some time, of course, but usually not more than minute or 2. On development server it works normally but on production server we are facing problems like
    System.Threading.ThreadAbortException: Thread was being aborted. at System.Net.UnsafeNclNativeMethods.OSSOCK.recv(IntPtr socketHandle, Byte* pinnedBuffer, Int32 len, SocketFlags socketFlags) at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset,
    Int32 size, SocketFlags socketFlags, SocketError& errorCode) at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.Connection.SyncRead(HttpWebRequest
    request, Boolean userRetrievedStream, Boolean probeRead) at System.Net.ConnectStream.ProcessWriteCallDone(ConnectionReturnResult returnResult) at System.Net.HttpWebRequest.GetResponse() at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan
    timeout) at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
    msgData, Int32 type) at DHI.FRMP.Sharepoint.Tasks.MCSPConnector.IMCSPConnector.TaskUpdate(TaskUpdateRequest request) at DHI.FRMP.Sharepoint.Tasks.TaskEditSave.TaskEditSave.btnSaveChanges_Click(Object sender, ImageClickEventArgs e)
    or
    System.Threading.ThreadAbortException: Thread was being aborted. at System.Threading.WaitHandle.WaitOneNative(SafeHandle waitableSafeHandle, UInt32 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext) at System.Threading.WaitHandle.InternalWaitOne(SafeHandle
    waitableSafeHandle, Int64 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext) at System.Net.LazyAsyncResult.WaitForCompletion(Boolean snap) at System.Net.Connection.SubmitRequest(HttpWebRequest request, Boolean forcedsubmit) at System.Net.ServicePoint.SubmitRequest(HttpWebRequest
    request, String connName) at System.Net.HttpWebRequest.SubmitRequest(ServicePoint servicePoint) at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) at System.Net.HttpWebRequest.GetRequestStream() at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
    at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout) at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout) at System.ServiceModel.Channels.RequestChannel.Request(Message
    message, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage
    methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at DHI.FRMP.Sharepoint.Tasks.MCSPConnector.IMCSPConnector.GetTaskCatchmentList(GetTaskCatchmentListRequest
    request) at DHI.FRMP.Sharepoint.Tasks.TaskAdd.ddlWaterRegion_SelectedIndexChanged(Object sender, EventArgs e)
    We have already checked that the client is properly closed and disposed. We also know that the web service call is processed correctly (from the logs).
    Streams are closed.
    Sharepoint timeout for long operation is set to 3600.
    WCF is hosted in windows service application, used .NET 4.0. WCF config:
    <system.serviceModel>
    <client />
    <bindings>
    <basicHttpBinding>
    <binding name="StreamedHTTP" closeTimeout="04:01:00" openTimeout="04:01:00"
    receiveTimeout="04:10:00" sendTimeout="04:01:00" maxBufferSize="2147483647"
    maxReceivedMessageSize="2147483647" messageEncoding="Mtom" transferMode="Streamed">
    <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
    maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
    </binding>
    </basicHttpBinding>
    </bindings>
    <services>
    <service name="DHI.FRMP.MCSPConnector.MCSPConnector">
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="StreamedHTTP"
    contract="DHI.FRMP.MCSPConnector.IMCSPConnector">
    <identity>
    <dns value="localhost" />
    </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    </service>
    </services>
    <behaviors>
    <serviceBehaviors>
    <behavior>
    <!-- To avoid disclosing metadata information,
    set the values below to false before deployment -->
    <serviceMetadata httpGetEnabled="True" httpsGetEnabled="False"/>
    <!-- To receive exception details in faults for debugging purposes,
    set the value below to true. Set to false before deployment
    to avoid disclosing exception information -->
    <serviceDebug includeExceptionDetailInFaults="True"/>
    </behavior>
    </serviceBehaviors>
    </behaviors>
    Client creation code
    public static IMCSPConnectorChannel CreateWCFclient(out ChannelFactory<IMCSPConnectorChannel> factory)
    BasicHttpBinding myBinding = new BasicHttpBinding();
    TimeSpan timeOut = new TimeSpan(4, 1, 0);
    int maxSize = 2147483647;
    myBinding.CloseTimeout = timeOut;
    myBinding.OpenTimeout = timeOut;
    myBinding.ReceiveTimeout = timeOut;
    myBinding.SendTimeout = timeOut;
    myBinding.AllowCookies = false;
    myBinding.BypassProxyOnLocal = false;
    myBinding.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;
    myBinding.MaxBufferSize = maxSize;
    myBinding.MaxBufferPoolSize = maxSize;
    myBinding.MaxReceivedMessageSize = maxSize;
    myBinding.MessageEncoding = WSMessageEncoding.Mtom;
    myBinding.TextEncoding = System.Text.Encoding.UTF8;
    myBinding.TransferMode = TransferMode.Streamed;
    myBinding.UseDefaultWebProxy = true;
    myBinding.ReaderQuotas.MaxDepth = 128;
    myBinding.ReaderQuotas.MaxStringContentLength = maxSize;
    myBinding.ReaderQuotas.MaxArrayLength = maxSize;
    myBinding.ReaderQuotas.MaxBytesPerRead = maxSize;
    myBinding.ReaderQuotas.MaxNameTableCharCount = maxSize;
    ChannelFactory<IMCSPConnectorChannel> myFactory = null;
    //SPSecurity.RunWithElevatedPrivileges(delegate()
    var constants = new Settings(SPContext.Current.Site);//siteelev);
    string endpointAddress = constants.WcfUrl;
    EndpointAddress myEndpoint = new EndpointAddress(endpointAddress);
    myFactory = new ChannelFactory<IMCSPConnectorChannel>(myBinding, myEndpoint);
    IMCSPConnectorChannel channel = myFactory.CreateChannel();
    factory = myFactory;
    return channel;
    Client and factory are both disposed after each usage.
    this is the simplified code with some comments
    IMCSPConnectorChannel channel = CommonFunctions.CreateWCFclient();
    using (var proxy = channel.Wrap<IMCSPConnectorChannel>())
    var svcClient = proxy.BaseObject;
    try
    // do something - works ok
    if (success)
    //try update
    try
    //time consuming WCF method - sometimes 2 minutes, however it passes and in the WCF log is record about it just a second before it crashes back here
    svcClient.TaskUpdate(new TaskUpdateRequest(_taskID));
    catch (FaultException fe)
    //some processing here - not reached
    catch (Exception ue)
    //here it goes to - exception is caught and
    success = false;
    siteelev.WriteLogError(String.Format("Task '{0}' - task update fail on general exception: {1}", _taskID, ue.ToStringWithInnerExceptions()));
    //previos line is processesd, no more code exists after that
    //go back to folder if WCF returns success
    if (success)
    //not reached (success has been set to false when it crashed)
    else
    siteelev.WriteLogInfo("Some log text");
    //this is ALSO NOT reached!! why, I don't understand
    catch (Exception ee)
    // it goes to here!! why ? - the exception has been already handled!
    throw;;
    I don't understand why it goes to the second catch when the exception has been already hadled in previous catch and why it doesn't go into success=false block.
    Any idea what can be wrong?
    Many thanks
    Filip

    Hi,
    thanks for your reply. Now it seems that everything works (I'm still keepng my fingers crossed ;-)
    What we did:
    1) to the page I added 
    protected void Page_Load(object sender, EventArgs e)
                    this.Page.Server.ScriptTimeout = 3600;
    2) to WCF confing at server side we added 
     <serviceThrottling maxConcurrentCalls="100" maxConcurrentSessions="100"/>
    But if this is what helped, I don't know. The timeout had to be already set in cofig files, but this is only what the SP server administrator claimed, I haven't done it personally. This seems to be much clear
    for me.

  • Error when running backend call in a thread

    Hi,
    When trying to execute a RFC call from a thread in a webdynpro componennt, I am getting the follwing error.
         Unable to access Task Scope in DynamicRFCModelClass. Either run in Engine, or turn Test mode on in WDModelFactory!
    Thnakd and Regards,
    Aditya

    Hi Aditya
    I think that WebDynpro Java application cannot launch any threads in general. The reason is the WebDynpro application is fully controlled by WebDynpro framework (container), but your custom thread launched is working outside the WebDynpro framework and cannot properly access all the WebDynpro API and services.
    BR, Siarhei

  • Killing an exec'ed process from another thread

    Hi all,
    I written an application that executes some external OS - processes. There is a dispatcher thread, that starts the execution threads for some jobs. Every execution thread creates a Processes by calling runtime.exec(), adds this object to a TreeMap ( member of the dispatcher ), creates two threads for reading the output of the process ( sdtout & stderr ) and calls p.waitFor(). From this moment this thread is blocked. After the process is done, the results will be processed by this thread etc. Now I want to go ahead and let the application user kill the process. For them I let the dispatcher - thread, that has also a reference to the executed process to call destroy of it if necessary during the execution thread is blocked by waitFor() and two output threads are reading stdout & stderr. The problem is however that destroy() - call from another thread doesn't kill the subprocess. The subprocess is running until it's done or terminated from out of jvm. Have you an idea or example?
    Thanks a lot & regards
    Alex

    >
    I know you have been discussing your problem is that
    you can't kill a "sleep" process. But just to be
    sure, I tested your description by one thread exec-ing
    a "not-sleep" program, and then another thread had no
    trouble killing it.
    I took your code and wrote a program around it such
    that
    Thread1 :
    - creates a Job (but not a "sleep" job); creates a
    JobMap ; puts Job in JobMap
    - starts Thread2 (passing it JobMap)
    - sleeps 15 seconds
    - calls Job.kill() (your method)
    Thread2 :
    - gets Job from JobMap
    - calls Job.execute() (your method)
    It's quick and dirty and sloppy, but it works. The
    result is when the kill takes place, the execute
    method (Thread2) wakes from its waitFor, and gets
    exitValue() = 1 for the Process.
    so,
    In order to kill the sleep process, which (according
    to BIJ) is not the Process that you have from exec
    call, maybe the only way to kill it is to get its PID
    an exec a "kill -9" on it, same as you said you had to
    do from the commandline. I don't know if you can get
    the PID, maybe you can get the exec-ed process to spit
    it onto stdout or stderr?
    (I am on win, not *nix, right now, so I am just
    throwing out a suggestion before bowing out of this
    discussion.)
    /MelHi Mel,
    yes, it should work right on windows because you created probably the shell by cmd /c or something like this. If you kill the cmd - process, everithing executed by the interpretter will be killed too. My application is running on Windows and unix. On unix I have to execute the process from a shell ( in my case it is the born shell ). The problem is however, that the born shell has another behaviour as cmd and doesn't die. Do you have an idea how to get the pid of the process started by sh without command line? To kill the processes from the command line is exactly what my customers do now. But they want to get "a better service" ...:-)
    Regards
    Alex

  • Call EJB from a thread , pb with lookup

    Hello,
    I have seen taht it is possible to call an EJB within a thread that can act as a client. But in my case when the thread calls the EJB method the lookup failed. I do exactly the same like if I call the ejb from an external client.
    In my case I have got the following architecture:
    one MDB which receive a message the pass the a "manager of thread" which select a thread and then this thread calls a session bean. Everything goes well until the thread call the EJB method and at this time the lookup fail. I call from local interface as I constructed my jar with all this components inside, i.e the MDB, the thread manager, threads and the session bean.
    I tried to call the session bean from the MDB in the same way I have done from the thread and in that configuration its ok.
    Is there a specific manner to lookup an ejb when we want to call it from a thread or simply this configuration is completely impossible?
    Thanks for any advice

    insert the following code before creating the InitialContext:
    Thread.currentThread().setContextClassLoader(getClass().getClassLoader());

  • JNI calls only work if sent from main thread?!?

    Hi,
    I searched through the forum for a couple of hours now, and found that a lot of developers seem to have problems with JNI and threads. However, I couldn't find a solution to my problem so far...hope you can help!
    We need to send requests to a DDE Server from our Java application. For that reason, we implemented a very small DLL using Delphi, which calls the DDE Server and returns the result as a string. Using JNI, we call this DLL from Java.
    Everything works fine, as long as we call the DDE Server (via JNI and the DLL) from the main thread of the Java application. But everytime we call it from another Java thread, our DDL reports that it can't get a connection to the DDE Server. This is especially awkward if you want to make calls as a reaction to GUI events, since then the call is sent by the Event Dispatch Thread of the Java runtime.
    This does not seem to be a multi-threading problem, since we do never send multiple requests at the same time. It simply depends on the thread, from which the call is sent.
    Any hints are appreciated very much.
    Thanks!
    Thilo

    We are a step further now...thus the problem to be solved changed a little bit.
    The former assumption, that connecting to the DDE server does only work from the main thread was false. It only seemed like that, because we called System.loadLibrary() to in the main thread to load the DLL . In fact, the connection to the DDE server works from any thread - you just have to make sure that System.loadLibrary() is invoked in this same thread.
    This means: if System.loadLibrary() is invoked in the Event Dispatch Thread, we can call the DDE Server from this thread, which is what we primarily wanted to do. So our problem is solved.
    Anyway, I made some more tests to find out, what happens if I start multiple threads, with each of them calling System.loadLibrary(). The result was, that only the first thread is successful. This means: the first thread, which loads the DLL is the only thread that is able to connect to the DDE server. All other threads won't get a connection.
    What could be the reason for that?

  • VI calling from a multi-thread Teststand

    Hello,
    My test system tests four UUTs at the same time(with batch mode in TS), the code is based on LabVIEW and call from TS, so every step the same VI will be accessed by four thread. however, it runs quite slow even i set the reentrant execution in VI propertise.
    My Quesition:
    Can I do it like this in multi-thread mode of TS?
    How can I make it fast? (convert VI to dll?????)
    Any help will be appreciated.
    Thanks,Steven

    Hello Allen,
    Thanks for your help.
    Problem: I have a LabVIEW VI with parallel code blocks. These blocks run in parallel as expected when I run my VI directly or from a top level VI. However, the code blocks seem to run sequentially when I call my VI from TestStand. Why is this happening and how can I fix it?
    Solution: In order to fix this behavior, simply set the VI Properties of "Execution" of your LabVIEW VI to "Other 1" or "Other 2". This change will make the parallel code blocks in your LabVIEW VI run in parallel as expected. To change this setting, from your LabVIEW VI, go to File»VI Properties. Select the Execution category. Change the Preferred Execution System to be either other 1 or other 2.
    You need to make this change to any LabVIEW VI with parallel code blocks that is called from TestStand. The reason for this is that TestStand is using the LabVIEW ActiveX interface to run LabVIEW VIs. The LabVIEW ActiveX interface sets the caller's execution system to "User Interface" by default. This execution system is not recommended for a VI with parallel code blocks. If your LabVIEW VI's execution system is set to "Same as caller" (which is the default setting when creating a new LabVIEW VI), then it is executed in the User Interface thread when run through the LabVIEW ActiveX interface. This prevents the blocks to be executed in parallel.
    In fact, only one block in my LabVIEW code, but it accessed by four thread from TS. I am sure that my VI can be accessed by four thread simultaneously if I enable the reentrant excution in VI property. I also have tried what mentioned in above document but no use.
    However, if i only add a 1000ms delay to my LabView code instead of the 'calculation', it is fast enough!  what is happening or something i set wrong?
    I don't want to convert all my LabView code to DLL cos too many VIs here, and difficult for mantenance either.
    Any other good solution???
    Thank you Allen...
    Steven

  • Calling System.exit() from multiple threads

    Hi,
    Why would calling System.exit() from multiple threads cause all the threads to block?
    Laith

    Thanks for your replies.
    I made further tests and the problem is actually not as I described it first.
    I'm using a shutdown hook that would stop all running threads if the program is stopped externally (using ctl-c for example) (I'm not using Thread.stop(), but setting a boolean value to false that would make the thread exit a while() loop in run()) .
    One of the running threads would call System.exit(-1) just before it would exit run().
    This thread is getting blocked if it is stopped by the shutdown hook.
    I know that this is a bad coding practice, bout would still appreciate an explanation to the reason why the thread is actually blocked by System.exit().
    Laith

  • Error while calling ejb service call from BPM service

    Hi,
    We are using the Oracle 11.1.1.5.0
    We are calling ejb service call from BPM service to update the data to Oracle database.
    We are getting the below error when we executing the ejb service call from BPM Service.
    <Error> <EJB> <BEA-010026> <Exception occurred du
    ring commit of transaction Name=[EJB oracle.bpm.bpmn.engine.ejb.impl.BPMNDeliver
    yBean.handleCallback(java.lang.String,java.lang.String,java.lang.String,int,bool
    ean)],Xid=BEA1-45B91984D57960994897(30845116),Status=Rolled back. [Reason=javax.
    transaction.xa.XAException: JDBC driver does not support XA, hence cannot be a p
    articipant in two-phase commit. To force this participation, set the GlobalTrans
    actionsProtocol attribute to LoggingLastResource (recommended) or EmulateTwoPhas
    eCommit for the Data Source = EBSConnection],numRepliesOwedMe=0,numRepliesOwedOt
    hers=0,seconds since begin=1,seconds left=60,XAServerResourceInfo[SOADataSource_
    base_domain]=(ServerResourceInfo[SOADataSource_base_domain]=(state=rolledback,as
    signed=soa_server1),xar=SOADataSource,re-Registered = false),XAServerResourceInf
    o[ArCnTaskForms@EBSConnection@EBSConnection_base_domain]=(ServerResourceInfo[ArC
    nTaskForms@EBSConnection@EBSConnection_base_domain]=(state=rolledback,assigned=s
    oa_server1),xar=weblogic.jdbc.wrapper.JTSEmulateXAResourceImpl@fa5476,re-Registe
    red = false),SCInfo[base_domain+soa_server1]=(state=rolledback),properties=({web
    logic.jdbc.remote.EBSConnection=t3://192.168.10.114:8001, weblogic.transaction.n
    ame=[EJB oracle.bpm.bpmn.engine.ejb.impl.BPMNDeliveryBean.handleCallback(java.la
    ng.String,java.lang.String,java.lang.String,int,boolean)]}),local properties=({w
    eblogic.jdbc.jta.SOADataSource=[ No XAConnection is attached to this TxInfo ]}),
    OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=soa
    server1+192.168.10.114:8001+basedomain+t3+, XAResources={eis/tibjms/Queue, eis
    /activemq/Queue, WLStore_base_domain_BPMJMSFileStore, WLStore_base_domain__WLS_s
    oa_server1, eis/fioranomq/Topic, eis/jbossmq/Queue, eis/Apps/Apps, eis/websphere
    mq/Queue, eis/AQ/aqSample, WLStore_base_domain_SOAJMSFileStore, eis/aqjms/Queue,
    WSATGatewayRM_soa_server1_base_domain, eis/sunmq/Queue, eis/pramati/Queue, SSCo
    nnectionDS_base_domain, eis/tibjms/Topic, eis/tibjmsDirect/Queue, eis/wls/Queue,
    eis/tibjmsDirect/Topic, EDNDataSource_base_domain, eis/wls/Topic, eis/aqjms/Top
    ic, RL3TST_base_domain, ArCnTaskForms@EBSConnection@EBSConnection_base_domain, S
    OADataSource_base_domain, WLStore_base_domain_UMSJMSFileStore_auto_2},NonXAResou
    rces={})],CoordinatorURL=soa_server1+192.168.10.114:8001+base_domain+t3+): weblo
    gic.transaction.RollbackException: Could not prepare resource 'ArCnTaskForms@EBS
    Connection@EBSConnection_base_domain
    JDBC driver does not support XA, hence cannot be a participant in two-phase comm
    it. To force this participation, set the GlobalTransactionsProtocol attribute to
    LoggingLastResource (recommended) or EmulateTwoPhaseCommit for the Data Source
    = EBSConnection
    at weblogic.transaction.internal.TransactionImpl.throwRollbackException(
    TransactionImpl.java:1881)
    at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(Se
    rverTransactionImpl.java:345)
    at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTran
    sactionImpl.java:239)
    at weblogic.ejb.container.internal.BaseLocalObject.postInvoke1(BaseLocal
    Object.java:622)
    at weblogic.ejb.container.internal.BaseLocalObject.__WL_postInvokeTxRetr
    y(BaseLocalObject.java:455)
    at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(Sess
    ionLocalMethodInvoker.java:52)
    at oracle.bpm.bpmn.engine.ejb.impl.BPMNDeliveryBean_of8dk6_ICubeDelivery
    LocalBeanImpl.handleCallback(Unknown Source)
    at com.collaxa.cube.engine.dispatch.message.instance.CallbackDeliveryMes
    sageHandler.handle(CallbackDeliveryMessageHandler.java:47)
    at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(Dispatc
    hHelper.java:140)
    at com.collaxa.cube.engine.dispatch.BaseDispatchTask.process(BaseDispatc
    hTask.java:88)
    at com.collaxa.cube.engine.dispatch.BaseDispatchTask.run(BaseDispatchTas
    k.java:64)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
    utor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
    .java:908)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: javax.transaction.xa.XAException: JDBC driver does not support XA, he
    nce cannot be a participant in two-phase commit. To force this participation, se
    t the GlobalTransactionsProtocol attribute to LoggingLastResource (recommended)
    or EmulateTwoPhaseCommit for the Data Source = EBSConnection
    at weblogic.jdbc.wrapper.JTSXAResourceImpl.prepare(JTSXAResourceImpl.jav
    a:83)
    at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerRe
    sourceInfo.java:1327)
    at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerRe
    sourceInfo.java:513)
    at weblogic.transaction.internal.ServerSCInfo$1.run(ServerSCInfo.java:36
    8)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTunin
    gWorkManagerImpl.java:528)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    .>
    <12 Oct, 2012 12:34:40 PM IST> <Error> <oracle.soa.bpel.engine.dispatch> <BEA-00
    0000> <failed to handle message
    javax.transaction.xa.XAException: JDBC driver does not support XA, hence cannot
    be a participant in two-phase commit. To force this participation, set the Globa
    lTransactionsProtocol attribute to LoggingLastResource (recommended) or EmulateT
    woPhaseCommit for the Data Source = EBSConnection
    at weblogic.jdbc.wrapper.JTSXAResourceImpl.prepare(JTSXAResourceImpl.jav
    a:83)
    at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerRe
    sourceInfo.java:1327)
    at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerRe
    sourceInfo.java:513)
    at weblogic.transaction.internal.ServerSCInfo$1.run(ServerSCInfo.java:36
    8)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTunin
    gWorkManagerImpl.java:528)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    >
    <12 Oct, 2012 12:34:40 PM IST> <Error> <oracle.soa.bpel.engine.dispatch> <BEA-00
    0000> <Failed to handle dispatch message ... exception ORABPEL-05002
    Message handle error.
    error while attempting to process the message "com.collaxa.cube.engine.dispatch.
    message.instance.CallbackDeliveryMessage"; the reported exception is: Error comm
    itting transaction:; nested exception is: javax.transaction.xa.XAException: JDBC
    driver does not support XA, hence cannot be a participant in two-phase commit.
    To force this participation, set the GlobalTransactionsProtocol attribute to Log
    gingLastResource (recommended) or EmulateTwoPhaseCommit for the Data Source = EB
    SConnection
    This error contained an exception thrown by the message handler.
    Check the exception trace in the log (with logging level set to debug mode).
    ORABPEL-05002
    Message handle error.
    error while attempting to process the message "com.collaxa.cube.engine.dispatch.
    message.instance.CallbackDeliveryMessage"; the reported exception is: Error comm
    itting transaction:; nested exception is: javax.transaction.xa.XAException: JDBC
    driver does not support XA, hence cannot be a participant in two-phase commit.
    To force this participation, set the GlobalTransactionsProtocol attribute to Log
    gingLastResource (recommended) or EmulateTwoPhaseCommit for the Data Source = EB
    SConnection
    This error contained an exception thrown by the message handler.
    Check the exception trace in the log (with logging level set to debug mode).
    at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(Dispatc
    hHelper.java:207)
    at com.collaxa.cube.engine.dispatch.BaseDispatchTask.process(BaseDispatc
    hTask.java:88)
    at com.collaxa.cube.engine.dispatch.BaseDispatchTask.run(BaseDispatchTas
    k.java:64)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
    utor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
    .java:908)
    at java.lang.Thread.run(Thread.java:662)
    >
    Could any body help on this issue.It is little bit urgent for us to resolve.
    Thanks in advance.

    Thanks Sudipto Desmukh,
    The link is helpful me to resolve this issue.
    Thanks,
    Narasimha E

  • JTextField update problem when called from PropertyChangeEvent

    Hi,
    I'm trying to create forms that can be dynamically loaded with Class.forname(formName).
    Those forms should always inherit some methods that make it easy to pass data to
    them and receive data from them. The idea is that the data comes from a table which
    sends a hashmap (String column/JTextField-name + String Value pairs) with firePropertyChanged
    as soon as a new row is seleceted. The JTextFields in the form are marked with setName("FieldName") that has to correspond to the name of the columns of the table.
    My problem is that I can't update the fields in my form when I'm calling getRow(HashMap)
    from within propertyChangeEvent but that's necessary to keep the forms flexible.
    JTextFieldName.setText(newText) just won't work. But it works when I call getRow(HashMap)
    from the constructor. SwingWorker and threads to update the form didn't help.
    I don't need to call pack() / update() / repaint() on the JFrame, do I ??
    update() / validate() / repaint() etc. didn't work on the JTextField themselves.
    Below is the code for one of the test-forms (just a JPanel that is inserted in a frame)
    with all of it's methods. Does anybody have a solution to this problem ??
    Thanks for taking time for that !!
    Benjamin
    * testTable.java
    * Created on 15. April 2004, 16:12
    package viewcontrol.GUI;
    * @author gerbarmb
    import javax.swing.*;
    import java.awt.*;
    import java.beans.*;
    import java.util.*;
    public class testTable extends javax.swing.JPanel
              implements
                   java.awt.event.KeyListener,
                   java.beans.PropertyChangeListener {
          * public static void main(String[] argv) { testTable tt = new testTable();
          * JFrame jf = new JFrame(); jf.setContentPane(tt); jf.setVisible(true); }
         /** Creates new customizer testTable */
         public testTable() {
              initComponents();
              HashMap hm = new HashMap();
               * Only for debugging, to see that the method getRow() works when
               * called from the constructor.
               hm.put("ttext", "TEst");
               this.getRow(hm);
          * This method is called from within the constructor to initialize the form.
          * WARNING: Do NOT modify this code. The content of this method is always
          * regenerated by the FormEditor.
         private void initComponents() {//GEN-BEGIN:initComponents
              java.awt.GridBagConstraints gridBagConstraints;
              jLabel1 = new javax.swing.JLabel();
              textIn = new javax.swing.JTextField();
              jLabel2 = new javax.swing.JLabel();
              intIn = new javax.swing.JTextField();
              jLabel3 = new javax.swing.JLabel();
              numIn = new javax.swing.JTextField();
              jLabel4 = new javax.swing.JLabel();
              dateIn = new javax.swing.JTextField();
              jLabel5 = new javax.swing.JLabel();
              dateTimeIn = new javax.swing.JTextField();
              jLabel6 = new javax.swing.JLabel();
              jCheckBox1 = new javax.swing.JCheckBox();
              keepValues = new javax.swing.JCheckBox();
              jButton1 = new javax.swing.JButton();
              setLayout(new java.awt.GridBagLayout());
              jLabel1.setText("Text");
              add(jLabel1, new java.awt.GridBagConstraints());
              textIn.setName("ttext");
              textIn.setPreferredSize(new java.awt.Dimension(100, 21));
              textIn.addActionListener(new java.awt.event.ActionListener() {
                   public void actionPerformed(java.awt.event.ActionEvent evt) {
                        textInActionPerformed(evt);
              gridBagConstraints = new java.awt.GridBagConstraints();
              gridBagConstraints.gridwidth = 2;
              add(textIn, gridBagConstraints);
              jLabel2.setText("Integer");
              add(jLabel2, new java.awt.GridBagConstraints());
              intIn.setName("tint");
              intIn.setPreferredSize(new java.awt.Dimension(50, 21));
              add(intIn, new java.awt.GridBagConstraints());
              jLabel3.setText("Number");
              add(jLabel3, new java.awt.GridBagConstraints());
              numIn.setName("tnum");
              numIn.setPreferredSize(new java.awt.Dimension(50, 21));
              add(numIn, new java.awt.GridBagConstraints());
              jLabel4.setText("Date");
              gridBagConstraints = new java.awt.GridBagConstraints();
              gridBagConstraints.gridx = 0;
              gridBagConstraints.gridy = 1;
              add(jLabel4, gridBagConstraints);
              dateIn.setName("tdate");
              dateIn.setPreferredSize(new java.awt.Dimension(50, 21));
              gridBagConstraints = new java.awt.GridBagConstraints();
              gridBagConstraints.gridx = 1;
              gridBagConstraints.gridy = 1;
              add(dateIn, gridBagConstraints);
              jLabel5.setText("DateTime");
              gridBagConstraints = new java.awt.GridBagConstraints();
              gridBagConstraints.gridx = 2;
              gridBagConstraints.gridy = 1;
              add(jLabel5, gridBagConstraints);
              dateTimeIn.setName("tidate");
              dateTimeIn.setPreferredSize(new java.awt.Dimension(80, 21));
              gridBagConstraints = new java.awt.GridBagConstraints();
              gridBagConstraints.gridy = 1;
              add(dateTimeIn, gridBagConstraints);
              jLabel6.setText("Bit");
              gridBagConstraints = new java.awt.GridBagConstraints();
              gridBagConstraints.gridy = 1;
              add(jLabel6, gridBagConstraints);
              jCheckBox1.setName("tbit");
              gridBagConstraints = new java.awt.GridBagConstraints();
              gridBagConstraints.gridy = 1;
              add(jCheckBox1, gridBagConstraints);
              keepValues.setText("keep values");
              gridBagConstraints = new java.awt.GridBagConstraints();
              gridBagConstraints.gridx = 7;
              gridBagConstraints.gridy = 3;
              add(keepValues, gridBagConstraints);
              jButton1.setText("Send");
              jButton1.addActionListener(new java.awt.event.ActionListener() {
                   public void actionPerformed(java.awt.event.ActionEvent evt) {
                        jButton1ActionPerformed(evt);
              gridBagConstraints = new java.awt.GridBagConstraints();
              gridBagConstraints.gridx = 7;
              gridBagConstraints.gridy = 2;
              add(jButton1, gridBagConstraints);
         }//GEN-END:initComponents
         private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
              sendRow();
         }//GEN-LAST:event_jButton1ActionPerformed
         private boolean sendRow() {
              java.util.HashMap hm = new java.util.HashMap();
              Component[] cs = this.getComponents();
              for (int i = 0; i < cs.length; i++) {
                   if (((Component) cs).getName() != null) {
                        if (cs[i] instanceof JCheckBox) {
                             String value = ((JCheckBox) cs[i]).isSelected() ? "1" : "0";
                             hm.put(cs[i].getName(), value);
                        } else if (cs[i] instanceof JCheckBox) {
                             hm.put(cs[i].getName(), ((JTextField) cs[i]).getText());
              } // end for
              firePropertyChange("rowChanged", null, hm);
              return true;
         private void getRow(java.util.HashMap hm) {
              //if (! this.keepValues.isSelected()) {
              Component[] cs = this.getComponents();
              for (int i = 0; i < cs.length; i++) {
                   if (cs[i].getName() != null && hm.containsKey(cs[i].getName())) {
                        Component component = cs[i];
                        String componentName = cs[i].getName();
                        String componentValue = (String) hm.get(component.getName());
                        if (cs[i] instanceof JTextField) {
                             // output for debugging
                             System.out.println("Setting " + cs[i].getName() + " = "
                                       + componentValue);
                             ((JTextField) component).setText(componentValue);
                        } else if (cs[i] instanceof JCheckBox) {
                             // output for debugging
                             System.out.println("JCheckBox found");
                             JCheckBox cb = (JCheckBox) component;
                             boolean selected = (componentValue == null ? false : (componentValue.equals("1")
                                       ? true
                                       : false));
                             ((JCheckBox) component).setSelected(selected);
              } // end for
              /* Uncomment this code snippet to retrieve the text that has been set
              for the components (that means JTextFields)
              This is just for debugging !
              Component[] cs = this.getComponents(); for (int i = 0; i < cs.length;
              i++) { if (cs[i].getName() != null) { if (cs[i] instanceof
              JTextField) { System.out.println("Value of " +cs[i].getName() + " = " +
              ((JTextField) cs[i]).getText()); } } } // end for
         private void textInActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textInActionPerformed
         }//GEN-LAST:event_textInActionPerformed
         public void keyPressed(java.awt.event.KeyEvent e) {
              if (e.getKeyCode() == java.awt.event.KeyEvent.VK_ENTER) {
                   sendRow();
         public void keyReleased(java.awt.event.KeyEvent e) {
         public void keyTyped(java.awt.event.KeyEvent e) {
         public void propertyChange(java.beans.PropertyChangeEvent evt) {
              if (evt.getPropertyName().equals("newRow")) {
                   final PropertyChangeEvent finalEvt = evt;
                   Runnable makeChanges = new Runnable () {
                        public void run() {
                             getRow((java.util.HashMap) finalEvt.getNewValue());
         // Variables declaration - do not modify//GEN-BEGIN:variables
         private javax.swing.JTextField dateIn;
         private javax.swing.JTextField dateTimeIn;
         private javax.swing.JTextField intIn;
         private javax.swing.JButton jButton1;
         private javax.swing.JCheckBox jCheckBox1;
         private javax.swing.JLabel jLabel1;
         private javax.swing.JLabel jLabel2;
         private javax.swing.JLabel jLabel3;
         private javax.swing.JLabel jLabel4;
         private javax.swing.JLabel jLabel5;
         private javax.swing.JLabel jLabel6;
         private javax.swing.JCheckBox keepValues;
         private javax.swing.JTextField numIn;
         private javax.swing.JTextField textIn;
         // End of variables declaration//GEN-END:variables

    The problem of the change in the form not being comitted is that
    I forgot SwingUtilities.invokeLater(makeChanges); in the bottom
    part in public void propertyChange(java.beans.PropertyChangeEvent evt)
    after having created a new Runnable.
    Changes to the UI often have to be comitted by SwingUtitlities.invokeLater()
    though I don't know that much about Swing yet.
    Thanks to everybody who tried to solve that problem.
    Benjamin

  • How to refresh a JTable of a class from another thread class?

    there is an application, in server side ,there are four classes, one is a class called face class that create an JInternalFrame and on it screen a JTable, another is a class the a thread ,which accept socket from client, when it accept the client socket, it deal the data and insert into db,then notify the face class to refresh the JTable,but in the thread class I used JTable's revalidate() and updateUI() method, the JTable does not refresh ,how should i do, pls give me help ,thank you very much
    1,first file is a class that create a JInternalFrame,and on it there is a table
    public class OutFace{
    public JInternalFrame createOutFace(){
    JInternalFrame jf = new JInternalFram();
    TableModel tm = new MyTableModel();
    JTable jt = new JTable(tm);
    JScrollPane jsp = new JScrollPane();
    jsp.add(jt);
    jf.getContentPane().add(jsp);
    return jf;
    2,the second file is the main face ,there is a button,when press the button,screen the JInternalFrame. there is also a thread is beggining started .
    public class MainFace extends JFrame implements ActionListener,Runnable{
    JButton jb = new JButton("create JInternalFrame");
    jb.addActionListener(this);
    JFrame fram = new JFrame();
    public void performance(ActionEvent e){
    JInternalFrame jif = new OutFace().createOutFace(); frame.getContentPane().add(JInternalFrame,BorderLayout.CENTER);
    public static void main(String[] args){
    frame.getContentPane().add(jb,BorderLayout.NORTH);
    frame.pack();
    frame.setVisible(true);
    ServerSokct ss = new ServerSocket(10000);
    Socket skt = ss.accept()'
    new ServerThread(skt).start();
    3.the third file is a thread class, there is a serversoket ,and accept the client side data,and want to refresh the JTable of the JInternalFrame
    public class ServerThread extends Thread{
    private skt;
    public ServerThread(Sokcet skt){
    this.skt = skt;
    public void run(){
    OutputObjectStream oos = null;
    InputObjectStream ios = null;
    try{
    Boolean flag = flag;
    //here i want to refresh the JTable,how to write??
    catch(){}
    4.second is the TableModel
    public class MyTableModel{
    public TableModel createTableModel(){
    String[][] data = getData();
    TableModel tm = AbstractTableModel(
    return tm;
    public String[][] getData(){
    }

    Use the "code" formatting tags when posting code.
    Read this article on [url http://www.physci.org/codes/sscce.jsp]Creating a Simple Demo Program before posting any more code.
    Here is an example that updates a table from another thread:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=435487

  • JScrollPane doesn't scroll when appended from outside Thread.

    The strangest thing I've ever seen in Java has just occured. I'm making a client program that uses an outside thread to get input from a BufferedReader that's created from a TCP/IP connection. Now, I'm using a JTextArea, that has been added into a JScrollPane. Within the main thread, if I append to my JTextArea until it reaches the end of it's view, it will scroll down to meet the newly added text. If I however instead append it remotely from a thread I've created, it will append the text, but not scroll. Does any one have any idea how I can fix this?
    -Jason Thomas.

    Your may try one of these:
    1- Contruct the JScrollPane with scrollbar-policy on:
    ...new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    2- Contruct the JTextArea with the number of rows & columns big enough to make the scrollers appear: say ...= new JTextArea(200, 200) so that you always have them
    3- Call invalidate() method on the instance of the JTextArea inside the remote Thread after appending.
    <main thread>
    JTextArea textArea;
    <remote thread>
    public void run()
    textArea.append(...);
    textArea.invalidate();
    4- If the remote Thread appends to the TextArea while the TextArea is being shown (pack), this might confuse the JScrollPane to calculate the preferredScrollableViewportSize. You may Synchronized the remote Thread. Or check this code:
    <main thread>
    JTextArea textArea;
    <remote thread>
    public void run() {
    // wait until the textArea becomes visible
    while ( ! textArea.isVisible() )
    try {
    Thread.sleep(100);
    } catch (InterruptedException e) {}
    // now append
    textArea.append(...);

  • ProgressMonitor in thred, call from other class

    Hi all
    I have a problem using the ProgressMonitor... I just want to update the progress from another class.
    So what i was thinking was:
    I could implement a method that invoked the thread, and thereby updating the progress.
    The problem occurs when the calculating steps is going. The parent class calls ProgressDiff fine but it doesn't update it, it doesn't even show anything. Just when the task is finished it says, simulation done!!
    I have tried searching alot on these forums, and on google, but all methods implementing progressmonitor uses a call from within the class. <- Not what I want. :=)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.beans.*;
    public class ProgressDiff extends JFrame {
        public ProgressMonitor progressMonitor;
         public int tll;
        public ProgressDiff(int maks, String set) {
              super("Progress");
              setSize(250, 100);
            progressMonitor = new ProgressMonitor(null,
                                      "Differentiere og l�ser\n" + set,
                                      "", 0, maks);
            progressMonitor.setProgress(0);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setProgressTal(0, false);
              setLocationRelativeTo(null);
              setVisible(true);
        public void setProgressTal(int fremGang, boolean done) {
              tll = fremGang;
              SwingUtilities.invokeLater(new Update());
              if (done) {
                   Toolkit.getDefaultToolkit().beep();
                   JOptionPane.showMessageDialog(null,
                        "Simuleringen er f�rdig."
                        , "F�rdig",
                        JOptionPane.INFORMATION_MESSAGE);
         class Update implements Runnable {
            public void run() {
                   if (progressMonitor.isCanceled()) {
                   Toolkit.getDefaultToolkit().beep();
                   JOptionPane.showMessageDialog(null,
                        "Simuleringen er f�rdig."
                        , "F�rdig",
                        JOptionPane.INFORMATION_MESSAGE);
                   } else {
                        progressMonitor.setProgress(tll);
                        progressMonitor.setNote(String.format("Completed %d%%.\n", tll));
    }Any help would be apreciable!!
    Thx.

    Thx for the reply, I now have a working Progressmonitor which i easily can control
    import java.awt.Toolkit;
    import javax.swing.ProgressMonitor;
    *  Use of a ProgressMonitor. This class implements an easy to use progressmonitor for use in other classes.
    * @author     Nick Andersen
    * @created    4. marts 2008
    * @version    1.00
    public class ProgressMonitorSetup {
         private ProgressMonitor progressMonitor;
         private String title;
         private int min;
         private int progress;
         private int max;
         private String note;
         private String complete;
         private String cancel;
         private String completeTotal;
          * Constructor af ProgressMonitorSetup
         public ProgressMonitorSetup() {
              title = "K�rsel af langt job";
              min = 0;
              max = 100;
              complete = "Fremgang: ";
              cancel = "Job afbrudt.";
              completeTotal = "Job f�rdigt.";
              note = "";
          * Constructor af ProgressMonitorSetup
          * @param  title          The title in Progressmonitor
          * @param  min            The minimum value in the progressmonitor
          * @param  max            The maximum value in the progressmonitor
          * @param  complete       Beskrivelse af Parameteren
          * @param  completeTotal  Beskrivelse af Parameteren
          * @param  cancel         Beskrivelse af Parameteren
         public ProgressMonitorSetup(String title, int min, int max, String complete, String completeTotal, String cancel) {
              this.title = title;
              this.min = min;
              this.progress = min;
              this.max = max;
              this.complete = complete;
              this.completeTotal = completeTotal;
              this.cancel = cancel;
              note = "";
          *  S�tter title attributten af ProgressMonitorSetup object
          * @param  title  Den nye title v�rdi
         public void setTitle(String title) {
              this.title = title;
          *  S�tter minimum attributten af ProgressMonitorSetup object
          * @param  min  Den nye minimum v�rdi
         public void setMinimum(int min) {
              this.min = min;
          *  S�tter maximum attributten af ProgressMonitorSetup object
          * @param  max  Den nye maximum v�rdi
         public void setMaximum(int max) {
              this.max = max;
          *  S�tter runningComplete attributten af ProgressMonitorSetup object
          * @param  complete  Den nye runningComplete v�rdi
         public void setRunningComplete(String complete) {
              this.complete = complete;
          *  S�tter complete attributten af ProgressMonitorSetup object
          * @param  completeTotal  Den nye complete v�rdi
         public void setComplete(String completeTotal) {
              this.completeTotal = completeTotal;
          *  S�tter cancel attributten af ProgressMonitorSetup object
          * @param  cancel  Den nye cancel v�rdi
         public void setCancel(String cancel) {
              this.cancel = cancel;
          *  Returnere cancel attributten af ProgressMonitorSetup object
          * @return    cancel v�rdi
         public String getCancel() {
              return cancel;
          *  Returnere done attributten af ProgressMonitorSetup object
          * @return    done v�rdi
         public boolean isDone() {
              if (progress >= max) {
                   progressMonitor.close();
                   return true;
              } else {
                   return false;
          *  METODEN
         public void close() {
              progressMonitor.close();
          *  METODEN
         public void initProgressMonitor() {
              progressMonitor = new ProgressMonitor(null,
                   title, note,
                   min, max);
              progressMonitor.setMillisToDecideToPopup(100);
              progressMonitor.setMillisToPopup(100);
              progressMonitor.setProgress(min);
          *  S�tter progress attributten af ProgressMonitorSetup object
          * @param  i  Den nye progress v�rdi
          * @return    Beskrivelse af den Returnerede V�rdi
         public String setProgressMessage(int i) {
              progress = i;
              progressMonitor.setProgress(progress);
              note = complete + progress + " af " + max;
              progressMonitor.setNote(note);
              if (progressMonitor.isCanceled() || isDone()) {
                   Toolkit.getDefaultToolkit().beep();
                   if (progressMonitor.isCanceled()) {
                        progress = max++;
                        return cancel;
                   } else {
                        return completeTotal;
              return note;
          *  S�tter progress attributten af ProgressMonitorSetup object
          * @param  i  Den nye progress v�rdi
         public void setProgress(int i) {
              progress = i;
              progressMonitor.setProgress(progress);
              note = complete + progress + " af " + max;
              progressMonitor.setNote(note);
              if (progressMonitor.isCanceled() || isDone() ) {
                   Toolkit.getDefaultToolkit().beep();
                   if (progressMonitor.isCanceled()) {
                        progress = max++;
                   } else {
    }Sry about the comment, and the danish... But this works really nice, if you place the swingworker around the method needing progressmonitor.

Maybe you are looking for

  • Anything I should be worried about when installing Windows XP via Bootcamp?

    Are there any common problems I might experience? It is a 100% legit key of Windows XP. I really don't want to ruin my macbook considering it took me a long time to save up my allowance for it. Will my mac still be under warranty if I install Windows

  • BED AND ECS AMOUNT IS MORE IN MIGO EXCISE HEADER TAB

    Hi Guys, When I am processing the MIGO, in exise tab(Header) the amount of BED and ECS are 10 time more than the acctual amount. Where as the Item details Excise tab it is correct as per the Purchase order. Can some body tell me how/from where this h

  • Scanned Images not working with iphoto6

    All my hundreds and hundreds of scanned photos will not work in iPhoto6. My digital photos taken with a digital camera work just fine. I use an Epson 2480 Photo scanner. All the photos I have scanned over the years and even my recent scanned photos w

  • HCM - OM infotype changes

    Hi Gurus,             IN my requiremen t i want to capture all HCM - OM infotype changes .Can you give me some solution. What is the Table that stores all OM Infotype log details. Ashok ...

  • Unable to get in to blackberry app world! Please help?

    I have a blackberry curve 8520, and every time I go into app world it asks me to log in, I cannot remember my username, and im unable to get into my email account as it was hacked. As a result I was going to delete my app world I have at the moment,