Mystery! line 2 is executing before line 1

This is such a mystery that line 2 is execute before line 1.
please read slowly.
Example! I have a class Payment to make a payment. I could
Call it from 2 classes from class CustomerFrame and from
class AllBalance. and all classes has the customers balance.
now class Payment receives in the constructer. or an object from
class CustomerFrame. or an object from AllBalance.
in order to change the balance from that object.
now after i'm inserting A payment I
have to change the balance from the other classes. so I do A
commit to the database from class Payment. and then I dispose the other
classes and I create A new object from the other classes what I dispose so the is changed.
now please look at this code. Problem with last line of code
//class references
CustomerFrame customerFrame;
AllBalance allBalance;
Object object;
// constructer
public Payments( Object o )
super("Payment");
object = o;
if ( object instanceof AllBalance )
allBalance = (AllBalance) object;
else if ( object instanceof CustomerFrame )
customerFrame = (CustomerFrame) object;
//now after I�m inserting A payment I right
if ( object instanceof CustomerFrame )
customerFrame.dispose();
customerFrame = new CustomerFrame();
//customerFrame.setCustomer(database.findPerson(id));
else if ( object instanceof AllBalance )
allBalance.dispose();
allBalance = new AllBalance( );
Payments.this.toFront();
Now with this last line I have problems. What?
If the �else� statement is execute its ok the Payment frame is on top
but if the �if � statement is execute. Problem! the Payment frame is in back,
but its funny if I put in A JOptionPane.showMessageDialog after the last line from the
�if� statement it works ok;
my god what is he asking?
If you don�t understand my question please give me A code.
That if I change something
from one frame it should change something from the other frame

I can't really understand the question completely, but it sounds to me like the Frame is not coming to the front like it should. The easiest way I have found to make things act sane when a it seems like your swing method isn't doing anything is to actually invoke it through SwingUtilities.invokeLater() ... e.g. for the code you have shown
javax.swing.SwingUtilities.invokeLater(new Runnable() {
   public void run() {
      Payments.this.toFront();
});I don't garuantee that will work but it has seem to help me MANY times when I was extremely perplexed at what was going on. This forces your code to run on the even-dispatch thread (?I think anyways?).
Hope this helps,
Will

Similar Messages

  • Mysterious lines in PDF

    So any help would be useful.
    At our shop we use CS3. Usually when creating our artwork for print we use this work flow:
    1. Flatten transparency
    2. Save as .EPS
    3. Distillation (PDF/X-1a;2001)
    This creates small, strange, artifact looking lines throughout the document. These do not print and if you zoom in on them in acrobat they disappear which would lead one to assume that they do no exist. Recently we had a printer claiming that they printed out and I need to find a way to circumvent these 'mysterious lines'. They also cause a lot of problems with clients.
    So any help, info, input would be helpful because i cannot find any record of this particular thing occurring.
    IM: [email protected]

    I agreed with eja34. if we have versio above 4 then there is no issue.
    ISO FILE

  • Mysterious lines and gradient when printing from Illustrator or pdf on PC and MAC

    First of all I have to admit I'm not a big computer brainiac but this issue keeps on reoccurring no matter what computer I use. When creating files/layouts in Illustrator and either saving them to pdf and then printing or printing directly from Illustrator either from a PC or from Mac (I use both) the print outs come out with mysterious lines and gradient not matter what colour is used. The lines occur on solid colour prints, when gradient or transparency are not used and when they are used as well. Any ideas suggestions how to make them go away?

    Monica,
    Here's an image of a print out that was meant to be a solid black colour. This happens with other colours as well not just with black.

  • Mysterious Lines

    So any help would be useful.
    At our shop we use CS3. Usually when creating our artwork for print we use this work flow:
    1. Flatten transparency
    2. Save as .EPS
    3. Distillation (PDF/X-1a;2001)
    This creates small, strange, artifact looking lines throughout the document. These do not print and if you zoom in on them in acrobat they disappear which would lead one to assume that they do no exist. Recently we had a printer claiming that they printed out and I need to find a way to circumvent these 'mysterious lines'. They also cause a lot of problems with clients.
    So any help, info, input would be helpful because i cannot find any record of this particular thing occurring.
    IM: [email protected]

    Brian:
    You can export PDFs with transparency (export as PDF1.5 or higher) for your clients though this can also cause problems with printing on their end (ie the office laser). But worth a shot.
    You can avoid transparency too, which is not all that hard depending on your design requirements. I haven't found a simple solution, in other words something I know I can send to anyone and completely avoid problems. The only surefire way to do this is to kill off transparency in your docs. Go old school.
    Maybe someone can shed some light on this.
    It's all fine and good to say get a new printer etc etc. But when sending ads to a newspaper that's the only one in town, other solutions are needed. It is clear that your printer should know exactly what those "mysterious lines" are (they're called "stitching" usually) and the fact that they don't should be a HUGE red flag for you in this process.
    http://www.adobe.com/products/creativesuite/pdfs/txpguidecs2.pdf
    J

  • Does an inline view execute before the rest of the select?

    Hi,
    The O'Reilly book Mastering Oracle Sql defines an inline view simply as a
    subquery in a select FROM clause. This conforms to the definitions in
    the Oracle 9i and 10g docs.
    But unlike the Oracle docs, the O'Reilly book says the inline view is,
    like a WITH clause, executed before the rest of the query. I can't see
    how this can be done unless the inline view makes no reference to
    other tables joined in the FROM clause.
    Is there a species of inline view in 9i/10g that IS restricted as above -
    no refs to other tables in the FROM clause - and what is it called?
    Thanks for any help.
    Ken Quirici

    As explained above, Oracle can choose to merge the query if feasible to do so. Look at the two queries and their plans below. The plan in second query changes to creating a temporary VIEW since in that case, Oracle is unable to perform the merge:
    SQL> select *
      2          from scott.emp e,
      3                  (select * from scott.dept d where d.deptno = 10) dd
      4  where
      5          e.deptno = dd.deptno
      6  /
         EMPNO ENAME      JOB              MGR HIREDATE           SAL       COMM     DEPTNO     DEPTNO DNAME          LOC
          7782 CLARK      MANAGER         7839 09-JUN-1981       2450                    10         10 ACCOUNTING     NEW YORK
          7839 KING       PRESIDENT            17-NOV-1981       5000                    10         10 ACCOUNTING     NEW YORK
          7934 MILLER     CLERK           7782 23-JAN-1982       1300                    10         10 ACCOUNTING     NEW YORK
    3 rows selected.
    Execution Plan
    Plan hash value: 3570059291
    | Id  | Operation                    | Name           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT             |                |     3 |   171 |     2   (0)| 00:00:01 |
    |   1 |  NESTED LOOPS                |                |     3 |   171 |     2   (0)| 00:00:01 |
    |   2 |   TABLE ACCESS BY INDEX ROWID| DEPT           |     1 |    20 |     1   (0)| 00:00:01 |
    |*  3 |    INDEX UNIQUE SCAN         | PK_DEPT        |     1 |       |     0   (0)| 00:00:01 |
    |   4 |   TABLE ACCESS BY INDEX ROWID| EMP            |     3 |   111 |     1   (0)| 00:00:01 |
    |*  5 |    INDEX RANGE SCAN          | IDX_EMP_DEPTNO |     3 |       |     0   (0)| 00:00:01 |
    SQL> select *
      2          from scott.emp e,
      3                  (select * from scott.dept d where d.deptno = 10 and rownum > 0) dd
      4  where
      5          e.deptno = dd.deptno
      6  /
         EMPNO ENAME      JOB              MGR HIREDATE           SAL       COMM     DEPTNO     DEPTNO DNAME          LOC
          7782 CLARK      MANAGER         7839 09-JUN-1981       2450                    10         10 ACCOUNTING     NEW YORK
          7839 KING       PRESIDENT            17-NOV-1981       5000                    10         10 ACCOUNTING     NEW YORK
          7934 MILLER     CLERK           7782 23-JAN-1982       1300                    10         10 ACCOUNTING     NEW YORK
    3 rows selected.
    Execution Plan
    Plan hash value: 1670713873
    | Id  | Operation                       | Name           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                |                |     5 |   280 |     2   (0)| 00:00:01 |
    |   1 |  NESTED LOOPS                   |                |     5 |   280 |     2   (0)| 00:00:01 |
    |   2 |   VIEW                          |                |     1 |    19 |     1   (0)| 00:00:01 |
    |   3 |    COUNT                        |                |       |       |            |          |
    |*  4 |     FILTER                      |                |       |       |            |          |
    |   5 |      TABLE ACCESS BY INDEX ROWID| DEPT           |     1 |    20 |     1   (0)| 00:00:01 |
    |*  6 |       INDEX UNIQUE SCAN         | PK_DEPT        |     1 |       |     0   (0)| 00:00:01 |
    |   7 |   TABLE ACCESS BY INDEX ROWID   | EMP            |     5 |   185 |     1   (0)| 00:00:01 |
    |*  8 |    INDEX RANGE SCAN             | IDX_EMP_DEPTNO |     5 |       |     0   (0)| 00:00:01 |
    SQL> disconnect
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL>
    can it, in it's WHERE clause, reference other tables in the FROM clause?No. it cannot. but as said above, tha may not stop Oracle from merging the queries.
    SQL> select *
      2          from scott.emp e,
      3                  (select * from scott.dept d where d.deptno = 10 and e.sal > 1000) dd
      4  where
      5          e.deptno = dd.deptno
      6  /
                    (select * from scott.dept d where d.deptno = 10 and e.sal > 1000) dd
    ERROR at line 3:
    ORA-00904: "E"."SAL": invalid identifier
    SQL>

  • Trigger points for 'Execute before query'  in obiee server

    Hi
    Can anybody tell me when the sql given in the 'Execute before query' ( Connection Pool and go to the Connection Scripts tab) will be executed. Is it overtimes we do a query? Can we have any control over it?
    Thanks a lot
    Regards
    Raj

    Hi,
    You might want to check the NQQuery.log to see the code that it is running before making a connection. Just to confirm that the connection pool step is working fine, could you try with a simple select statement and see that it does not error out. If it does not, you may want to revisit the procedure code again. I understand from the error that it is expecting something after the END statement (kind of weird though!!). I assume in this case, it could not parse that this is a stored procedure call itself may be. One thread I found is http://stackoverflow.com/questions/4270818/ora-06550-and-pls-00103 which you may want to look for the line break characters.
    Hope this helps.
    Thank you,
    Dhar

  • Insert statement executes before If statements

    Hello All,
    I am trying to validate few fields before inserting them into table.
    for example:
    IF params('txtID') IS NULL THEN
    "SOME MSG";
    ELSIF params('txtName') IS NULL THEN
    "SOME MSG";
    END IF;
    INSERT INTO TABLE T1
    VALUES(params('txtID'),params('txtName');
    What I want to do is : I want to validate two fields before inserting.
    Can anyone help me?
    Thank you,
    H.

    It directly executes insert statement. If I delete insert, it executes that IF statement.
    It is strange.Let's be clear about this, it is not strange. Your original IF statements did execute before the INSERT but they did not raise an exception. Consequently the INSERT statement was processed. Your "SOME MSG" mechanism is obviously only triggered after the procedure completed. Walter's solution worked for you because it raise exceptions, which prevented the INSERT statement from executing.
    Anyway, it is obvious that you haven't got NOT NULL enforced on your table, which is A Bad Thing. You shoudn't be enforcing such constraints through a procedure.
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com
    Edited by: APC on Feb 3, 2009 5:48 PM
    Only because the OP edited their final post, and removed the lines I quoted.

  • Can a class or Module be executed before the sender File Adapter execute?

    Hi
    In case of sender adapter the module in the module processor gets executed after the adapter has performed its operation.
    Is there a way I can execute the module before the sender adapter starts execution?
    Or Is it possible to specify a java class to be executed before adapter, through configuration in the communication channel or some other way?
    Thanks
    Vijendra

    HI Vijendra,
    The File module adapter is the first one to get executed.
    The only thing you can do is to run shell scripts if you have to do any activity in the folder or on the file.
    Regards
    Vijaya

  • Return statement executed before soapresult is set

    In my method i'm doing a soap call.
    The return statement is executed before de soapresultset is read.
    is there a way to "delay" the return statement

    Your question doesn't make any sense. Execution leaves the method when it ends or when the return statement is reached. If you want something to happen before the return, then do it before you call return.
    My guess at this point is that you're using exceptions poorly.

  • Default java / jsp file which gets executed before DAM asset rendering

    Hi,
    I have a requirement to implement access control on DAM assets on the basis of a metadata property (tags).
    Is there a default JAVA / JSP file which gets executed before rendering a DAM asset?
    If yes, how can I override it?
    If no, how can I add a new JSP / JAVA file to be executed before rendering of each DAM asset?
    Thanks in advance,
    Anurag

    Hello Anuran,
    I dont think there is any api which is executed when you rendering any DAM asset on page component because for each type of DAM asset there are different APIs available which you use the render those dam asset like "Image" class to render the image asset.
    Each dam asset also support having different rendition format and if you are interested in that then refer http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/dam/api/DamEvent.Type.html
    Please let me know if you need more information
    Thanks,
    Pawan

  • How to suspend the script be executed before Alert.show() completed?

    how to suspend the script be executed before Alert.show()
    completed?
    In a window, when users want query and display new data, they
    should be asked whether to save the old data. The
    queryAndDispleyNewData script should not be executed untile the old
    data is saved or be gived up.
    queryNewData(){
    if (Alert.show(askSaveOrNot)==YES) doSave();
    queryAndDisplyNewDate_Script;
    however, the face if the queryAndDisplyNewDate_Script is
    always executed before doSave(). how could I do?
    Any suggestion will be appreciated.

    You cannot suspend the script. Flex/ActionScript is
    event-driven. When you post a dialog box - modal or not - you
    assign event listeners to it. It is in the event listeners that you
    do whatever it is the dialog is asking - saving data back to the
    server, for example.
    Requesting and posting data to the server is event-driven
    too. If you request data from the server you must process it in an
    event handler (which includes data binding).
    If you are going to develop Flex applications you will need
    to understand event-driven programming.

  • JNI - Java code executed before native code

    Hi there, I'm having a problem, I've got this native thing working but it seems like my java code is being executed before the native one. Example :
    class Hello
    { static { System.loadLibrary("D1"); }
    public native void displayHello();
    public static void main(String[] args)
    new Hello().displayHello();
    System.out.println("kfdhgkfldh");
    The output is:
    "kfdhgkfldh"
    "Message from JNI"
    So the printfunction from the main has been executed before the one in my C++ program
    Any idea why ??
    (this is quite important)
    thx

    Tryfflush(stdin);before returning from the native function

  • Run executable before installation

    Hello all,
    I need small information. Please help me.
    In LabVIEW Installer Window at Advanced settings, we have
    Run executable at end of installation
    Run executable before uninstallation
    Is there is any option for “Run executable before installation”?
    I want to run one LabVIEW exe before installing new software (if Runtime engine is exits in deployment PC).
    Please let me know if anyone have idea.

    The NI installers don't give you a lot of control of how things are done.  Let say you want to allow you users to have a minimum, complete, or custom install of tools.  The NI installers don't have that option.
    In the past when I need more control of how installers run, and their options, I've used a couple of free tools that I've mentioned in the past.  Inno Setup, and the helper program ISTool.
    Using this method I can make an installer, that runs a different installer first, then runs the NI installer.

  • Forcing a line to execute before another - how to

    I am creating a Java desktop GUI application where I am accessing oracle database. Some queries take up to 1 min to return results, so I have a textbox that displays some information like "fetching data" so the user knows wats happening. I am trying to do this by
    public Connection my_db_conn() {
            try {
                    jTextArea1.append(getMyTime() + "\nAttempting connection to harkishora-Oracle dB....\n");
               // connect to dB statements here OR other fetch data queries
                    jTextArea1.append(getMyTime() + "\nconnection established successfully\n");
            } catch (Exception e) {
                jTextArea1.append("\n--------\n" + getMyTime() + "\nUnable to connect to harkishora-Oracle dB. Probably the server is down.\n--------\n");
            return (conn);
        }the issue is before it appends the info "Attempting connection to harkishora-Oracle dB....", I mean before it visually puts the text to the textarea.....it actually executes the connection statements and after it finishes all this prints the info the screen. My idea is to force it to print the info first and then go on to connect to the dB.
    any help would be appreciated.....Thanks in advance.

    Yours is likely a concurrency issue -- where your database code is being called on Swing's Event Dispatch Thread (the EDT) and tying it up. Since this thread is the single thread that Swing uses for painting the GUI and interacting with the user, this effectively freezes your app until the database reading is through.
    Solution: do the database work in a background thread. Please read this for details on the problem and its solution:
    [Concurrency in Swing|http://java.sun.com/docs/books/tutorial/uiswing/concurrency/index.html]

  • Mysterious line of pixels

    (New to Discussions)
    Problem- I'm getting these weird lines appearing on both the Macbook Pro LCD and my external LCD. It happens completely random and no crashing of apps occurs. It shows up on the desktop, Safari, FCP, and almost all other apps. It's not that big of a deal and sometimes you can move a Finder window over it to make it disappear. But it is bothering me when doing some editing and web design. I have captured a screenshot of it occurring in Safari.
    http://www.sethmccollum.info/Picture_1.png

    I have this as well, and it has been an issue for about 3 or 4 months now. I thought it could be an overheating issue, but have seen it happen when I have SMC fans running max speed and my MBP being at a low temp.
    I wish someone knew what was causing this.
    Also, i had spilt water on my AC adapter about 7 months ago, and it ran fine until just recently it started to smoke so I went ahead and bought a new ac adapter...one of my thoughts was that my bad Ac adapter was sending too high of a voltage causing graphical errors within my MBP...not sure if that is the case cause I have not seen any of these lines of pixels since I bought a new adapter. Along with these pixel lines everyone is seeing, my computer sometimes freezes when using graphics heavy programs (Photoshop/iphoto/watching a video on iTunes @ same time ect) And am not sure if it is linked to the graphical pixel lines.
    Hope someone can help, here is a picture of the pixel lines I managed to get:
    [IMG]http://i2.photobucket.com/albums/y5/AlexPuckett/Messupx2.jpg[/IMG]

Maybe you are looking for

  • Vendor rating on source inspection

    Hi, I am doing source inspection for some materials ; now my requirement is I want to consider these usage decision scores given for these inspection lots in vendor evaluation rating,so how to do that. Thanks Vinay

  • Floating fields and added pages

    Hi everybody, My problem is to know how I could bind some floating fields when I get several pages. The user fill in the page 1 of a form and the text appear on the page 1 and on the two following cards. But, but it doesn't work when I add many pages

  • Where to sign up for the HP webOS App News emails?

    Well, I WAS signed up before, but now I guess I no longer am because I am not getting the emails for the free apps anymore.  I haven't gotten a single one!  This is getting incredibly frustrating.  Does anyone know where I can go to re-signup for the

  • All pages disappear when I enable parsing for my SSI in Server 6.1

    I have Sun Java System Web Server 6.1 and Windows 2003 web server. I enabled parsing in order to do includes. Whenever I enable the parsing for all html files, all my pages just completely disappear. If I disable it, the includes don't work. Does any

  • Why is my Pages and Numbers no longer working? Seems they both now have a problem with the latest Mac OS X Update

    Hi I Have a Macbook Pro and always update the OS so it is current. It is now Mac OS X Lion 10.7.4 (11E53) I purchased a copy of Pages and Numbers online a few months back and had no problems using them. Pages version is 4.2 and Numbers is 2.2 Today t