Threads from threads

hi,
just wondering if it's ok to start a thread from within another thread?
e.g. mythread extends runnable
run{
mySubThread sub = mySubThread();
sub.start();
}

Everything in java is running in a thread. Therefore the answer to your question is YES.
matfud

Similar Messages

  • Hi Dude,     I ve seen all the threads from first to last even am gonna geta iphone 4s from Thailand. Would like to know which sim will be working fine in chennai as you all are using d phone for past many days???  Is it advisable to buy a phone

    Hi Dude,
    I ve seen all the threads from first to last even am gonna get a iphone 4s from Thailand. Would like to know which sim will be working fine in chennai as you all are using d phone for past many days???  Is it advisable to buy a phone from abroad.

    Thanks for that. Much more constructive than the last comment. It's only the restriction code I can't recall, not the access passcode. So I can currently access the device, just not age restricted content. Does that's make a difference? I also wondered if anyone knew how many attempts you get to try to get it right. Now tried 21 times and so far nothing bad has happened but I am concerned I'll eventually be completely locked out of the device. That doesn't seem in the spirit of things though. Surely it's foreseeable that a child could repeatedly try to guess the code so I can't see that it would be right to lock the device down completely in that circumstance, particularly if the access code is being typed in correctly every time.
    Thanks

  • Calling a delegate on the UI thread from a work thread inside a child class.

    Hi All,
    I've run into a snag developing a WPF multithreaded app where I need to call a method on the UI thread from my work thread, where the work thread is running a different class.
    Currently I am trying to use a delegate and an event in the 2nd class to call a method in the 1st class on the UI thread. This so far is not working as because the 2nd class is running in its own thread, it causes a runtime error when attempting to call
    the event.
    I've seen lots of solutions referring to using the dispatcher to solve this by invoking the code, however my work thread is running a different class than my UI thread, so it seems the dispatcher is not available?
    Below is as simplified an example as I can make of what I am trying to achieve. Currently the below code results in a "The calling thread cannot access this object because a different thread owns it." exception at runtime.
    The XAML side of this just produces a button connected to startThread2_Click() and a label which is then intended to be updated by the 2nd thread calling the updateLabelThreaded() function in the first thread when the button is clicked.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    using System.Windows.Threading;
    using System.Threading;
    namespace multithreadtest
    public delegate void runInParent();
    public partial class MainWindow : Window
    public MainWindow()
    InitializeComponent();
    threadUpdateLabel.Content = "Thread 1";
    private void startThread2_Click(object sender, RoutedEventArgs e)
    thread2Class _Thread2 = new thread2Class();
    _Thread2.runInParentEvent += new runInParent(updateLabelThreaded);
    Thread thread = new Thread(new ThreadStart(_Thread2.threadedTestFunction));
    thread.Start();
    public void updateLabelThreaded()
    threadUpdateLabel.Content = "Thread 2 called me!";
    public class thread2Class
    public event runInParent runInParentEvent;
    public void threadedTestFunction()
    if (runInParentEvent != null)
    runInParentEvent();
    I'm unfortunately not very experienced with c# so I may well be going the complete wrong way about what I'm trying to do. In the larger application I am writing, fundamentally I just need to be able to call a codeblock in the UI thread when I'm in a different
    class on another thread (I am updating many different items on the UI thread when the work thread has performed certain steps, so ideally I want to keep as much UI code as possible out of the work thread. The work threads logic is also rather complicated as
    I am working with both a webAPI and a MySQL server, so keeping it all in its own class would be ideal)
    If a more thorough explanation of what I am trying to achieve would help please let me know.
    Any help with either solving the above problem, or suggestions for alternative ways I could get the class in the UI thread to do something when prompted by the 2nd class in the 2nd thread would be appreciated.
    Thanks :)

    If I follow the explanation, I think you can use MVVM Light messenger.
    You can install it using NuGet.
    Search on mvvm light libraries only.
    You right click solution in solution explorer and choose manage nugget...
    So long as you're not accessing ui stuff on these other threads.
    using GalaSoft.MvvmLight.Messaging;
    namespace wpf_Tester
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    public MainWindow()
    InitializeComponent();
    Messenger.Default.Register<String>(this, (action) => ReceiveString(action));
    private void ReceiveString(string msg)
    MessageBox.Show(msg);
    Dispatcher.BeginInvoke((Action)delegate()
    tb.Text = msg;
    private void Button_Click(object sender, RoutedEventArgs e)
    Task.Factory.StartNew(() => {
    Messenger.Default.Send<String>("Hello World");
    What the above does is start up a new thread - that startnew does that.
    It sends of message of type string which the main window has subscribed to....it gets that and puts up a message box.
    The message is sent from the window to the window in that but this will work across any classes in a solution.
    Note that the receive acts on whichever thread the message is sent from.
    I would usually be altering properties of a viewmodel with such code which have no thread affinity.
    If you're then going to directly access properties of ui elements then you need to use Dispatcher.BeginInvoke to get back to the UI thread.
    I do that with an anonymous action in that bit of code but you can call a method or whatever instead if your logic is more complicated or you need it to be re-usable.
    http://social.technet.microsoft.com/wiki/contents/articles/26070.aspx
    Hope that helps.
    Technet articles: Uneventful MVVM;
    All my Technet Articles

  • Calling a thread from a cvi code file to another code file

                Hello, 
                I want to call a thread from a labwindows/cvi code file to another labwindows/cvi code file. Namely, my thread function (GraphLoop) is in 'TestsModel.c' ; but I will call the thread in 'Tests.c' .  My code in 'Tests.c' is in the following;
    int CVICALLBACK GraphLoop (void *functionData);
    int GraphLoopId;
    int callbackDataGraphLoop;
    int CVICALLBACK CBBasla (int panel, int control, int event,
    void *callbackData, int eventData1, int eventData2)
    switch (event)
    case EVENT_COMMIT:
    CmtInstallThreadPoolCallback (poolHandle, EVENT_TP_THREAD_BEGIN, GraphLoop, callbackDataGraphLoop, GraphLoopId);
    if (tiklandiE3631ACihazinaBaglan == 0 && tiklandi34401ACihazinaBaglan == 0) // 'E3631A Cihazına Bağlan' ve '34401A Cihazına Bağlan' tuşlarına basılmamışsa uyarı verir.
    MessagePopup ("Uyarı", "Lütfen cihaz bağlantısını kontrol ediniz.");
    else
    if (tiklandiKaydet == 0)
    MessagePopup ("Uyarı", "Lütfen ayarları kaydediniz.");
    else
    SetCtrlAttribute (Testler, PnlTestler_BASLA, ATTR_DIMMED, 1); // 'Başla' tuşunu pasif hale getirir.
    SetCtrlAttribute (Testler, PnlTestler_BASLA, ATTR_DISABLE_PANEL_THEME, 1); // 'Başla' tuşunun etiketini pasif hale getirir.
    SetCtrlAttribute (Testler, PnlTestler_BITIR, ATTR_DIMMED, 0); // 'Bitir' tuşunu aktif hale getirir.
    SetCtrlAttribute (Testler, PnlTestler_BITIR, ATTR_DISABLE_PANEL_THEME, 0); // 'Bitir' tuşunun etiketini aktif hale getirir.
    CmtNewThreadPool (DEFAULT_THREAD_POOL_HANDLE, &poolHandle); //Yeni bir thread oluşturur.
    CmtScheduleThreadPoolFunction (poolHandle, GraphLoop, NULL, &GraphLoopId); // GrapLoop thread fonksiyonunu başlatır.
    break;
    case EVENT_RIGHT_CLICK:
    break;
    return 0;
              I take that errror after executing this code;
      error:Undefined symbol '_GraphLoop' referenced in "f:\Tests.obj"
             Please, can you help me for my question?
             Regards...

    Hello Eren,
    I assume this is a link error.
    Do you have TestsModel.c file included in your project?
    Constantin.

  • Multiple message threads from same person

    I have multiple message threads from the same person in messages on my iPhone and iPad. One comes from their phone number and one from their email. Here are all the details, I would love to be able to combine them into one thread.
    This other person and myself each have a new MacBook Pro, iPad Air 2, I have an iPhone 6 and they have an iPhone 5S. They are all updated with the most recent system software.
    On my MacBook Pro, the conversations that are split on my iPhone and iPad are not split. On the MacBook Pro, all of the texts from both conversations are appearing in one. In my contacts which are syncing with iCloud I have both the phone number and email address of this other person.
    I have messages set up on all of my devices to send and receive from my phone number and my email, start new conversations is from my phone number. This other person has it set up the exact same way on all of their devices.
    So why when I text this person from one conversation thread and they respond it comes through to the other conversation thread?
    Why can't I seem to join these two conversations when everything is set up the way it should be and they ARE joined on my MacBook Pro but not my iPhone and iPad?

    She kept the same number on her new phone, but now there are 2 conversation threads. A new one started with messages sent from the new phone, the old phone should be out of service now. Why didn''t  messages sent by the new phone resume in the same conversation? I assume because it's a different IMEI.  But now whenever I use her  phone number to create a new message, it goes in the old IMEI*'s conversation thread and is therefore not delivered. It's in green so it thinks it's an SMS also not a iMessage device.
    If I want to send a message correctly  to the new phone, I have to make sure I  go into the correct newer thread and enter it there,
    For your second answer, the person is receiving the message but the thread now says "email address", not the person's name in the contact list. The sender is sending to the person's phone number, not her email address.

  • How to terminate a java thread from c++ code?

    Hi,
    I made a screensaver which loads a jvm, forks a thread running a java class, wait until user's action(i.e. mouse move/click keyboard input), then terminate the java thread.
    However, I met a problem, How to terminate a running java thread from c++ code?
    Here is my code, but it does not work: (even after the terminate is called, jvm throws an error)
    JNIEnv* env;
    JavaVM* jvm;
    HANDLE hThread; //handle for the startThread
    unsigned __stdcall startThread(void *arg)
         jclass cls;
         jmethodID mainId;
         jint          res;
         int threadNum = (int)arg;
         res = jvm->AttachCurrentThread((void**)&env, NULL);
    cls = env->FindClass( MAIN_CLASS);
         mainId = env->GetStaticMethodID(cls, "main", "([Ljava/lang/String;)V");
         // setup the parameters to pass to main()
         jstring str;
         jobjectArray args;
         int i=0;
         args = env->NewObjectArray(1, env->FindClass("java/lang/String"), 0); //only one input parameters
         str = env->NewStringUTF("localhost");
         env->SetObjectArrayElement(args, 0, str);
         env->CallStaticVoidMethod(cls, mainId, args); // call main()      
         if (env->ExceptionOccurred()) {
                   env->ExceptionDescribe();
         return TRUE;
    Here is the main method:
    First create the jvm and load the thread. then tries to terminate the thread, but failed here
    switch (msg)
    { case WM_CREATE:
              JavaVMOption options[NUMBEROFOPTIONS];
              JavaVMInitArgs vmargs;     
              jint rc;
              vmargs.version = JNI_VERSION_1_4; /* version 1.4 */
              vmargs.options = options;
              vmargs.nOptions = NUMBEROFOPTIONS;
              vmargs.ignoreUnrecognized = JNI_FALSE;          
              rc=JNI_CreateJavaVM( &jvm, (void **)&env, &vmargs ); /* create JVM */
              /* We pass the thread number as the argument to the invoked thread */
              unsigned int threadId = -1;
              // to initialize a thread-safe C runtime library
              hThread = (HANDLE)_beginthreadex(NULL, 0, &startThread, NULL, 0, &threadId );
    } break;
    case (WM_DESTROY):
              CloseHandle( hThread );
              jvm->DestroyJavaVM(); /* kill JVM */
              Debug("Destroy Java Virtual Machine\n");
    }break;
    Note, after the thread "startThread" runs, it has an infinite loop and will not terminate, until the user clicks to terminate.(I didn't call jvm->DetachCurrentThread();_endthreadex(0); in the "startThread" because the java thread will not terminate by itself)
    Thus, the only way to terminate the thread is to call closehandle(hthread) in the main thread, which may cause jvm to throw an error.
    Do you know how to terminate a java thread safely???
    Thanks a lot

    Assuming that your java thread is in a loop of some kind. Such as
    int i=1; /* I tried using a boolean, I just could not get my C++ env, to change this value. So i decided to use an int */
    run {
    while(i)
    isdfjsdfj
    void seti()
    i=0
    So, B/4, i call destroyVM in my C++ code, i call this seti(). so the loop terminates, therefore my thread finishes executing and ends.
    Hope this helps
    tola.

  • Open Threads from UIX Forum?

    I've got a couple of threads on which I was still hoping for responses over on the UIX forum. I can't update them there, and it says current threads will be 'moved' here. Does that mean the existing content of the threads will literally be moved over here, or just that followups will be posted here? If I want to update a UIX thread, should I start a new one here, or how soon could I expect my open threads from there to be continued here?

    I'd just start a new one here and include a URL to the old one in case anyone needs to see the full context.
    Rob
    Team JDev

  • Stopping a thread from running

    Hai
         I am new to java. It would be helpful for me if someone helps me out in doing this.
         Actually in my program ,I should
    i. Find out whether a particular file exists in the given directory or not.
    ii. If the file doesn't exist, my program should wait for certain timeframe and check for the same file again.
    iii. If the program cannot find the required file within the timeout specified, my application should exit.
         I have done (i) and (ii) using threads. But in the case of (iii), I came to know that stop() method is depricated.
         I am providing my code for a better understanding. Could you please let me know, what would be the best way to stop the thread from running after the timeout is reached in my program?
    Thanx in advance
    import java.io.File;
    public class Fileexists implements Runnable
    static Thread t;
    public static void main(String[] args)
         System.out.println("creation of object");     
         FileExists test = new FileExists();
         t = new Thread(test);
         t.start();
    // run method
    public void run()
         File f = new File("searchfile.txt");
         boolean b = f.exists();
    System.out.println();
    if(b == false)
    System.out.println("Required file doesnot exists");
    try
         t.sleep(20000);
    catch (InterruptedException e)
         // TODO Auto-generated catch block
         e.printStackTrace();
              t.run();
    else
    System.out.println("Required file found");
    } // end of run()
    } // end of FileExists class

    Actually your use of threads is a difference which makes no difference. The JVM starts an initial thread and runs your main(), at the end of which you start a thread and return. So you've just replaced one thread with another. There's no parallel processing.
    The t.run() at the end of your run() method won't work. A particular Thread object can only run once. It will give you an IllegalStateException.
    I can't see how multi-threading will help you with this task at all, all you need is a simple loop with a Thread.sleep in it.
    If you really want to use a separate thread or Timer to implement a timeout (as an exercise) then use Thread.interrupt() to wind up a thread. The looping thread should test with Thread.interrupted() in it's loop condition, if it's in sleep() when interrupted an InterruptedException will be thrown which you should catch and allow to break the loop and let the thread terminate.
    So your loop structure looks like:
    try {
    while(!Thread.interrupted()) {
        ...  do your test
        Thread.sleep(.....);
      System.out.println("Thread terminated by detecting interrupted");
      } catch(InterruptedException ex)  {
         System.out.println("Thread interrupted from sleep");
    You can get the Thread for the main thread simply by storing Thread.currentThread() in a Thread reference.
    I'd suggest using a java.util.Timer to launch your time-out and leave the loop on the main thread started by the JVM.

  • User Thread from OC4J

    Hi,
    I am trying to start a new thread from within my web application.
    but every time it gives me an error -
    javax.naming.NamingException - Not in application scope - start OC4J with the -userThreads switch if using user created threads.
    Can anyone suggest what changes in the server setting do i need to make to the Oracle application server ? I am using 10g version.

    Hi,
    use Enterprise Manager to get to the application server, select your OC4J container, select administration, go to server attributes and put the switch -userThreads to the OC4J options. Restart the container.
    That should do it.
    Timo

  • Is it possible to invoke JEB method from thread?

    Hello everybody!
    I have problem creating EJB from the thread. Here is the part of code below:
    public void email() throws Exception {
    class MailThread implements Runnable {
    public MailThread() {
    public void run() {
    try {
    String jndiName "java:comp/env/ejb/PROG/Mail";
    IMailHome mailHome;
    IMail mail;
    InitialContext context = new InitialContext();
    Object objref = context.lookup(jndiName);
    mailHome = (IMailHome) PortableRemoteObject.narrow(objref, IMailHome.class);
    // Exception here:
    // java.rmi.RemoteException: Exception Substitute; nested exception is:
    // java.lang.NullPointerException mail = mailHome.create();
    // business metods
    // mail.method1();
    } catch (Exception e) {
    System.out.println("Exception:" + e);
    MailThread mt = new MailThread();
    Thread thread = new Thread(mt);
    thread.start();
    Exception:
    java.rmi.RemoteException: Exception Substitute; nested exception is:
    java.lang.NullPointerException
    I am not able to create EJB instance from the thread. The same code works well in servlet. Am I doing something wrong?
    May be there are some different approaches to implement some operations asynchronously at EJB level do not using JMS and MDB? J2EE specification prohibits to use threads inside EJB so the only way I see is to create different thread on servlet side and invoke EJB methods from it. But it seems that this doesn't work too. Could anyone help me?
    Thanks in advance,
    Vadim Lotarev

    If the passcode will not work, the only alternative is to restore the phone as new. You cannot change the passcode from the lock screen.

  • Accesing mysql database from threads

    Hi
    dont know if this is the right place for this
    I'm building a server-client application, on sever's side I create a thread for every client who can request several operations over a mysql database (insert, delete, update, etc), at some point 2 clients can request the same operation over the same registry (2 clients trying to delete the same registry, for example), I try to avoid that to happend, so before doing any operation over the database I check the correct status (a registry must exist to delete, or not exist to create, for example), this is the code that makes that (for inserting a registry):
    //first I make sure the registry does not exist
    sql = "SELECT id_grupo FROM adm_grupo WHERE nombre_grupo = '" + nomGrupo + "'";
    res = bd.ConsultarSQL(sql);
    //If already exist, the operation is rejected
    if (res.next()) {
        EnviarError("Error al Crear el Grupo: Ya existe ese nombre");
         return -1;               
    //Check point ends
    //If not, the insert statement is made
    sql = "INSERT INTO adm_grupo VALUES (NULL,'" + nomGrupo + "','N')";however, since it could be 2 threads (every thread is an object) doing that, the first one can pass the check point and stop because its processor time is over, so the second can start its insert process and pass the check point too (because the first one didn't have enough time to insert the registry), then both registries are inserted causing a logical error, I thought in fixing that problem using the synchronized keyword for the functions, but I read that keyword blocks 1 object that can be accesed for several threads, but in my case I have several threads, everyone accesing its own object, so I'm not sure if the synchronized will work, I dont know any other solution to this,
    thnx in advance for any help

    Sure.  But test it.  You'll need to test it regardless, just to make sure it all works.
    In general, I usually prefer to have the backup tool create the initial SQL database archive on the primary server, zip it, and to then have the backup server in a trusted network location pull the database archive over to the backup server.  (It can then unzip it or process it as needed.)  With this, the primary server doesn't have access to the backups, nor to the backup server. This intended to isolate the access that a breach of the primary server might permit.

  • Old threads from last years appear in the iPad forum

    When viewing the iPad forum on the iPad old threads from last year populate the threads listings. I used different browsers on the iPad besides Safari (both logged in and out) and it still happens. I haven't tried using Safari on OSX . Can someone please check this out using the iPad and OSX to see if they are experiencing the same thing. This started happening yesterday...

    +Watch the movie CATCH 22 for the definition of what normal means... there isn't any.+
    I will try to find it; your comment made me curious enough to google and now I know why no one has ever referred to me as being "normal".....
    +Definitions of normal on the Web:+
    +* conforming with or constituting a norm or standard or level or type or social norm; not abnormal; "serve wine at normal room temperature"; "normal diplomatic relations"; "normal working hours"; "normal word order"; "normal curiosity"; "the normal course of events"+
    +* in accordance with scientific laws+
    +* +*being approximately average or within certain limits in e.g. intelligence and development;*+ "a perfectly normal child"; "of normal intelligence"; "the most normal person I've ever met"+
    +* convention: something regarded as a normative example; "the convention of not naming the main character"; "violence is the rule not the exception"; "his formula for impressing visitors"+
    +* forming a right angle+

  • Spawning threads from within a UnicastRemoteObject

    I have a question regarding spawning threads from within a class that extends UnicastRemoteObject. Would it be okay to spawn new thread(s) in the constructor/ remote methods of the class that extends UnicastRemoteObject .? Are there any pitfalls to doing so? Is it against the suggested practice of writing RMI server code?
    rajkumar

    You can do anything you like in the Class that extends URO.
    The classic problem of doing anything within a constructor is that the object under construction may not be available to the threads you are spawning. That is, since the object is not fully constructed, any fields the new threads need may not be available. There have been discussions on this subject in the forums before. You might give a look and see.

  • How to add screenshot to this thread from my hard drive?

    How to add screenshot to this thread from my hard drive?

    Unfortunately there is no built in way to do this. You would need to upload the picture some where and link to it in HTML.
    (Flickr, Picasa, Drop Box, etc.)

  • Waking up a thread from ActionListener

    I have a Swing GUI that uses a separate class for handling the user actions(implements ActionListener).
    When the user clicks a button in the GUI a new thread is started that connects to a server and after sometime goes to wait().
    Now, when the user clicks on another button, i want the thread (which is in wait() mode) to wakeup and continue.
    In order for the client thread to go to wait() mode() i use the code below:
       private synchronized void authenticatedClient()
            System.out.println("authenticateClient started");
            boolean wait = true;
            while(wait)
                try
                    this.wait();
                catch (InterruptedException interException)
                    System.out.println("Thread wait() was interrupted!!");
                System.out.println("Woke up: pass command to server and sleep again");
                // get the command that user asked for.
                // write the command to the server
                writeData("TAKE_MY_COMMAND");
        } In the same client thread i have another method that will be used to notify() the clientAuthenticated():
        private synchronized void wakeUp()
            System.out.println("wakeUp() was called");
            try
                this.notify();
            catch (IllegalMonitorStateException illegal)
                System.out.println("Thrown to indicate that a thread has attempted to wait on " +
                          "an object's monitor or to notify other threads waiting on an object's " +
                          "monitor without owning the specified monitor.");
        }My problem is how can i call the wakeUp() from the class that implements the ActionListener.
    Any help will be greatly appreciated.

    Hi, i think i have found the root of my problem but if someone can help me i will appreciate it much.
    The ActiionListener class has two constructors. One constructor is used for the main GUI and the second constructor is used for tthe connect dialog.
    When the application starts, the main GUI is using the first constructror. The user presses the button Connect, and the Dialog window opens. This window though is using the second constructor in the ActionListener class to listen for the connect command. Now when the user completes the dialog and presses connect,, a new thread starts which takes the class Networking as an argument.
    After the networking thread does what is supposed to do it waits (blocked).
    Now the user presses the button Continue on the main GUI which uses the first constructor.
    The Continue buton is supposed to notify() the blocked thread but AS I believe it cant because the actual thread was created using the second constructor.
    So i need either a way to make both the main GUI and the Dialog listen on the same instance of the ActionListener so i can refer to the thread,,,,, OR someone to help me understand what is wrong.
    Below is the code from my ActionListener class:
    public class EventHandling implements ActionListener
        private HAClientFrame clientFrame = null;  
        private ConnectDialog connectDialog = null;
        private Thread thread;
        private NetworkingThread netThread;
         * constructor
         * @param haClientFrame
        public EventHandling(HAClientFrame haClientFrame)
            this.clientFrame = haClientFrame;
         * constructor
         * @param connectDialog
        public EventHandling(ConnectDialog connDialog)
            this.connectDialog = connDialog;
         * Process the events
        public void actionPerformed(ActionEvent e)
    // connect
    // THE CODE BELOW IS EXECUTED HAVING USED THE SECONDCONSTRUCTOR
            if (e.getActionCommand().equals("ConnectDialog"))
                if (validateInput())
                    connectDialog.setVisible(false);
                    netThread = new NetworkingThread(connectDialog.getAddress(),
                            connectDialog.getPort(), connectDialog.getUsername(),
                            connectDialog.getPassword());
                    thread = new Thread(netThread);
                    thread.start();
                    connectDialog.setFieldsNull();
                    connectDialog.dispose();
                    username = null;
                    password = null;
                else
                    JOptionPane.showMessageDialog(null,
                            "One or more fields are wrong.Please try again.",
                            "Error on input fields", JOptionPane.ERROR_MESSAGE);
    // THE CODE BELOW IS EXECUTED HAVING USED THE FIRST CONSTRUCTOR
    else if (e.getActionCommand().equals("LOCK"))
                System.out.println("LOCK command at eventhandling");
    // THIS SHOULD WORK BUT IT DOESNT
    thread.notify();
    }The code of the dialog box: (not all just the important bits):
    public class ConnectDialog extends JDialog
    private EventHandling handler = new EventHandling(this);
    jButton.addActionListener(handler);
    The code is working but its much to show all here. This is just how i listen for a button to get pressed.
    How could i make two classes listen from the same instance of the EventHandling class??I believe this will solve my problem.
    Any other help greatly appreciated
    Thanks again

Maybe you are looking for

  • Hyper-V Server Manager -Error occurred during enumeration of Data Deduplication volumes

    Hi Experts, I having this problem in my Hyper-V Server Manager. Can somebody tell me why this happening? Inside my Hyper-V, I has been installed Microsoft DPM 2012 and both Hyper-V is cluster. Please advice.

  • Remote or transactional roll back exception

    Hi All, I have deployed CMP2 entity bean to SUN ONE with Oracle as DB. There is no problem while retrieving/updating values to the table. But throws following exception while adding values to the table. Exception from the server log is below: SEVERE:

  • Arabic in Reports 10g

    Hi everybody!!! I have a report, which has a simple query with a where cluase based on a character column. the value of this column is passed as a parameter. When the parameter is in english the report works fine (the report format is in pdf) and whe

  • Samsung NX100 RAW Support?

    I've been trying to use Aperture with the Samsung NX100.  In most conditions there is too much red/magenta.  In some photos it is absolutely out of control.  For example, a couple of indoor portraits had the person's face bright magenta, and a pine c

  • After I double click on the firefox icon, firefox refuses to load. Why?

    '''bold text'''I have windows 7. When I double click on the firefox icon on my desktop the circle moves around and around then stops and nothing happens