Simple EVENT & THREAD question.

Hello,
Let's say I create a thread from the main one... This thread is supposed to do some work while the main one is waiting for the signal that the work is done... After the signal is received by the main thread it can continue to run...
How this could be done in Java ? I'm looking for things that are similar to WaitForSingleObject(...) and SetEvent(...) in Windows...

So you want to fire off a Thread, wait for it to do something, and then continue.
In Java, you'd start off down this road using wait() and notify(), as Tolmak says.
For example,
public class Test {
    public static void main(String[] args) {
        System.out.println("Starting Worker thread...");
        Worker w = new Worker();
        Thread t = new Thread(w);
        synchronized(w) {
            t.start();
            try {
                System.out.println("Waiting for Worker Thread to complete...");
                w.wait();
            } catch (InterruptedException ignore) {}
        System.out.println("Worker Thread finished. All done!");
    public static class Worker implements Runnable {
        public void run() {
            System.out.println("Worker thread is doing something...");
            try {
                Thread.sleep(5000L);
            } catch (InterruptedException ignore) {}
            System.out.println("All done. Notifying Main...");
            synchronized(this) {
                this.notify();
}Does this get you closer to where you want to be?

Similar Messages

  • Plzzz write prog to this simple java threads question

    Write a program in C to create four processes. The original processes creates
    two children before it prints out "PARENT". The children processes print
    "CHILD1" and "CHILD2" respectively. The first child process creates a child
    process that prints out "GRANDCHILD".
    Note: The output must be guaranteed to print out in the following order each
    time it is executed:
    GRANDCHILD
    CHILD2
    CHILD1
    PARENT
    a. Write the program using C or C++ and forks to create the children processes.
    b. Write a second program using Java and Threads for the children processes.
    The output statements for CHILD1, CHILD2 and GRANDCHILD must come from print
    statements in the run method of the thread.

    Most people here will not do your homework for you. If you post a reasonable question that shows you've made some effort, and what the results of that effort were, and provides details about what parts you're having trouble with, then somebody will probably provide guidance so that [you can complete the work.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Flags and the Event Thread

    I was writing code for a game and I realized that the AWT event thread could change the value of a flag while I'm in the process of updating the game state. This can cause a few problems, or it could even leave events not handled because of it. I see code like this all the time as a fix to the threading issues, am I missing something or is it really a solution? I can't post the actual code as it's too long, so I created a simple example:
    import java.awt.event.*;
    import javax.swing.*;
    public class EventTest extends JFrame implements KeyListener, Runnable
         private boolean isKeyDown;
         public EventTest()
              setSize(500, 500);
              setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              setVisible(true);
              addKeyListener(this);
              new Thread(this).start();
         public void keyPressed(KeyEvent event)
              //synchronized(this)
                   isKeyDown = true;
         public void keyReleased(KeyEvent event)
              //synchronized(this)
                   isKeyDown = false;
         public void keyTyped(KeyEvent event) {}
         public void run()
              // game loop
              while(true)
                   //synchronized(this)
                        boolean cache = isKeyDown;
                        System.out.print(isKeyDown); // before
                        System.out.print(' ');
                        /* event handling, game logic, etc. done here
                           do some useless operation to simulate this */
                        long time = System.currentTimeMillis();
                        while(time + 1 > System.currentTimeMillis());
                        System.out.println(isKeyDown); // after
                        if(cache != isKeyDown)
                             System.out.println("PROBLEM!");
                        // render everything to the screen
                   try
                        Thread.sleep(100);
                   } catch(InterruptedException e) {}
         public static void main(String[] args)
              new EventTest();
    }Basically I have a game loop, where I update the game state, handle events, then draw things to the screen. Each time a key is pressed or released, I set the appropriate value to isKeyDown from the AWT event thread. The desirable output is to have the booleans equal to each other so that "false false" or "true true" is printed out on the screen constantly, but once in a while I'll get a "false true" or "true false", which is expected but obviously not wanted.
    So one solution is right there commented out (synchronizing), though most people seem to avoid it. I see everybody using flags like this, so I'm wondering if I'm missing some obvious solution to the problem or if it's really even that big of a deal. I don't see any other fix, but that's why you're all here. ;)
    Thanks.

    Swing related questions should be posted in the Swing forum.
    I converted your simple example to use a Swing Timer instead of a while(true) loop with a Thread.sleep. I experienced no problems as expected since all the code will be executed in the Event Dispatch Thread (EDT).
    Of course using this approach could make the game less responsive if your game logic is extensive and hogs the EDT, but given that you try to invoke your game logic every 100 millisecond I assume it can't be that extensive.
    Anyway here is the code I used as a test:
    import java.awt.event.*;
    import javax.swing.*;
    public class EventTest extends JFrame implements KeyListener, ActionListener
         private boolean isKeyDown;
         public EventTest()
              setSize(500, 500);
              setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              setVisible(true);
              addKeyListener(this);
              new Timer(100, this).start();
         public void keyPressed(KeyEvent event)
              isKeyDown = true;
         public void keyReleased(KeyEvent event)
              isKeyDown = false;
         public void keyTyped(KeyEvent event) {}
         public void actionPerformed(ActionEvent e)
              boolean cache = isKeyDown;
              System.out.print(isKeyDown); // before
              System.out.print(' ');
              /* event handling, game logic, etc. done here
                 do some useless operation to simulate this */
              long time = System.currentTimeMillis();
              while(time + 1 > System.currentTimeMillis());
              System.out.println(isKeyDown); // after
              if(cache != isKeyDown)
                   System.out.println("PROBLEM!");
         public static void main(String[] args)
              new EventTest();
    }

  • Can't get counter 2/3 working in simple event counting mode for NI6601

    I have been successfully been able to get counter 0 and 1 working in a simple event counting mode. But when I read Software Save register for counter2/3 it gives me garbage values. I am doing register level programming in C.
    This is the algorithm that I follow
    In initialization:
    -> Reset the Counter
    -> Write32( Clock_Config_Reg, 0x00)
    -> Write Load A and LoadB registers
    -> Write to Input Select Register with appropriate values
    -> Write16( Command_Reg, 0x0125);
    Then when I need to read the SW save register value
    -> Write to Command Register  setting the  gi_Arm bit
    -> Reading the SW save register twice
    -> If not equal ,read again
    -> Write to Command Register  disabling the  gi_Arm bit
    This works just fine for counter 0 and 1. But I can't get it working for counter 2 and 3. Are there any other registers I need to set up correctly for counter2/3. Is the default reset values of registers different for counter 2 and 3?
    Any help would be very appreciated
    Thanks

    Hello manisha,
    Is there a particular reason for using register level programming to interact with your DAQ card, rather than the DAQmx driver?  The reason I ask is because we don't support RLP at NI.  There are some manuals that have been developed, such as this one which corresponds to your card, but I am unable to offer any support after that.  If it is necessary that you must use RLP then you should post your question to the DDK forum, as they have more experience in this area.
    Regards,

  • Swing event queue, modal dialogs, event threads, etc...

    Hey all,
    So I am playing around with the focus manager, swing event thread and event queue, etc. Learned quite a bit. I am also playing around with test automation of our UI, using jfcUnit. I have written a few simple apps to play aorund with record/playback, coding tests, etc. What this thread is about though, is figuring out how modal and non-modal dialogs "take over" the event thread/queue? The reason I ask is, if I put a simple test harness like tool embeded in my app as a separate pop-up modal dialog, and from within it there is a GUI that I can use to select a "Test" to run. Now, when I run this test, jfcUnit needs to run on the main window, not within my non-modal dialog. What I am not sure of, however, is that if by using a non-modal dialog all events will go to the main event thread? I mean, I know if I mouse over my second non-modal frame (spawned from the application frame), that events will trigger for that dialog. I remember reading somewhere that modal dialogs "block" the main event queue, all left over events are given to the newly added event queue (presumably by the modal dialog) and existing left-over events get moved to the event queue. If that is the case, I am curious why events for the "old" queue are moved to the new queue if they were orginally intended for the old queue? I would think a "flush" before adding a new queue would be more appropriate so that the old queue can process all of its intended events.
    Now, I am just about to try this, but I am hoping a non-modal pop-up will not interfere with the jfcUnit running the UI of the main window. I am guessing, however, that it might. How are non-modal dialogs handled in terms of events and the event queue? Is it the same as modal dialogs? Or is there no blockage of the mainwindow event queue? If there is no blockage, than any sort of automation based on relative positions to a window may occur on the non-modal dialog, in which case it's best to hide the non-modal dialog during running of these tests.
    What are your thoughts, or better yet, knowledge of this topic? A decent explanation from a developer standpoint and not from the API's which dont give some of the more detailed info I am seeking is what I am hoping to get out of this.
    Thanks.

    Check this out. First, AWTListener has a LOT of
    different types you can register it for. I ORd all
    them together and when I ran my app, it took almost 30
    minutes for it to show up because of the huge stream
    of events being spit out via System.out. ...Yes, that doesn't surprise me in the least. There's hundreds of events that are fired around, usually unbeknownst to the user for every little thing. Lots of component and container events, in particular.
    Just make sure you OR ( using | not || ) ALL the
    "mask" values you want to watch for. That may be why
    you aren't seeing anything. When I did all that, and
    opened a menu, a ton of events came out.Maybe, I'll try that again, but I did specifically add an ActionEvent mask to get action events, and that should be all I need to get action events on buttons or menu items, and it wasn't getting them for either. It was only getting events on buttons when I used SwingEventMonitor, but not menu items.
    So I don't quite understand enough of the underlying event handling. Although, I suspect it could have something to do with the fact that these are Swing components, not AWT components (which their native peers) and it's pretty clear from AbstractButton (or was it DefaultButtonModel) how ActionEvents are fired, and they don't seem to have any connection to the code that deals with AWTListeners.
    My problem is that I kinda need a way to catch events without having a listener attached directly. Normally, I would have a listener, but there's this situation whereby an action may be triggered before I can get hold of the component to attach my listener to it. Perhaps I can get mouse press/release and just deal with it that way.
    Let me know if you did that and still didn't see what
    you were looking for. After playing with this, I am
    guessing the main reason for AWTListener is to
    register a listener for a specific type of event,
    instead of listening to them all, hence avoiding lots
    of extra overhead. Then again, the main event
    dispatcher must do a decent amount of work to fire off
    events to listeners of specific awt event types.Yes, it's definitely that. There's no point in sending events if no one is listening for it, so it does save some time.
    You are right, popup menus I think are dialogs, I
    don't know for sure, but you can access them via the
    JMenu.getPopupMenu() and JMenu.isPopupShowin().
    However, I am still not getting my test stuff working
    quite right.
    Yes, for menu popups. For a JPopupMenu on a right-click on any component (tree or whatever), I had a need to know about that from any arbitrary application (it's this GU testing app I'm working on), and since the popup menu doesn't belong to any component before it's shown, I couldn't necessarily know about it til it was displayed. I managed to use a combination of HierarchyEvents (using an AWTEventListener) and "component added" ContainerEvents. Not a simple matter, but it seems to work well.

  • Synchronize AccessBridge thread with AWT event thread?

    Hi,
    I am a beginner in Java Access Bridge.
    I am writing a program that runs with Java Web Start and uses JFC Swing. For system monitoring purpose my company uses HP OpenView. Probe Builder is used for recording a probe for the application. The probe will be run at regular intervals to check if anything is broken. As I understand Probe Builder uses Java Access Bridge to record & control the application flow.
    Without Java Access Bridge my program runs fine. But when I run it with Probe Builder I occasionally catch some exceptions that indicate that there are two threads running over my gui classes at the same time, the AWT event thread and another thread that comes from com.sun.java.accessibility.AccessBridge.run.
    Since my classes are not thread safe (like all the Swing classes) there are race conditions that result in a NullPointerException.
    My question is that how can I make sure that only one thread at a time is running over my code? Can I somehow make Java Access Bridge run with the AWT event thread? Or do I have to synchronize all my methods - I want to avoid this since I am not sure that this can be done perfectly.
    I will appreciate any help.
    Thanks
    Message was edited by:
    karneim

    Maybe there is some other way to "kill" this thread because for some specific reasons I don't think I will be able to use System.exit(). This reason is - I'm using this Java program in Lotus Notes (don't know if you have had any experience with this) and if I call System.exit() then some important clean-up (garbage collection) won't be done.

  • I'm trying to use DAQmx for simple event counting using PFI8

    Hi,
    I am presently using Traditional DAQ (Legacy) drivers in my software, however I'm in the process of switching over to DAQmx drivers.  Our systems use an E Series DAQ card: PCI-MIO-16XE-10.
    I use PFI8 along with Counter 0 to do simple event counting.  The signal is connected to PFI8 and as it changes, my counter output either increase or decreases in value.  The attached vi shows how I've done it in the past using the Legacy drivers (top portion of the vi) and how I'm attempting to do it using the DAQmx drivers.  I've combined both versions on the single vi just for illustration purposes - when I do my testing they are on separate vi's.
    I'd appreciate it if anyone could help me to figure out why my DAQmx version isn't working properly.  Thank you very much!
    Steve
    Attachments:
    PFI8_DAQ_Comparison.vi ‏36 KB

    Hey Steve,
    The DAQmx driver installs several examples into LabVIEW that
    demonstrate how to implement various event counting applications.  I
    recommend you look over these and see if any of them accomplish what
    you're trying to do.  They're usually very simple to understand and
    well documented, but I'd be happy to help you out with any of them if
    you had a particular question. 
    You can find them in the Example Finder (Help >> Find Examples)
    in LabVIEW.  Drill down to the following location in the directories:
    Hardware Input and Output >> DAQmx >> Counter Measurements >> Count Digital Events
    You'll see a number of examples, but I recommend starting with 'Count Digital Events.vi'
    Since PFI8 corresponds to CTR0 SRC, make sure you set it to use counter 0.  This should work correctly.
    Elijah Kerry
    Senior Product Manager, LabVIEW
    Follow my Software Engineering for LabVIEW Blog

  • A Simpler, More Direct Question About Merge Joins

    This thread is related to Merge Joins Should Be Faster and Merge Join but asks a simpler, more direct question:
    Why does merge sort join choose to sort data that is already sorted? Here are some Explain query plans to illustrate my point.
    SQL> EXPLAIN PLAN FOR
      2  SELECT * FROM spoTriples ORDER BY s;
    PLAN_TABLE_OUTPUT
    |   0 | SELECT STATEMENT |              |   998K|    35M|  5311   (1)| 00:01:04|
    |   1 |  INDEX FULL SCAN | PKSPOTRIPLES |   998K|    35M|  5311   (1)| 00:01:04|
    ---------------------------------------------------------------------------------Notice that the plan does not involve a SORT operation. This is because spoTriples is an Index-Organized Table on the primary key index of (s,p,o), which contains all of the columns in the table. This means the table is already sorted on s, which is the column in the ORDER BY clause. The optimizer is taking advantage of the fact that the table is already sorted, which it should.
    Now look at this plan:
    SQL> EXPLAIN PLAN FOR
      2  SELECT /*+ USE_MERGE(t1 t2) */ t1.s, t2.s
      3  FROM spoTriples t1, spoTriples t2
      4  WHERE t1.s = t2.s;
    Explained.
    PLAN_TABLE_OUTPUT
    |   0 | SELECT STATEMENT       |              |    11M|   297M|       | 13019 (6)| 00:02:37 |
    |   1 |  MERGE JOIN            |              |    11M|   297M|       | 13019 (6)| 00:02:37 |
    |   2 |   SORT JOIN            |              |   998K|    12M|    38M|  6389 (4)| 00:01:17 |
    |   3 |    INDEX FAST FULL SCAN| PKSPOTRIPLES |   998K|    12M|       |  1460 (3)| 00:00:18 |
    |*  4 |   SORT JOIN            |              |   998K|    12M|    38M|  6389 (4)| 00:01:17 |
    |   5 |    INDEX FAST FULL SCAN| PKSPOTRIPLES |   998K|    12M|       |  1460 (3)| 00:00:18 |
    Predicate Information (identified by operation id):
       4 - access("T1"."S"="T2"."S")
           filter("T1"."S"="T2"."S")I'm doing a self join on the column by which the table is sorted. I'm using a hint to force a merge join, but despite the data already being sorted, the optimizer insists on sorting each instance of spoTriples before doing the merge join. The sort should be unnecessary for the same reason that it is unnecessary in the case with the ORDER BY above.
    Is there anyway to make Oracle be aware of and take advantage of the fact that it doesn't have to sort this data before merge joining it?

    Licensing questions are best addressed by visiting the Oracle store, or contacting a salesrep in your area
    But I doubt you can redistribute the product if you aren't licensed yourself.
    Question 3 and 4 have obvious answers
    3: Even if you could this is illegal
    4: if tnsping is not included in the client, tnsping is not included in the client, and there will be no replacement.
    Tnsping only establishes whether a listener is running and shouldn't be called from an application
    Sybrand Bakker
    Senior Oracle DBA

  • Kill Event thread or abort/restart main VI

    I am looking for a method of killing off an event thread once it is in the middle of executing.  A description of my problem is below (I am using labview 8.2).
    My main VI is reading my DAQ and constantly updating the main control panel with the data and logging the data at operator defined rates.
    The user can then select different functions for the system to execute using an enumeration and a Boolean control.
    When the user selects the Boolean control (run button) an event is triggered, the ENUM is read, and various sub-vi's execute to complete the function (none of the sub-vis have visible control panels all of them use some of the data from the main vi's controls/indicators passed by reference).
    The user also has a stop button.  If pressed another event is generated.  I would like to kill the run event in this case, at any point in its execution (long delays in some of the sub-vi's).  Then I can set the system back to default and continue on selecting another function in the enumeration and run button press.
    I would also considering aborting the main vi and then restarting it as long as the front panel remains open.

    I appreciate the reply.  I agree that the event cannot be killed, I have tried several "tricks".  The code does go into the stop event while the run event/sub vi is executing. 
     I had the ref to the stop button wired into the sub-vi's already.  Some of these vi's are fairly in depth, do you have a recommendation to continuously read its state without getting into every loop etc that is in the sub-vi?  I was trying not to monitor this buttons state at every point in the sub-vi's block diagrams.
    Thanks

  • JColorChooser hangs event thread on Linux x64

    I am finding that repeatedly displaying a JColorChooser, picking a color, and clicking "OK" will hang the event thread in 64-bit Ubuntu 9.04 (Java 6 Update 13). Usually it takes between 2 to 20 launches of the JColorChooser before the color chooser will not launch and the UI is frozen. I cannot reproduce this using 32-bit Windows XP. I can even use the Sun Java Tutorial code and the problem occurs every time (Tutorial Link for a Color Editor in a JTable: http://java.sun.com/docs/books/tutorial/uiswing/examples/components/TableDialogEditDemoProject/src/components/ColorEditor.java).
    Has anyone else seen this problem and found a workaround of any kind? Or has anyone tested this on 64-bit linux with Java 6 without problems? Thanks much to all for any help.

    Here is a testbed that will produce the problem for me.
    * 1) Run the testbed.
    * 2) Click the button.
    * 3) Pick a new color swatch.
    * 4) Click OK.
    * 5) Repeat steps 2-4 until the color chooser does not launch.
    * (This was between 1 and 25 times for me)
    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JColorChooser;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    * This class demonstrates a problem with JColorChooser.
    * I encountered this problem launching a color chooser from a
    * table cell, thus this example is based on table cell editor
    * code from the Java Tutorial (ColorEditor.java). I have added a
    * main() and removed some of the Table related noise.
    * 1) Run.
    * 2) Click the button.
    * 3) Pick a new color swatch.
    * 4) Click OK.
    * 5) Repeat steps 2-4 until the color chooser does not launch.
    * (This was between 1 and 25 times for me)
    public final class ColorChooserTest implements ActionListener
    private Color currentColor = Color.BLUE;
    private final JButton button = new JButton("Push Me");
    private final JColorChooser colorChooser;
    private final JDialog dialog;
    private static final String EDIT = "edit";
    private final JFrame frame = new JFrame("JColorChooser TestBed");
    public ColorChooserTest() {
    button.setActionCommand(EDIT);
    button.addActionListener(this);
    button.setBorderPainted(false);
    button.setBackground(currentColor);
    //Set up the dialog that the button brings up.
    colorChooser = new JColorChooser();
    dialog = JColorChooser.createDialog(button,
    "Pick a Color",
    true, //modal
    colorChooser,
    this, //OK button handler
    null); //no CANCEL button handler
    final JPanel holder = new JPanel(new BorderLayout());
    holder.setBorder(BorderFactory.createEmptyBorder(20,20,20,20));
    holder.add(button, BorderLayout.CENTER);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(holder, BorderLayout.CENTER);
    frame.pack();
    public void actionPerformed(final ActionEvent e)
    if (EDIT.equals(e.getActionCommand()))
    //The user has clicked the cell, so
    //bring up the dialog.
    button.setBackground(currentColor);
    colorChooser.setColor(currentColor);
    dialog.setVisible(true);
    else
    //User pressed dialog's "OK" button.
    currentColor = colorChooser.getColor();
    button.setBackground(currentColor);
    public static void main(final String[] args)
    final ColorChooserTest x = new ColorChooserTest();
    x.frame.setSize(300, 300);
    x.frame.setVisible(true);
    }

  • Simple Event being Displayed Multiple Times

    I have a simple event from the past that is being displayed multiple times. There are no other UIDs that are the same in iCal and no other event has the same SUMMARY name.
    This particular event shows up 9 times. I can also reproduce the result from Automator by searching the specific calendar and looking for events in the date range.
    The event is as follows:
    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//Apple Inc.//iCal 3.0//EN
    CALSCALE:GREGORIAN
    BEGIN:VEVENT
    SEQUENCE:5
    TRANSP:OPAQUE
    UID:EC6F5DBC-9BCC-4007-87F2-4A9C796C8551
    DTSTART:20070330T000000
    DTSTAMP:20071206T205550Z
    SUMMARY:Babysit Paul
    CREATED:20080919T173959Z
    DTEND:20070401T120000
    END:VEVENT
    END:VCALENDAR
    I am not very familiar with the format but it looks pretty straight forward.
    The calendar is being synched via Mobile Me and is shared by another two computers. Not sure why this should be relevant since the entry on the computer and on Mobile Me both show this duplication of the event.
    The reason I was looking at all was because of the hangs in iCal since I set the sync to automatic.
    Any ideas welcome,
    Richard

    Post Author: foghat
    CA Forum: Data Connectivity and SQL
    If all the records you are displaying in your report
    truly are duplicated, you could try check off 'select distinct records'
    from the File --> Report Options menu.  While this may solve the problem for you, it would be worthwhile to determine if you are actually joining your tables correctly.
    likely the records aren't an exact duplicate and the problem is with your join criteria.  To verify this you can:  start by removing table b from the database expert altogether.  does
    that solve your problem of multiple rows?  If it does, you are not joining to table b correctlyIf you still have
    multiple rows, loan_id on its own must not make a record unique.  Is
    loan_id duplicated in either of your tables?  Just because loan_id is a
    primary key does not necessarily mean it is unique - often a record
    will have 2 or more primary keys and only when all primary keys are
    used is the record unique.   If you display all of the columns
    from both tables, you will hopefully see some (maybe just one) columns
    where the value is different between your seemingly duplicate data.
    You may need to join on this value as well.as for the type of join you are using (inner, not enforced) you should be fine. Good luck

  • Thread questions

    Hi,
    Here are my Thread questions:
    Q.1 I don't understand interrupt() and internal flag and when should I use it?
    Q.2 What does "No thread can make another thread yield" mean?
    Q.3 Given:
    public class MyRunnable implements Runnable
         public void run()
              //some code here
    What is the proper way to create and start this thread?
    Ans: new Thread(new MyRunnable()).start();
    Why does it need to add new Thread as prefix?
    Q.4 Given:
    public class MyT extends Thread
         public void run()
              try
                   for(int i=1; i<5; i++)
                        System.out.print(i + " ");
                        if(i>2)
                        interrupt();
                        sleep(1000);
                        if(interrupted())
                        break;
              catch(InterruptedException e)
                   System.out.print("Caught");
    Assume another object creates an instance of this Thread and starts it. Why does the outcome is:
    1 2 3 caught
    Thanks
    gogo

    You can find a lot of answers to your questions in the java tutorial.
    http://java.sun.com/tutorial

  • Simple X-fi Question, Please Help

    !Simple X-fi Question, Please HelpL I've been looking for an external sound card that is similar to the 2002 Creative Extigy and think I may found it in the Creative X-Fi. I have some questions about the X-fi though. Can the X-fi:
    1. Input sound from an optical port
    2. Output that sound to 5. surround- Front, surround, center/sub
    3. Is the X-Fi stand-alone, external, and powered by a USB or a wall outlet (you do not need a computer hooked up to it)
    Basically I want to connect a TosLink optical cable from my Xbox to the X-Fi. That will deli'ver the sound to the X-Fi. Then I want that sound to go to a 5. headset that is connected to the X-fi via 5. front, surround, and center/sub wires. The X-Fi has to be stand-alone and cannot be connected to a PC to do this.
    Thank you for your help.

    The connector must match, and the connector polarity (plus and minus voltage) must match.  Sorry, I don't know if the positive voltage goes on the inside of the connector or the outside.    Any wattage of 12 or more should be adequate.
    Message Edited by toomanydonuts on 01-10-2008 01:29 AM

  • Wait while event thread has been removed all events

    hi,
    how can i wait while the event thread has been work out all its events in the queue? is there something like eventQueue.isEmpty();???

    Have a look at invokeLater()

  • Updating component within awt-event thread of another component

    Hi,
    I'm having trouble updating (repainting) a component inside the awt-event thread of another component. The component I want to update is a JFrame with a JLabel that lists the progress of the original component's action that triggered the event. I can get the frame to pop up but it's content is never fully painted and never refreshed.
    I've tried using invokeLater() (the frame ran after the original awt-event had finished) and invokeAndWait() (blocked the original awt-event) and running the computational intensive parts of the original component's action in SwingWorker threads (no difference) but all to no avail.
    What I want to do is similar to a progress bar so I think it should possible. Any suggestions? Thanks, Matt

    Are you calling yield() or sleep(...) on your Thread?

Maybe you are looking for

  • Multiple issues with PCI-5640R FPGA: DAC and Strange Execution at Host

    We are working on a communications systems project using the PCI-5640R IF-RIO transceiver and the FPGA module. At the FPGA, a sequence of bits are being modulated through multiplication with the sine wave generator.  The next step is to take the modu

  • Print button on custom screen

    Hi all, I made a custom screen and a menu (status ) for that using menu painter. I want to put a button there for printing the screen. What code i have to write for that print button so when user presses print button, it prints the screen???? Thanks

  • Office 365 Sharepoint Administration

    Hi, I am trying to explore the Sharepoint part of my newly activated Office 365. When clicking the Admin > Sharepoint menu, I am getting this error.  Note: I removed the personal details for privacy. Something went wrong We're sorry, sign-in isn't wo

  • Make an Indesign plugin

    Hi ! I need help to make a indesign plugin with panel. It's doesn't work for me ! I have : - Xcode 3.2.1 - SDK CS 5.5 When i open a exemple project that is working (many exemple project make error when i build them) and when i build it, it create man

  • Multiple RDS Device CALs Issued through Windows 2003 RDS Hosts

    Environment Windows 2012 R2 RDS license server issuing device CALs 5 Citrix farms (PS4, PS4.5, XA5, XA6, and XA6.5)  Symptoms - RDS device CALs issued through the PS4/Windows 2003 R2 and PS4.5/Windows 2003 R2 servers show the Citrix server name in th