problem with the table of jbuttons actionListener

Hello friends,

I have a class of card whose 52 objects are stored in a vector.

I have 2 players who have a vehicle for 11 objects of type map of each card.

In my DispGame JFrame.
I stored 11 JButtons in a vector that appear in the JPanel.

When I click on a particular card (IE JButton) it is displayed on a JLabel in the middle of the game.
to do this, following code is written to associate the actionlisteners
private void reAssociateBtnListener() {
     for(byte b=0; b<(byte) (btnCardsPL.size()); b++) {
          btnCardsPL.elementAt(b).addActionListener(new BtnCardLocalPlayer(b));
     }
}

private class BtnCardLocalPlayer implements ActionListener {
     byte index;
     public BtnCardLocalPlayer(byte idx) {
          index = idx;
     }
     
     public void actionPerformed(ActionEvent evt) {
          
          // Remove the btnCardPL from the local player button array
          removeCardAndButton();
          
          playCard(index);
       }

     private void removeCardAndButton() {
          
          
          DispGame.pnlGame.remove(btnCardsPL.elementAt(index));    // ERROR aray idx out of bounds
          
          //Game.playerL.plyrCard.removeElementAt(index);
          btnCardsPL.removeElementAt(index);
          
          repaint();
     }
}

protected void playCard(byte b) {


     // Display the image on the board
     
     
     reAssociateBtnListener();         // Problem here
}
Now, here's the real problem. When the JButon is clicked, it is removed from the Vector and JPanel.
Then I re associating the actionListeners.

And also the associated object is removed from the 11 cards of players.

When I re associate the actionlisteners then re action is performed. That is to say the event automatically fires again and a new card is played. How can I stop this!

Below is the reference to my previous post about the event of the dashboard buttons.
Get the index of the clicked on JButton
as suggested by jduprez

I hope I explained my point of view and clearly doubt!

Thanking in advance!

When you 'relink the action listeners', you add only more action listeners to the buttons. You never remove the original action listener. When you press the second button, it has two headphones. When you press the third button, there are three listeners.

Tags: Java

Similar Questions

  • Problem with the table of contents pages and books

    I use 8 HR and generate Webhelp.

    I created a project and had to change a few pages of table of contents and create TOC books instead. I deleted the pages and added books, with the same name. HR, it looks fine, but when I generate the table of contents for the page instead of the book. I tried to clear my cache in Internet Explorer, and the deletion of the page again. Still no help. I rebooted and even rebooted and still have the same thing. Can someone tell me how to solve this problem?

    Thank you.

    Indeed if a book has nothing in it, it will not appear in the table of contents. When you think about it, it is very logical. Why would you want a book to appear if nothing was inside?

    See you soon... Rick

    Useful and practical links

    Wish to RoboHelp form/Bug report form

    Begin to learn RoboHelp HTML 7 or 8 days - $24.95!

    Adobe Certified RoboHelp HTML Training

    SorcerStone blog

    RoboHelp EBooks

  • Problem with the Table result variable

    When you save a document structured in XML, the Table Continuation variable is translated to an entity named "fm.tcont".

    Strangely, the content of the entity is a control character (0 x 11). The file is saved in XML format, but the Analyzer Returns an error,

    Error message to the file d:\test\100219\doc_test.xml.1F0, line 31, char 22,: Invalid character (Unicode: 0 x 11)
    Error on line 31, tank 24, Message: expected a value of literal entity or PUBLIC/SYSTEM identifier
    Parse error on line 31, tank 20: not well formed (invalid token)
    The abandoned analysis.

    The contents of the variable nothing suspicious, it's just '(continued)', where the first character is a normal space.

    If someone had the same problem and knows how to fix?

    It's on FM8.0p277 on Windows XP.

    Thank you very much in advance,

    Johannes

    Johannes,

    I don't have the direct response, because I've never tried. But my EDD has a TableContinuation element that is empty; ESD inserts the table continuation variable. When you export to XML, the element is there as a "marker"; It has NO content. When open in the frame, ESD inserts the variable again. My reasoning is that the table continuation variable has meaning ONLY within FrameMaker. It's a formatting object, not a content container. No post processing of the XML data would not need if so, ITS engine could provide what it is able to understand.

    Anyway, here's how I deal with it.

    Good luck
    Van

  • Page indent the problem with the table of contents entries...

    I have a few entries of table of contents running on more than one line. I would like the text to be indented from the establishment right indent/margin so that text does not as far as the Page numbers on the right margin of the text TOC block extend existing. I put a tab on the right so that the page numbers are tabulated on the right edge of the frame, but if I bring you the right margin with several (currently 5 mm) indenting, I can't have a tab stop to the page outside of the right margin.

    If I insert soft-return/new line tanks they wil get lost every time I have rebuild the table of contents (there will be a lot of it!)

    Any ideas, I'm sure it happens all the time for designers of the book.

    The same way you have a withdrawal of first line, on the left there is a final withdrawal of the straight line. You can set the right two inches (for example) withdrawal and removal of stretch to neutralize two thumbs, all on a single line will go completely to the right of the frame, and any point edge requiring line breaks will break two inches to the left of the right edge of the frame, while the last line will go to the right edge.

  • addChild does not add my mcs. Problem with the table.

    I think that my table is wrong but I do not know why

    SerializableAttribute public class GameSunnyFly extends MovieClip {}

    private var v: Number = 8;

    varObject:String private var;

    i: Number private var;

    arrayObjects:Array private var;

    soundArray:Array private var;

    soundClip:Sound private var;

    randomnumber:Number private var;

    contadorHits:uint private var;

    private var notTweening:Boolean = true;

    tweenedObject:MovieClip private var;

    tiempoTotal:uint private var;

    tiempoTimer:Timer private var;

    clickPoint:Point private var;

    public void GameSunnyFly() {}

    setObjects();

    this.tiempoTotal = 60;

    this.i = 1;

    this.varObject = arrayObjects [i-1];

    this.clickPoint = new focus();

    this.tiempoTimer = new Timer (1000, this.tiempoTotal * 1000);

    this.tiempoTimer.addEventListener (TimerEvent.TIMER, this.onTimerTiempoTimer);

    this.tiempoTimer.addEventListener (TimerEvent.TIMER_COMPLETE, this.onTimerCompleteTiempoTime r);

    this.tiempoTimer.start ();

    this.setSounds ();

    this.addEventListener (Event.ADDED_TO_STAGE, this.onAddedToStage);

    this.soundArray [i - 1] .play (0,999);

    / / make an instance of the library class + addChild Stadium

    function setObjects (): void {}

    var object1:Object1Class = new Object1Class; On the export of the library, you create a custom class + in the code, you must create an instance of this class with the new

    var object2:Object2Class = new Object2Class; Naming Convention better for custom classes to make them more obvious.

    var object3:Object3Class = new Object3Class;

    var object4:Object4Class = new Object4Class;

    var object5:Object5Class = new Object5Class;

    object5, object3, this.arrayObjects = [object1, object2 object4]; You can write like that, or use push

    trace(this.arrayObjects[i-1]); (undefined)

    addChild(this.arrayObjects[i-1]);

    }

    }

    Your builder creates the table arrayObjects when it calls setObjects, but the value because I has not yet been initialized if the lines

    trace(this.arrayObjects[i-1]); (undefined)

    addChild(this.arrayObjects[i-1]);

    are most likely resulting in errors because I would have the default value for a certain number of NaN the

    try to put the

    This.i = 1;

    before the setObjects()

    call in your constructor.

  • problems with the table of contents and index

    I do the localization for the Japan, so I'm all nice and good in Japanese (themes, table of contents and index), however, after compilation, only the TOC and India are in a font that does not support Japanese characters.
    Does anyone have any ideas how to solve this problem?
    Thank you

    Thank you Pete, it's part of the solution.
    In fact, what I discovered on a German forum for RoboHelp, is to set the machine to the locale for the country, and the location is made. I installed the language support pack before my problem and so I was able I was translating into topics. The problem appeared when I tried my first compilation. The subjects were still in Japanese, that I translated, but the table of contents and the index and were the only ones who wrote in a totally unknown style (not Japanese English and not another language, I know).
    Now that I've changed the location of my system, it works.
    So, I think that this should be a first improvement for RoboHelp, right? They boast that they support 35 languages, however the support isn't quite... finish, huh?
    Furthermore, the error message continues to come even after all these changes, but I don't like too much about this, I get what I need.
    Thanks again Pete for the solution and the quick response.

  • Problem with the table editor

    Hi again,

    in the user interface editor, I set up a table with 7 columns, including a tag line. Now I have 3 column is the column on the right. as a result, I chose 3 column, pressed '' Cut column '', and indeed, the column is part. However, I can't do to stick to the right place: if I select the column 6, or 7, or 8 and then press the button "Paste the column", the old column 3 gets stuck, but never in the last column, but in the penultimate...

    What's wrong?

    Thank you

    Wolfgang

    Hi Johannes,

    I solved 'the problem' slightly different cutting and repasting of the right :-) column Thanks anyway!

  • Problem with the Tables of the Buliding warehouse...

    Hi all

    I want to try to create tables DWH via Dac.but now I have error
    takes i.e) Done.some will be fail.we use Sibel 8.1.1 System.
    Once I chicked my logfile.

    createwtables.log

    Siebel Enterprise Applications ODBC import utility, Version 7.7 DDL [18030] ENU
    Copyright (c) 2001 Siebel Systems, Inc. All rights reserved.

    This software is the property of Siebel Systems, Inc., 2207 Bridgepointe Parkway,
    San Mateo, CA 94404.

    The user accepts that any use of this software is governed by: (1) the there is
    the user limits and other conditions of the license agreement which
    has been concluded with Siebel Systems or their dealers. and
    (2) the notice of rights exclusive and limited included in this software.

    WARNING: THIS SOFTWARE IS COPYRIGHTED BY THE AMERICAN AND INTERNATIONAL.
    ANY REPRODUCTION, DISTRIBUTION OR USE OF THIS PROGRAM, OR ANY PART
    OF IT, MAY RESULT IN HEAVY CIVIL AND CRIMINAL PENALTIES, AND WILL BE
    BEING PROSECUTED TO THE EXTENT POSSIBLE UNDER THE LAW.

    If you received this software by mistake, please notify Siebel Systems
    immediately at (650) 295-5000.

    C:\orahome\10gR3_1\bifoundation\dac\UTILITIES\BIN\DDLIMP/i N/s N/u OLAPUSER/p * / OLAP_USER/g SSE_ROLE/f C:\orahome\10gR3_1\bifoundation\dac/conf/sqlgen/ctl-file/oracle_bi_dw.ctl/b/k/x/w Y c

    Connecting to the database...
    Connected.

    Reading tables and DDL file indexes...
    Read 1110 tables and indexes the DDL file 0...

    Existing scheme of reading...
    Read the tablespaces 0, 0 tables and the indexes 0 a schema from existing...

    Running the SQL statements to the database...

    S1000: [DataDirect] [ODBC Oracle driver] [Oracle] ORA-01031: insufficient privileges

    create table M_10A_ORG_D)
    Number DATASOURCE_NUM_ID (10, 0) not null,
    Number (10, 0) ETL_PROC_WID default 0 non-zero.
    Number (10, 0) GEO_WID default 0 non-zero.
    INTEGRATION_ID varchar2 (30 char) not null,
    Number (10, 0) ROW_WID default 0 non-zero.
    Char ACCNT_FLG (1 car).
    ACCNT_REVN (22: 7), the number
    Char ACTIVE_FLG (1 car).
    Char CHANNEL_FLG (1 car).
    CHNL_ANNL_SALES (22: 7), the number
    Char COMPETITOR_FLG (1 car).
    Date of CREATED_DT,
    Char DIVN_FLG (1 car).
    EMP_COUNT (22: 7), the number
    Date of FORMED_DT,
    HIST_SLS_VOL (22: 7), the number
    Char ORG_FLG (1 car).
    Char ORG_PRTNR_FLG (1 car).
    Char PROSPECT_FLG (1 car).
    Date of PRTNRSHP_START_DT,
    Char PRTNR_FLG (1 car).
    PRTNR_SALES_RANK (22: 7), the number
    PTNTL_SLS_VOL (22: 7), the number
    Date of PTSHP_END_DT,
    Char PTSHP_FEE_PAID_FLG (1 car).
    Date of PTSHP_RENEWAL_DT,
    PTSHP_SAT_INDEX (22: 7), the number
    Char PUBLIC_LISTING_FLG (1 car).
    Number SALES_EMP_CNT (10, 0),
    Number SERVICE_EMP_CNT (10, 0),
    U_ACCNT_RVN (22: 7), the number
    Date of U_ACNTRVN_EXCH_DT,
    U_CHNL_ANNL_SLS (22: 7), the number
    Date of U_CH_ASLS_EXCH_DT,
    U_HIST_SLS_VOL (22: 7), the number
    Date of U_HST_SLS_EXCH_DT,
    Date of U_PTL_SLS_EXCH_DT,
    U_PTL_SLS_VOL (22: 7), the number
    ACCNT_LOC varchar2 (50 char),
    ACCNT_STATUS varchar2 (30 char),
    ACCNT_STATUS_I varchar2 (50 char),
    ACCNT_TYPE_CD varchar2 (30 char),
    ACCNT_TYPE_CD_I varchar2 (50 char),
    ANNUAL_REVN_CAT varchar2 (30 char),
    ANNUAL_REVN_CAT_I varchar2 (50 char),
    BASE_CURCY_CD varchar2 (20 char),
    BU_NAME varchar2 (100 char),
    CHNL_SALES_GRWTH varchar2 (30 char),
    CHNL_SALES_GRWTH_I varchar2 (50 char),
    CITY varchar2 (50 char),
    COUNTRY varchar2 (30 char),
    DIVN_TYPE_CD varchar2 (30 char),
    DIVN_TYPE_CD_I varchar2 (50 char),
    DOM_ULT_DUNS_NUM varchar2 (15 char),
    DUNS_NUM varchar2 (15 char),
    EXPERTISE varchar2 (30 char),
    EXPERTISE_I varchar2 (50 char),
    FREQUENCY_CAT varchar2 (30 char),
    FREQUENCY_CAT_I varchar2 (50 char),
    FRGHT_TERMS_CD varchar2 (30 char),
    FRGHT_TERMS_CD_I varchar2 (50 char),
    GLBLULT_DUNS_NUM varchar2 (15 char),
    KEY_COMPETITOR varchar2 (100 char),
    LINE_OF_BUSINESS varchar2 (30 char),
    MAIN_PH_NUM varchar2 (40 char),
    MGR_NAME varchar2 (160 char),
    MONETARY_CAT varchar2 (30 char),
    MONETARY_CAT_I varchar2 (50 char),
    NAME varchar2 (100 char),
    NUM_EMPLOY_CAT varchar2 (30 char),
    NUM_EMPLOY_CAT_I varchar2 (50 char),
    ORG_CITY varchar2 (50 char),
    ORG_COUNTRY varchar2 (30 char),
    ORG_MAIN_PH_NUM varchar2 (40 char),
    ORG_MGR_NAME varchar2 (160 char),
    Nom_org varchar2 (100 char),
    ORG_PRTNR_TIER varchar2 (30 char),
    ORG_PRTNR_TIER_I varchar2 (50 char),
    ORG_PRTNR_TYPE varchar2 (30 char),
    ORG_PRTNR_TYPE_I varchar2 (50 char),
    ORG_STATE varchar2 (50 char),
    ORG_ST_ADDRESS varchar2 (200 char),
    ORG_TERR_NAME varchar2 (75 char),
    ORG_ZIPCODE varchar2 (30 char),
    PAR_DUNS_NUM varchar2 (15 char),
    PAR_INTEGRATION_ID varchar2 (30 char),
    PAR_ORG_NAME varchar2 (100 char),
    PRI_LST_NAME varchar2 (50 char),
    PRTNR_NAME varchar2 (100 char),
    PR_COMPETITOR varchar2 (100 char),
    PR_INDUST_NAME varchar2 (50 char),
    PR_ORG_TRGT_MKT varchar2 (50 char),
    PR_PTSHP_MKTSEG varchar2 (50 char),
    PTSHP_PRTNR_ACCNT varchar2 (100 char),
    PTSHP_STAGE varchar2 (30 char),
    PTSHP_STAGE_I varchar2 (50 char),
    RECENCY_CAT varchar2 (30 char),
    RECENCY_CAT_I varchar2 (50 char),
    Varchar2 (30 char) REGION,
    REGION_I varchar2 (50 char),
    REVN_GROWTH_CAT varchar2 (30 char),
    REVN_GROWTH_CAT_I varchar2 (50 char),
    Varchar2 (50 char) STATE,
    ST_ADDRESS varchar2 (200 char),
    U_ACNTRVN_CURCY_CD varchar2 (20 char),
    U_CH_ASLS_CURCY_CD varchar2 (20 char),
    U_HST_SLS_CURCY_CD varchar2 (20 char),
    U_PTL_SLS_CURCY_CD varchar2 (20 char),
    VIS_PR_BU_ID varchar2 (15 char),
    VIS_PR_POS_ID varchar2 (15 char),
    CODE POSTAL varchar2 (30 char))
    ;
    error writeExecDDL (UTLOdbcExecDirectDDL pDDLSql).
    error writeExecDDL (pOperCallback UTLDbDdlOperTblCreate).
    Error in MainFunction (UTLDbDdlDbMerge).
    Error in the Main function...


    Please let me know how reslove this error...

    Use the setup.exe from Disk1\install\win32
    ex: D:\DAC_V16377-01\dac\Disk1\install\win32

    It works without any problem

    Score pls help if

  • Problem with the table name table of flow (snpRef.getTable ("L", "A", "INT_NAME"))

    I build an interface using "uIKM incremental update Oracle" KM including step "Define vFlowTable" is back in time to run the name of Table Flow below through snpRef.getTable administered:
    String vFlowTable = "<%=snpRef.getTable("L", "INT_NAME", "A")%>";
    I do not understand why the above command is the addition of the character ">" in the name of Table Flow, can someone help me?
    If I change the code below fixing changing '< %=snpRef.getTable ("L", "A", "INT_NAME") % >' to 'ODI_RUN_CONV. "I have$ _CCRSBENE ' without ' > ' interface runs successfully

    <@ 
    String vFlowTable = "ODI_RUN_CONV>.I$_CCRSBENE";
    if("1".equals("1")){
         if("".equals("")){
              vFlowTable = vFlowTable .substring(0,vFlowTable .indexOf(".")+4)+"291248103";
         }else{
              vFlowTable = vFlowTable .substring(0,vFlowTable .indexOf(".")+4)+"";
         }
    }
    @>

    Check the schema name for the data server, maybe the > in the name? ..... ODI_RUN_CONV >

    Also check the local object mask in the definition of technology, maybe some has changed? If his Oracle we %SCHEMA.%O OBJECT

    See you soon
    David

  • Calc problem with fact table measure used in the bridge table model

    Hi all

    I have problems with the calculation of a measure of table done since I used it as part of a calculation in a bridge table relation.

    A table of facts, PROJECT_FACT, I had a column (PROJECT_COST) whose default aggregate is SUM. Whenever PROJECT_COST was used with any dimension, the appropriate aggregation was made at appropriate levels. But, no more. One of the relationships that project_fact is a dimension, called PROJECT.

    PROJECT_FACT contains details of employees, and every day they worked on a project. So for one day, employee, Joe, could have a PROJECT_COST $ 80 to 123 project, the next day, Joe might have $40 PROJECT_COST for the same project.

    Dimension table, PROJECT, contains details of the project.

    A new feature has been added to the software - several customers can now be charged to a PROJECT, where as before, that a single client has been charged.
    This fresh percentage collapse is in a new table - PROJECT_BRIDGE. PROJECT_BRIDGE has the project, CUSTOMER_ID, will BILL_PCT. BILL_PCT always add up to 1.

    Thus, the bridge table might look like...
    CUSTOMER_ID BILL_PCT PROJECT
    123 100.20
    123 200.30
    123 300.50
    456 400 1.00
    678 400 1.00

    Where to project 123, is a breakdown for multiple clients (. 20,.30.50.)

    Let's say in PROJECT_FACT, if you had to sum up all the PROJECT_COST for project = 123, you get $1000.


    Here are the steps I followed:

    -In the physical layer, PROJECT_FACT has a 1:M with PROJECT_BRIDGE and PROJECT_BRIDGE (a 1:M) PROJECT.
    PROJECT_FACT = > PROJECT_BRIDGE < = PROJECT

    -In the logical layer, PROJECT has a 1:M with PROJECT_FACT.
    PROJECT = > PROJECT_FACT

    -Logical fact table source is mapped to the bridge table, PROJECT_BRIDGE, so now he has several tables, it is mapped (PROJECT_FACT & PROJECT_BRIDGE). They are defined for an INTERNAL join.
    -J' created a measure of calculation, MULT_CUST_COST, using physical columns, which calculates the sum of the PROJECT_COST X the amount of the percentage in the bridge table. It looks like: $ (PROJECT_FACT. PROJECT_COST * PROJECT_BRIDGE. BILL_PCT)
    -J' put MULT_CUST_COST in the presentation layer.

    We still want the old PROJECT_COST autour until it happened gradually, it is therefore in the presentation layer as well.


    Well, I had a request with only project, MULT_CUST_COST (the new calculation) and PROJECT_COST (the original). I expect:

    PROJECT_COST MULT_CUST_COST PROJECT
    123. $1000 $1000

    I'm getting this for MULT_CUST_COST, however, for PROJECT_COST, it's triple the value (perhaps because there are quantities of 3 percent?)...

    PROJECT_COST MULT_CUST_COST PROJECT
    123 $1000 (correct) $3000 (incorrect, it's been tripled)

    If I had to watch the SQL, you should:
    SELECT SUM (PROJECT_COST),
    SUM (PROJECT_FACT. PROJECT_COST * PROJECT_BRIDGE. BILL_PCT),
    PROJECT
    Of...
    PROJECT GROUP


    PROJECT_COST used to work properly at a table of bridge of modeling.
    Any ideas on what I got wrong?

    Thank you!

    Hello

    Phew, what a long question!

    If I understand correctly, I think the problem is with your old measure of cost, or rather that combines with you a new one in the same request. If you think about it, your request as explained above will bring back 3 rows from the database, that's why your old measure of cost is multiplied. I think that if you took it out of the query, your bridge table would work properly for the only new measure?

    I would consider the migration of your historical data in the bridge table model so that you have one type of query. For historical data, each would have a single row in the bridge with a 1.0 BILL_PCT.

    Good luck

    Paul
    http://total-bi.com

  • problem with the locking insert and delete between two linked tables help please.

    Hi guys I have a problem with a table of locking in Oracle forms, but when I try in SQL happens here too many users. I was wondering if anyone can shed some light on this?

    I created two scenerios one that works and is not based on the primary key and foreign key constraints (but one that works is not possible for us because it would mean change design table that we can not do).

    I've hardcoded in 1127,1128 number to make it easier (in reality it is a sequence)

    OK scenerio one (our scenerio)

    two tables
     CREATE TABLE testSFLABPR 
       (     LABP_REF_IRN VARCHAR2(25 BYTE), 
         LABP_REF_REF VARCHAR2(30 BYTE), 
         LABP_REF_SL NUMBER(8,0), 
         LABP_CONFIG_ID NUMBER(8,0),
          CONSTRAINT PK_testLABPR_IRN_SL PRIMARY KEY (LABP_REF_IRN,LABP_REF_SL)
       ) ;
    
     CREATE TABLE testSFLABP 
       (     LABP_IRN VARCHAR2(25 BYTE), 
         LABP_OPNO NUMBER(3,0), 
         labp_no NUMBER(8,0),
          CONSTRAINT PK_testSFLABP PRIMARY KEY (LABP_IRN, LABP_OPNO, LABP_NO) ENABLE, 
          CONSTRAINT testFK_SFLABP_SFLABPR FOREIGN KEY (LABP_IRN,labp_no)
           REFERENCES TESTSFLABPR (LABP_REF_IRN,LABP_REF_SL) ENABLE
       ) ;
    OK now session is done the following
    DELETE FROM      testSFLABPR     WHERE   LABP_CONFIG_ID            = 1127;          
                   
    INSERT INTO testSFLABPR(
            LABP_REF_IRN,
            LABP_REF_SL,
            LABP_REF_REF,
            LABP_CONFIG_ID
            )
            VALUES
            (
            'SOPENSHELVING',
            1127,
            1127||'CF Route',
            1127
            );
            
    INSERT INTO testSFLABP
          (
          LABP_IRN,
          LABP_OPNO,
          LABP_NO)
    VALUES (
    'SOPENSHELVING',
    1,
    1127);
    session one remains in this State.

    second session now does the following
    DELETE     FROM testSFLABPR     WHERE   LABP_CONFIG_ID            = 1128;     
    second session is now locked until a commit or rollback occurs.

    If I run the exact scenerio even with only a primary key on the table without locks held
     CREATE TABLE testSFLABPR 
       (     LABP_REF_IRN VARCHAR2(25 BYTE), 
         LABP_REF_REF VARCHAR2(30 BYTE), 
         LABP_CONFIG_ID NUMBER(8,0),
          CONSTRAINT PK_testLABPR_IRN_SL PRIMARY KEY (LABP_REF_IRN)
       ) ;
    
     CREATE TABLE testSFLABP 
       (     LABP_IRN VARCHAR2(25 BYTE), 
         LABP_OPNO NUMBER(3,0), 
         labp_no NUMBER(8,0),
          CONSTRAINT PK_testSFLABP PRIMARY KEY (LABP_IRN, LABP_OPNO, LABP_NO) ENABLE, 
          CONSTRAINT testFK_SFLABP_SFLABPR FOREIGN KEY (LABP_IRN)
           REFERENCES TESTSFLABPR (LABP_REF_IRN) ENABLE
       ) ;
    INSERT INTO testSFLABPR(
            LABP_REF_IRN,
            LABP_REF_REF,
            LABP_CONFIG_ID
            )
            VALUES
            (
            'SOPENSHELVING',
            1127||'CF Route',
            1127
            );
            
    INSERT INTO testSFLABP
          (
          LABP_IRN,
          LABP_OPNO,
          LABP_NO)
    VALUES (
    'SOPENSHELVING',
    1,
    1127);
    DELETE     FROM testSFLABPR     WHERE   LABP_CONFIG_ID            = 1128;
    I hope I posted all the information that is relevant... version of DB were is Oracle Database 10g Release 10.2.0.3.0 - Production

    Any help is appreciated...

    Creating indexes on columns of the FK. Something like:

    CREATE INDEX testFK_SFLABP_SFLABPR_IDX
    ON testSFLABP(LABP_IRN,labp_no)
    /
    

    SY.

  • Problem with the rendering of JProgressBar in JTable

    I have some problems with the rendering of JProgressBar in JTable. In the case of several lines, when a progress bar is updated, and its text is changing, then he painted all the progress bars in this column.

    Here is my code I used to create the table:
    --------------------------------------------------------------------------------------
    JTable convertTable = new JTable(convertTableModel) {
    
                public Component prepareRenderer(TableCellRenderer renderer,
                        int rowIndex, int vColIndex) {
                    Component c = null;
                    if (renderer != null) {
                        c = super.prepareRenderer(renderer, rowIndex, vColIndex);
    
                        if (vColIndex == INDEX_CONVERT_STATUS) {
                            //System.out.println("c = "+c.getClass());
                            if(c instanceof JProgressBar) {
                                //System.out.println("inside = ");
                                c.setBackground(Color.BLUE);
                            }
                        }
                    }
                    return c;
                }
    
                public boolean isCellEditable(int rowIndex, int mColIndex) {
                    if (mColIndex == INDEX_CONVERT_SELECT) {
                        return true;
                    } else if (mColIndex == INDEX_CONVERT_STATUS) {
                        return false;
                    } else {
                        return false;
                    }
                }
    
                /*
                 * JTable uses this method to determine the default renderer/
                 * editor for each cell.  If we didn't implement this method,
                 * then the last column would contain text ("true"/"false"),
                 * rather than a check box.
                 */
                public Class getColumnClass(int c) {
                    if (getValueAt(0, c) != null) {
                        return getValueAt(0, c).getClass();
                    }
                    return null;
                }
            };
    --------------------------------------------------------------------------------------

    Then I applied on this table rendering engine

    ---------------------------------------------------------------------------------------
    // Applying JProgressBar Renderer for convert table
            TableColumn col = convertTable.getColumnModel().getColumn(INDEX_CONVERT_STATUS);
            ProgressBarRenderer progressBarRenderer = new ProgressBarRenderer();
            col.setCellRenderer(progressBarRenderer);
    ---------------------------------------------------------------------------------------

    Class code ProgressBarRenderer is as follows:
    ---------------------------------------------------------------------------------------
    public class ProgressBarRenderer extends JProgressBar implements TableCellRenderer {
    
        private Hashtable ht = new Hashtable();
    
        public ProgressBarRenderer() {
            super(0);
            this.setMinimum(0);
            this.setMaximum(100);
            this.setStringPainted(true);
            this.setBorderPainted(true);
    
            UIDefaults defaults = UIManager.getDefaults();
            Font font = new Font("Arial", Font.BOLD, 12);
            defaults.put("ProgressBar.font", font);
        }
    
        public void setRowEnabled(int row, boolean enabled) {
            ht.put(row, enabled);
        }
    
        public void setForeground(Color c, int row) {
            //System.out.println("setString ht = " + ht.size() + "  row= " + row + "  Selected= " + (Boolean) ht.get(row) + " color= " + c);
            if (ht.isEmpty()) {
                this.setForeground(c);
            } else if (ht.size() == 1) {
                this.setForeground(c);
            } else if ((Boolean) ht.get(row)) {
                this.setForeground(c);            
            } else {
                this.setForeground(c);
            }
        }
    
        public void setString(String s, int row) {
    
            //System.out.println("setString ht = " + ht.size() + "  row= " + row + " text= " + s);
            if (ht.isEmpty()) {
                this.setString(s);
            } else if (ht.size() == 1) {
                this.setString(s);
            } else if ((Boolean) ht.get(row)) {
                this.setString(s);
            } else {
                this.setString(s);
            }
    
        }
    
        @Override
        public Component getTableCellRendererComponent(JTable table,
                Object value, boolean isSelected, boolean hasFocus, int row, int column) {
            
            //System.out.println("getTableCellRendererComponent = " + table);
            //System.out.println("Renderer ht = " + ht.size() + "  row= " + row + "  Selected= " + (Boolean) ht.get(row));
            
            if (ht.isEmpty()) {
                return this;
            } else if (ht.size() == 1) {
                return this;
            } else if ((Boolean) ht.get(row)) {
                return this;
            } else {
                return null;
            }
        }
    }
    ---------------------------------------------------------------------------------------

    I add the next line and rendered the progress column is follows:
       convertTableModel.addRow(new Vector());
       ((ProgressBarRenderer) convertTable.getCellRenderer(row, INDEX_CONVERT_STATUS)).setRowEnabled(row, false);
    ---------------------------------------------------------------------------------------

    When I add the first row, it works fine, but when I add the second row, he painted the entire column.

    Naturally, you will have problems if you set a string or a color of a table cell value when the class of the column is declared as integer. As I have already said, you need to spend some time with the tutorials.

    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Random;
    import javax.swing.*;
    import javax.swing.table.DefaultTableCellRenderer;
    import javax.swing.table.TableCellRenderer;
    
    public class ProgressBarTableCellRendererExample {
    
      Random random = new Random();
      JTable table;
    
      public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
    
          public void run() {
            new ProgressBarTableCellRendererExample().makeUI();
          }
        });
      }
    
      public void makeUI() {
        table = new JTable(10, 1) {
    
          @Override
          public boolean isCellEditable(int row, int column) {
            return false;
          }
        };
        for (int i = 0; i < table.getRowCount(); i++) {
          table.setValueAt(0, i, 0);
        }
        table.getColumnModel().getColumn(0).
                setCellRenderer(new ProgressBarTableCellRenderer());
    
        JButton button = new JButton("Increment");
        button.addActionListener(new ActionListener() {
    
          public void actionPerformed(ActionEvent e) {
            increment();
          }
        });
    
        JFrame frame = new JFrame();
        frame.add(new JScrollPane(table), BorderLayout.CENTER);
        frame.add(button, BorderLayout.SOUTH);
    
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(400, 400);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      }
    
      private void increment() {
        for (int i = 0; i < table.getRowCount(); i++) {
          Object value = table.getValueAt(i, 0);
          if (value instanceof Integer) {
            Integer oldValue = (Integer) table.getValueAt(i, 0);
            int newValue = Math.min(100, oldValue + random.nextInt(25));
            switch (newValue) {
              case 13: // and its multiples
              case 26:
              case 39:
              case 52:
              case 65:
              case 78:
              case 91:
                table.setValueAt("Failed", i, 0);
                break;
              case 100:
                table.setValueAt("Completed", i, 0);
                break;
              default:
                table.setValueAt(newValue, i, 0);
            }
          }
        }
      }
    
      private class ProgressBarTableCellRenderer
              extends JProgressBar implements TableCellRenderer {
    
        private TableCellRenderer stringRenderer =
                new DefaultTableCellRenderer();
    
        public Component getTableCellRendererComponent(JTable table,
                Object value, boolean isSelected, boolean hasFocus,
                int row, int column) {
          if (value instanceof Integer) {
            setValue((Integer) value);
            return this;
          } else {
            return stringRenderer.getTableCellRendererComponent(table,
                    value, isSelected, hasFocus, row, column);
          }
        }
        // Override void validate(), invalidate(), revalidate(), repaint()
        // and all overloads of firePropertyChange(...) as no-ops
        // for efficiency
      }
    }
    

    DB

  • Problem with the new installation of Windows XP on the Satellite A100-259

    Hi all!

    I have a problem with the fresh install WIN XP on Satellite A100-259 (PSAA2E).
    I already deleted the partition, formatted (NTFS) and tried to reinstall from recovery disk that initially provided with the laptop. But whenever I try to install a problem is detected (for the most part it's 'page in the nonpaged area failure').

    I also tried to install the OS directly from MS Windows XP Home Edition SP2 CD - the same problem.
    I checked the partition using PQ Magic and discovered that there are ' partition table error #110 ".» So, what I did:

    (1) delete partition-> create new partition-> format (NTFS)-> reinstall from recovery disk-> has not yet;
    (2) partition delete-> install WinXP CD original by create and format partition option-> has not yet;
    (3) delete the partition (using the magic of pq)-> create partition (using the magic of pq)-> format NTFS partition for win xp option-> check partition-OK no problems don't-> installation of original win XP CD-installation without changes-> option failed even once
    (4) delete the partition (pq magic)-> create partition (pq magic)-> format NTFS partition for win xp option-> check partition-OK, no problem-> installation of the recovery disc-> has not yet

    Whenever a different error is detected, so I can't identify the problem. I don't know what to do. Does anyone have any ideas?

    Hello

    Seems that there are some problems with the standards of the partitions.
    A friend of mine has tried to install the OS on the recovery CD on the laptop that has been formatted with Partitions Magic 8 and the installation failed.
    It was very strange

    Finally, we have formatted the whole HARD drive using the CD original Windows XP Pro.
    We did not remove the partition but simply kicked this CD and after the configuration process spent, we formatted the whole HARD disk and install XP without creating all the partitions.

  • When I print a table (multiple pages) the text box under the table seems to be moving under the table and prints with the table of this overlap. My only solution is to push the text box further down the page before printing... Any advice?

    Im having problems shaped a text box so that my table does not print right on top of it. I want it inside of my table (it's 'tems and conditions' budget)

    Any advice would be great.

    I face the same problem as well. Would like to know if there is a better way to get the text box to move with the table instead of the effect that overlap. Have to manually adjust the layout, whenever I want to get a reasonable print of a document (or export it to PDF) seems counterintuitive, especially when it causes the document seem ill-disposed on screen.

    I am running version 3.6.2 of the numbers in the case where that matters.

  • Problem with the numbers in the rows of cut and paste

    Hey,.

    I'm new to MAC and now have problems with the help of figures, I brought my windows Excel worksheets. On windows, I could cut a line and paste anywhere on this page and by practice that Excel would fill the void rank where I cut the content. but here on MAC it does not work, why?

    anyway I tried to live with it by cutting a line and for the collage, I used Insert > copied lines for paste swath and add a line for her. but last night I updated the numbers and now by the practice precedes the Windrow is stuck this time with a resized form, the line is resized to a big line.

    Why is this happening? If it can't be fixed, I can go back to a previous version of a number? This update of hate.

    Numbers is excellent NO then you should consider to guide your expectations.

    Cut number refers only to the content NOT the line, or cells.  Select when a row, and then use the cut command that you cut the contents of the cells.

    If you try to move a line from one place to another, you should try this method (which can work for you)...

    Select the line, then click and hold on the header line (up to the line "lift" on the table), the operation slide the line to the destination.

    Now drag the line:

    Now drop the line where you want to:

Maybe you are looking for