Cursor setting problem

Below is a simple example of a frame that contains a button to call a method (longProcess()) that takes some time to execute. While longProcess is executing, the cursor is changed to an hour-glass. The problem I have is that when the cursor leaves the frame, it turns back to an arrow. Can you suggest an event listener that I can use to detect that the cursor is entering the frame, so that I can set the cursor back to an hour-glass?
Thanks for your help.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class TestDialog {
  public static void main(String[] args) {
    JFrame frame = new TestFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.show();
class TestFrame extends JFrame {
  public TestFrame() {
    setTitle("Dialog Test");
    setSize(400, 350);
    Container contentPane = getContentPane();
    JButton button = new JButton("Run");
    contentPane.add(button);
    button.addActionListener(
      new ActionListener() {
        public void actionPerformed(ActionEvent event) {
          setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
          longProcess();
          setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    setVisible(true);
  void longProcess() {
    try {
      Thread.sleep(10000);
    catch (InterruptedException ex) {
}

You want to look for mouse motion. Try
    Toolkit.getDefaultToolkit().addAWTEventListener(
        someListener, AWTEvent.MOUSE_MOTION_EVENT_MASK  );or
    someComponent.addMouseMotionListener( someListener );

Similar Messages

  • Recommended OPEN CURSORS setting for Oracle serving a web app

    G'day
    Hopefully Phil is still lurking here, so might see this.  Or anyone else that knows about Oracle.
    I've always thought the default for "maximum pooled statements" setting for an Oracle DSN - which is 300 - is way too low to be sensible for a web app (which, let's face it, any CF DSN is going to be used for!).  I usually find I end up with it up around 1000-2000, depending on the sizeof the app, and how busy it is.
    I'm adequate with monkeying around with Oracle, and have needed to do a moderate bit of that sort of thing in our dev environment, but I am by no means a DBA, so it's all very seat-of-the-pants.
    So I'm keen to know what other people have their maximum pooled statements / open cursors setting set to for their Oracle-driven web sites/apps.
    One of the reasons I'm asking is that I wonder if it might be worth while to suggest the default for CF9 is upped to 1000 or so..?
    Thoughts / comment?
    Adam

    I personally would not set the limit any higher than 300, and I'd consider keeping it even lower.
    Each pooled query / open connection is imposing resource-burdens on both the CF and the Oracle servers by creating what might be thought of as "a very crowded restaurant."  Most of them are just standing around, but they nevertheless are occupying the restaurant, and the potential exists that every one of them might try to order a burger-and-fries at exactly the same time.
    The "number of pooled statements" should be such that your SQL-server can actually handle that number of simultaneous requests, both in terms of active searches and of maintaining the still-open result sets.  Beyond that point, incoming web requests should be forced to wait.  Set an "occupancy limit" to your proverbial restaurant such that everyone could come in and be timely served at the same time.
    Categorically, if you plot out response-time graphs about such things (SQL servers, virtual memory subsystems, and so on), they exhibit a fairly-linear performance curve up to a point, after which "the elbow- or knee-point is reached" and beyond that point it becomes exponential in a very, very bad way.  I saw this happen in a batch-processing subsystem long ago on a very small mainframe:  (yeah, I'm makin' these numbers up...)
    Number of Jobs at Once
    Completion Time per Job
    1
    30 seconds
    3
    40 seconds
    8
    9 minutes
    12
    4.5 hours
    It was just-about that bad.  And what I did to (dramatically...) address the problem was to impose simultaneous-job limits on that subsystem.  As long as the number of simultaneous jobs was constrained to "less than 3 at a time," a workload of 12 jobs could be reliably completed in (4 * 40) seconds, whereas if all 12 jobs tried to run at once, the computer would have reason to file a lawsuit for abuse.

  • Getting ORA-01000 : maximum open cursors exceeded  problem

    I am getting ORA-01000 : maximum open cursors exceeded problem in my piece of java code when the
    load is high .Open cursors is set to 1000 still getting the same problem .
    Basically i have to select some rows from a table which i am doing in A() function and process it and insert into
    another table which i do it in another function B() there is a update statement also in this fun.
    There is a particular business logic for which i need to call B() from the A() function
    which happens to be in the select result set like below
    A()
    query ="Select * from temp";
    while(rs.next)
    B();
    All the result sets are properly being closed that too in finally block.
    I dont see any other problem with code .Still I am gettin this cursor problem.
    Is some thing wrong with the design like calling a
    insert from a result set while loop or the update statement

    The code below is deleting fine. Check your $id is valid. I wonder if ADOdb has some quirks with binding and variable creation/destruction, similar to #1 in http://www.oracle.com/technology/tech/php/htdocs/php_troubleshooting_faq.html#bindvars
    <?php
    See ADOdb Tutorial for Oracle: http://phplens.com/lens/adodb/docs-oracle.htm
    drop table mytab;
    create table mytab (city varchar2(20), country_id varchar2(20));
    insert into mytab values ('SF', 'US');
    insert into mytab values ('Sydney', 'AU');
    insert into mytab values ('London', 'UK');
    commit;
    require_once("/home/cjones/public_html/php/adodb5/adodb.inc.php");
    $db = ADONewConnection("oci8");
    $db->Connect("//localhost/XE", "hr", "hrpwd");
    echo "Before:\n";
    $rs = $db->Execute("select city from mytab");
    while ($arr = $rs->FetchRow()) {
        echo $arr['CITY'] . "\n";
    $s = $db->Prepare("delete from mytab where country_id = :ci");
    $db->Parameter($s, $ci, 'ci');
    foreach (array('US', 'AU') as $ci) {
         $db->Execute($s);
    echo "After:\n";
    $rs = $db->Execute("select city from mytab");
    while ($arr = $rs->FetchRow()) {
        echo $arr['CITY'] . "\n";
    ?>There's another sample in the ADOdb OCI8 driver:
              Usage:
                   $stmt = $DB->Prepare("insert into table (col0, col1, col2) values (:0, :1, :2)");
                   $DB->Bind($stmt, $p1);
                   $DB->Bind($stmt, $p2);
                   $DB->Bind($stmt, $p3);
                   for ($i = 0; $i < $max; $i++) {     
                        $p1 = ?; $p2 = ?; $p3 = ?;
                        $DB->Execute($stmt);
                   }For queries I know this works. I haven't seen any examples that prepare once.
    $rs = $db->Execute("select city from mytab where country_id = :ci", array('ci' => 'UK'));
    while ($arr = $rs->FetchRow()) {
        echo $arr['CITY'] . "<br>\n";
    }

  • Gnome 3 font, cursor, widget problems

    I've just installed Arch on my netbook and have installed Gnome 3. (I've previously used Debian, Ubuntu and Fedora in the past.)
    Gnome 3 works, but looks seriously ugly. Widgets (e.g. volume, network manager) are functioning but are invisible on the top bar. On option screens (e.g. in Settings), visual elements such as the ticks for tickboxes are missing. The terminal font is pretty hideous.
    I found a thread elsewhere on creating a symlink to the default cursor set, which means I at least have the Gnome cursors now. But searching the forums and Google hasn't thrown up a "one-stop shop" answer to the other missing elements from the Gnome 3 desktop. Any suggestions on how to resolve this?
    I have installed all gnome and gnome-extra packages, and apart from the theme elements everything else seems to be working fine.

    Thanks for link, it was useful as far as letting me play with firefox font dpi independently of gnome.  The problem was that I was trying to set the font dpi through gconf, which seems to break gnome font management in bad ways, including crashing gnome-terminal.  Once I set the DPI from the appearance settings dialog, everything worked fine.
    Last edited by astrixx (2008-01-15 07:17:50)

  • Backup failure due to Character set problem

    Hi,
    I am manually running a COLD backup script in Windows NT environment and all the logs has been captured below:
    Recovery Manager: Release 8.1.6.0.0 - Production
    RMAN-06005: connected to target database: db1 (DBID=754030292)
    RMAN-06009: using target database controlfile instead of recovery catalog
    RMAN> shutdown immediate;
    2> startup mount;
    3> RUN {
    4> ALLOCATE CHANNEL disk1 TYPE disk;
    5> BACKUP DATABASE TAG 'db1_db_full' FORMAT 'e:\backup\db1\db1_backup';
    6> copy current controlfile to 'e:\backup\db1\Control_db1.ctl';
    7> }
    8>
    RMAN-06405: database closed
    RMAN-06404: database dismounted
    RMAN-06402: Oracle instance shut down
    RMAN-06193: connected to target database (not started)
    RMAN-06196: Oracle instance started
    RMAN-06199: database mounted
    Total System Global Area 934143244 bytes
    Fixed Size 70924 bytes
    Variable Size 260554752 bytes
    Database Buffers 673439744 bytes
    Redo Buffers 77824 bytes
    RMAN-03022: compiling command: allocate
    RMAN-03023: executing command: allocate
    RMAN-08030: allocated channel: disk1
    RMAN-08500: channel disk1: sid=13 devtype=DISK
    RMAN-03022: compiling command: backup
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure during compilation of command
    RMAN-03013: command type: backup
    RMAN-06003: ORACLE error from target database: ORA-06550: line 1, column 166:
    PLS-00553: character set name is not recognized
    ORA-06550: line 0, column 0:
    PL/SQL: Compilation unit analysis terminated
    RMAN-06031: could not translate database keyword
    Recovery Manager complete.
    As the above log shown, I cannot do any backup command in the RUN bracket and it complains that the character set is not recognized.
    This set of error happens when I have create six other Oracle databases in my NT box. Before that, I can manually run the backup with no problem and a backupset has been generated.
    If you have come across this problem and have solutions of it. That will be great.
    Thanks !!
    null

    kk001 wrote:
    Hi ,
    The export Backup failing due to character set problem
    . . exporting table ravidlx
    EXP-00008: ORACLE error 6552 encountered
    ORA-06552: PL/SQL: Compilation unit analysis terminated
    ORA-06553: PLS-553: character set name is not recognized
    P
    Please suggest how to set character set
    I don't know what you have.
    I don't know what you do.
    I don't know what you see.
    It is really, Really, REALLY difficult to fix a problem that can not be seen.
    use COPY & PASTE so we can see what you do & how Oracle responds.
    do as below so we can know complete Oracle version & OS name.
    Post via COPY & PASTE complete results of
    SELECT * from v$version;

  • Using translate function to correct character set problem....

    I have a table(TBL_STOCK) on Oracle XE.
    Rows come from sql server 2005 with a trigger on sql server table via the linked server.
    But there is a character set problem with some character like İ,Ş,Ğ.
    They change to Ý,Þ,Ð. in Oracle.
    How can i correct these ? Do you suggest the TRANSLATE function ?
    What do u think, if i create an After Insert trigger on Oracle table(TBL_STOCK) and convert these character using the Translate function when they inserted from sql server.
    Anyone have any other ideas that can be more efficient. Any thoughts appreciated.
    Thanks in advance.
    Adam
    PS:The NLS_CHARACTERSET of Oracle is AL32UTF8.

    It is sql server 2005 and Collation is SQL_Latin1_General_CP1_CI_AS

  • I cannot run You Tube Videos on my Apple Macbook Air MD760HN/B with OS X 10.9.4. the video window displays a message " An error occurred, Please try again later." Learn more. The screen is black with this message. There appears to be some setting problem?

    Macbook Air MD 760HN/B with OS X 10.9.4
    4 GB RAM, 1.4 Ghz intel Core i5
    Problem 1
    I.     On Youtube whenever I try to play a video, I get a message on a black screen "An Error Occurred, Please Try Again later. Learn More."
    2.   I think it is some setting problem, being a new mac user, I am unable to sort it out.
    Problem 2.
    How to select more than one file in a folder to copy or delete. like it can be done in Windows with shift Click together.
    if one has to select say, file 25 to file 37 in a folder with 75 files. select all (command A) works but I cannot select few continuous files.

    Macbook Air MD 760HN/B with OS X 10.9.4
    4 GB RAM, 1.4 Ghz intel Core i5
    Problem 1
    I.     On Youtube whenever I try to play a video, I get a message on a black screen "An Error Occurred, Please Try Again later. Learn More."
    2.   I think it is some setting problem, being a new mac user, I am unable to sort it out.
    Problem 2.
    How to select more than one file in a folder to copy or delete. like it can be done in Windows with shift Click together.
    if one has to select say, file 25 to file 37 in a folder with 75 files. select all (command A) works but I cannot select few continuous files.

  • JDeveloper IDE simple setting problem

    Hi,
    Recently we switched to JDeveloper from Visual Cafe .I have a simple setting problem.How can I set the options so that IDE gives, the core java classes and packages,and our application classes and packeges, prompts in imports as well as in code.Where to set the options.
    eg: when I write
    import java. it should prompt all the pakages.
    Thanks in advance.
    -Gopal
    null

    I am not sure I understand what you are requesting, but ...
    You can configure JDeveloper projects to include various libraries by default.
    This is done by selecting menu Tools | Default Project Properties.../ Libraries tab.
    You should define a library for your classes.
    You can import any of the packages / classes from all the libraries which your project includes.
    It would be incorrect for a tool to automatically add a bunch of import lines at the top of every file because each file should import what it needs and just as importantly, not import what it does not need depending on the component type (e.g. a servlet should not include javax.swing.* ).
    An easy way to import elements into JDeveloper is to type in something like:
    import java.
    // and then type in Ctrl Space
    and this launches the package browser, you can select packages or classes to import.
    You can also do this at the variable declaratiton point such as typing in:
    foo() {
    Frame x
    // Press Control Alt Space
    and this will correctly change the type (Frame) to the type you select in the package browser and add the import statement.
    -John
    null

  • Reflection function is not working, unable to click on it at all. Need help! Setting problem?

    Hi all, I seek for your kind expertise advise on my Keynote. Once I've chosen a slide to open, any type of slide at all, my Reflection button or function is unable to be clicked on to perform that function. However, Shadow function facing no problem.
    I can see the Reflection button but it's blurred like not allowing me to click on it at all. Is this cause by some software problem? Or setting problem? iWork has just being installed.
    Appreciate your expert advice and help!

    Thanks Kelly... That's very helpful. Appreciate that very much!
    By the way, if I may ask further, do you know how to how to make the animation like Steve Jobs did during his presentation on Ipad or Ipad2 where the "word" will drop from top onto the centre of the slide with effect or sort of like smoke or dust floating off and dissolved at both sides of the "word"?
    Will be more than grateful to be hear from again! Cheers and thanks again.

  • Oracle 8i us7ascii character set problem - help required urgent.

    Hi frnds,
    I have a oracle 8i database server installed on sun solaris os. The database character set is us7ascii. In one of the tables TIFF images are stored in a long column. I m trying to fetch these images using oracle 9i client and visual basic(oracle ODBC drivers). But i m unable to do so. I can not fetch special characters.
    Is it because of the character set problem? but when i run my code on the server itself, i m able to fetch the images. I tried to fetch the images using oracle 8 i client on windows XP machine but could not do so. Are there any special settings that i have to do on the client side?

    Indeed, it's an ODBC issue. Read this statement from Oracle:
    From ODBC 8.1.7.2.0 drivers onwards it's NOT possible any more to
    "disable" Characterset conversion by specifying for the NLS_LANG
    the same characterset as the database characterset. There is now
    ALWAYS a check to see if a codepoint is valid for that characterset.
    Typically you will encounter problems if you upgrade an environment
    that has NO NLS_LANG set on the client (or US7ASCII) and the database
    was also US7ASCII. This incorrect setup allowed you to store characters
    like èçàé in an US7ASCII database, with the new 8i drivers this is not possible
    any more.
    Basic problem is the 'wrong' characterset US7ASCII in the database. As long as no characterset conversion happens (that's the case on the unix server), special characters are no problem.
    Werner

  • DB Creation(character set Problem)

    HI,
    I am in the process of creating new database from the full export dump file which i got from client. In the export logfile i can see,
    Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    I am creating the database manually at my site and planning to import that full export dumpfile from the client.
    Do i need to create the DB with national character set WE8MSWIN1252 or can i also use character set as AL32UTF8
    I want to se the correct character set so that my import doesn't fails because of charactor set problem.
    Please help me.
    Oracle Version At client site:9.2.0.1
    OS :Windows
    Oracle Version at my site:9.2.0.1
    OS:LINUX
    Thank You..

    I can't answer your question because of several things.
    The first is that all versions of 9i are currently in desupport and it has been years since I've seen one.
    But if I was forced to work with 9i I certainly wouldn't do anything at all until I had patched to 9.2.0.8.
    My recommendation would be, unless someone else can help you, to try it and see what happens.
    Nothing ventured nothing gained.

  • Oracle character set problem - help reqed urgent !!

    Hello frnds,
    I have a oracle 8i database server installed on sun solaris os. The database character set is us7ascii. In one of the tables TIFF images are stored in a long column. I m trying to fetch these images using oracle 9i client and visual basic(oracle ODBC drivers). But i m unable to do so. I can not fetch special characters.
    Is it because of the character set problem? but when i run my code on the server itself, i m able to fetch the images. I tried to fetch the images using oracle 8 i client on windows XP machine but could not do so. Are there any special settings that i have to do on the client side?

    i run my code on the server itself, i m able to fetch
    the images. I tried to fetch the images using oracle
    8 i client on windows XP machine but could not do so.You able to fetch the image , So it is not because of the character set.
    First thing you need to consider is that use certified combination of OS , client and database server only. Check Certify - Oracle's Certification Matrices
    Virag

  • Agent control character set problem

    Hi,
    here's my problem :
    i've got the grid that's running on a RHES4 with an agent. On another RHES4, i've got 10g databases that run and another agent.
    The repository database is configured like this :
    nsl_language = AMERICAN
    nls_territory = AMERICA
    character set = AL32UTF8
    all the uploads from the agent on the RHES4 where the grid is installed are ok.
    On the other server, as soon as there's an UTF8 character in a xml file (like " é " ou " ' "), the upload fails and the agent stops.
    in the logs, it s clear it comes from this. I've deleted all the occurences of UTF8 characters in the xml file and restarted the upload and it's ok...
    I've tested different configurations but without success.
    Any clue ?
    Alivetu

    Thanks for the reply,
    NLS LANG is set on the 2 machines with FRENCHFRANCE.WE8ISO8859P15
    I've added the line '<?xml version="1.0" encoding="ISO-8859-1"?>' at the beginning of the xml file that doesn't work and made a 'emctl upload'....it has passed and the agent has stopped arrived to another UTF8 xml file...
    So, it really is a character set problem but where to set it ???
    Alivetu

  • EXPORT Backup failing due to character set problem

    Hi ,
    The export Backup failing due to character set problem
    . . exporting table ravidlx
    EXP-00008: ORACLE error 6552 encountered
    ORA-06552: PL/SQL: Compilation unit analysis terminated
    ORA-06553: PLS-553: character set name is not recognized
    P
    Please suggest how to set character set
    Regards,
    kk
    Edited by: kk001 on Aug 29, 2011 7:22 PM

    kk001 wrote:
    Hi ,
    The export Backup failing due to character set problem
    . . exporting table ravidlx
    EXP-00008: ORACLE error 6552 encountered
    ORA-06552: PL/SQL: Compilation unit analysis terminated
    ORA-06553: PLS-553: character set name is not recognized
    P
    Please suggest how to set character set
    I don't know what you have.
    I don't know what you do.
    I don't know what you see.
    It is really, Really, REALLY difficult to fix a problem that can not be seen.
    use COPY & PASTE so we can see what you do & how Oracle responds.
    do as below so we can know complete Oracle version & OS name.
    Post via COPY & PASTE complete results of
    SELECT * from v$version;

  • Space Designer Save Setting Problems

    Space Designer Save Setting Problems
    On the right side of the space designer you have "dry" and "rev" settings.
    On reopening the plug-in the dry setting switches back to zero, although I saved it at a different setting...
    Everytime, every project...

    Does it do this on audio/software instrument channels and aux channels?
    In general, when you load SD on an aux channel, Logic assumes it's going to be an FX return and so "helps you out" by setting the dry level to zero for you...
    On other channel types it should work as expected...

Maybe you are looking for