Two tables with the same selectionModel

Hi to all..
I have been working on a project in java that needs to include two tables.Right now, I have successfully
built two tables (Table A and B) with different type of data from a database and each of it will update when user click a button.
The problem that i have is how to make sure that when user click a row in Table A, any selection in Table B will be deselect.
I am new in programming and still barely understand in Swing components.
Thanks.
Amy

where should I put the line of code.add a mouse listener in table A
put the code on mousePressed.
e.g.
tableA.addMouseListener(new java.awt.event.MouseListener() {
            public void mouseClicked(MouseEvent e) {
            public void mouseEntered(MouseEvent e) {
            public void mouseExited(MouseEvent e) {
            public void mousePressed(MouseEvent e) {
                tableB.clearSelection();
            public void mouseReleased(MouseEvent e) {
        });

Similar Messages

  • Merge Two Tables with the same columns but different data

    I have a table that has the following columns:
    Current Table Definition
    commonname
    family
    genus
    species
    subspecies
    code
    I have a number of entries that don’t fit the current table definition – that is that they only have a common name or description and a code. These records don’t actually represent a species but are needed for data entry because they represent an object that may be encountered in the study (Bare Ground – which isn’t a species but would need to be recorded if encountered). So I would really like 2 tables:
    Table 1 Miscellaneous
    name
    code
    Table 2 Plant Species
    commonname
    family
    genus
    species
    subspecies
    code
    I would like two tables so I can enforce certain constraints on my species table like requiring that the family, genus, species, subspecies combination is unique. I can’t do this if I have all the “other” records that don’t have a family, genus, species, or subspecies unless I put in a lot of dummy data into the fields to make each record unique. I don’t really want to do this because these miscellaneous records really don’t represent a specific species.
    So – the problem is that while I want this data separate I will need to point a column from another table to the code column in both tables.
    How is this best done? Table? View? Merge?

    Hi,
    Actually you don't have to use scope refs. Sorry but I misunderstood you earlier. Here is a complete example that does exactly what you want. Notice how I added the constraint to the materialized view. Also notice when we try to insert a code in tbl3 that doesn't exist in the view, we get an error. HTH.
    SQL> create table tbl1 (name varchar2(10), code varchar2(3) primary key);
    Table created.
    SQL> create table tbl2 (commonname varchar2(10), code varchar2(3) primary key);
    Table created.
    SQL> insert into tbl1 values ('n1','c1');
    1 row created.
    SQL> insert into tbl1 values ('n2','c2');
    1 row created.
    SQL> insert into tbl1 values ('n3','c3');
    1 row created.
    SQL> insert into tbl2 values ('name1','c1');
    1 row created.
    SQL> insert into tbl2 values ('name2','c2');
    1 row created.
    SQL> insert into tbl2 values ('name3','c3');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> create materialized view view1 as select name, commonname, tbl1.code from tbl1, tbl2 where tbl1.code = tbl2.code;
    Materialized view created.
    SQL> select * from view1;
    NAME COMMONNAME COD
    n1 name1 c1
    n2 name2 c2
    n3 name3 c3
    SQL> create table tbl3 (code varchar2(3), record varchar2(1));
    Table created.
    SQL> alter table view1 add constraint view1pk primary key (code); -- <-Note how I added a constraint to the view
    Table altered.
    SQL> alter table tbl3 add constraint tbl3fk foreign key (code) references view1(code);
    Table altered.
    SQL> insert into tbl3 values ('c1','r');
    1 row created.
    SQL> insert into tbl3 values ('c99','r');
    insert into tbl3 values ('c99','r')
    ERROR at line 1:
    ORA-02291: integrity constraint (RAJS.TBL3FK) violated - parent key not found
    SQL> spool of;
    -Raj Suchak
    [email protected]

  • Join two tables with the same information

    I have a registration database. It references two other tables. I accept registrations from Faculty and from Students, but their information is in two different tables. Both have fname and lname. If they have people_id filled in, I want the fname and lname from the People table. If they have student_id filled in, I want it from the Student table.
    I've never done this sort of IF situation. Here are the tables:
    create table passport_registration (
         passport_registration_id NUMBER Primary Key,
         date_added date,
         student_id NUMBER REFERENCES students(student_id),
         people_id NUMBER REFERENCES people(id),
         passport_listing_id NUMBER REFERENCES passport_listing(passport_listing_id)
    create table PEOPLE (
    id NUMBER Primary Key,
    dateModified date,
    fname VARCHAR2(100),
    lname VARCHAR2(100)
    create table students (
         student_id NUMBER Primary Key,
         date_added date,
         s_uid VARCHAR2(50),
         fname VARCHAR2(50),
         lname VARCHAR2(50)
    Any sort of assistance is appreciated.
    Thank you.
    daniel

    (It'd be helpful if you could edit your post and stick {noformat} before and after your sql statement - that will format it so that the (+){noformat} show correctly instead of being converted to the (+) symbol!)
    As to the questions:
    1. You've got two columns that have a decision to be made on them; you're going to need to write two sets of decision-making code, one for each column. I guess you could also do something like:select a.col1, d.col2, d.col3
    from table1 a, (select 'table2' cola, b.col1, b.col2, b.col3 from table2 b
    union all
    select 'table3' cola, c.col1, c.col2, c.col3 from table3 c) d
    where a.col1 = d.col1
    and nvl2(a.col2, 'table3', 'table2') = d.cola;
    nb, not tested, and I'm up far too late, so could have made an easy mistake!
    2. Yes, {noformat} (+){noformat} is the oracle method of doing outer joins; it could be rewritten into ansi joins if you like; I'm just not that familiar with them to do it myself!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Two tables in the same uix page

    Hi! I work with Jdeveloper and UIX with the framework Jheadstart. I need to save data of two tables at same time; i mean , two tables in the same page which save with the same submitbutton. i have made some tries editing the service file, some templates and of course the page, but sometimes it works and sometimes not, i dont know what's happening and i really need to resolve this problem urgently. i hope someone can help me and i'd thank you a lot.
    Thanks for your atention.

    I'm sorry, but I'm going to need more details before I can help. If you can provide stripped down versions of your UIX page and Java code, perhaps I can be of service. Also, I would like to know which JDeveloper and UIX versions you are using.
    Ryan Pollock
    UIX Team

  • Is it possible to have 2 tables with the same name in an Orable database?

    Hello,
    I'm a complete Oracle newbie so please excuse my question if it's stupid.
    I was trying to create 2 tables with the same name using different tablespaces but it does not seem to work. Like this (second time just change the name of the tablespace):
    CREATE TABLE test_tbl (
      id INTEGER,
      status VARCHAR2(10),
      last_modified DATE DEFAULT SYSDATE
    TABLESPACE tblspc1Is it in general in Oracle possible to acquire this goal?
    Thanks a lot!
    P.S. I have already created the needed tablespaces
    CREATE TABLESPACE tblspc1 DATAFILE 'tblspc1.dbf' SIZE 10MEdited by: 808239 on 02-Mar-2011 02:18

    It is not possible to create two tables with same name in same schema.
    A user can own one schema with his own name and another with the schema name SYS.
    For this you have to grant sysdba privilage to the user and then have to connect using sys password or with the password specified in password file.
    But this still you have to access to the table in sys schema using sys.table_name.
    Hope Answered tthe Question.

  • Two tables on the same page. Is it possible?

    Hi all,
    I followed the multi-slect sample in Winston's blog and everything is working. However, when I tried to put two tables on the same page, the selections are all messed up. When I looked at the code again I realized the line
    RowKey rowKey = (RowKey)getValue("#{currentRow.tableRow}");
    in the setSelected(Object object) method.
    In the case that there are more than one tables on one page, how does the code which table it is refering to? Or how the code should be different so we can have multi tables with selectable rows on the same page? Thnx.

    Thanks. But how do you tie the TableSelectPhaseListeners to their respected tables.
    This is Winston's code for row select (1 table)
    private TableSelectPhaseListener tablePhaseListener = new TableSelectPhaseListener();
    public void setSelected(Object object) {
    RowKey rowKey = (RowKey)getValue("#{currentRow.tableRow}");
    if (rowKey != null) {
    tablePhaseListener.setSelected(rowKey, object);
    public Object getSelected(){
    RowKey rowKey = (RowKey)getValue("#{currentRow.tableRow}");
    return tablePhaseListener.getSelected(rowKey);
    public Object getSelectedValue() {
    RowKey rowKey = (RowKey)getValue("#{currentRow.tableRow}");
    return (rowKey != null) ? rowKey.getRowId() : null;
    public boolean getSelectedState() {
    RowKey rowKey = (RowKey)getValue("#{currentRow.tableRow}");
    return tablePhaseListener.isSelected(rowKey);
    For two tables. Do I just repeat the code like this?
    private TableSelectPhaseListener tablePhaseListener1 = new TableSelectPhaseListener();
    public void setSelected1(Object object) {
    RowKey rowKey = (RowKey)getValue("#{currentRow.tableRow}");
    if (rowKey != null) {
    tablePhaseListener1.setSelected(rowKey, object);
    public Object getSelected1(){
    RowKey rowKey = (RowKey)getValue("#{currentRow.tableRow}");
    return tablePhaseListener1.getSelected(rowKey);
    public Object getSelectedValue1() {
    RowKey rowKey = (RowKey)getValue("#{currentRow.tableRow}");
    return (rowKey != null) ? rowKey.getRowId() : null;
    public boolean getSelectedState1() {
    RowKey rowKey = (RowKey)getValue("#{currentRow.tableRow}");
    return tablePhaseListener1.isSelected(rowKey);
    private TableSelectPhaseListener tablePhaseListener2 = new TableSelectPhaseListener();
    public void setSelected2(Object object) {
    RowKey rowKey = (RowKey)getValue("#{currentRow.tableRow}");
    if (rowKey != null) {
    tablePhaseListener2.setSelected(rowKey, object);
    public Object getSelected()2{
    RowKey rowKey = (RowKey)getValue("#{currentRow.tableRow}");
    return tablePhaseListener2.getSelected(rowKey);
    public Object getSelectedValue2() {
    RowKey rowKey = (RowKey)getValue("#{currentRow.tableRow}");
    return (rowKey != null) ? rowKey.getRowId() : null;
    public boolean getSelectedState2() {
    RowKey rowKey = (RowKey)getValue("#{currentRow.tableRow}");
    return tablePhaseListener2.isSelected(rowKey);
    Edited by: Thomas5 on Jan 18, 2008 5:28 AM

  • How do you stop your phone from creating two albums with the same photos after syncing?

    When I first bought my phone I was able to sync my photos by checking the folder I wanted synced under iTunes. This put all those photos on photo library on my phone. I recently added more photos to that folder and tried to sync them it now put them in the photo library album and also created another album with my folder name. So I have two albums with the same photos. I tried in checking that folder in iTunes and of course they're not in my photo library. Please help. I don't want two albums with the same pics

    This is how Apple has always handled photos.  nothing has changed at all.
    Just as your music is in your library and you can access those exact same songs from a playlist, all of your synced pics are in the Photo Library and those exact same photos (NOT duplicates) can be accessed from the album name that you chose to sync.

  • Can i set up my iPad and iPod to use iMessage between the two devices with the same Apple ID?

    Can i set up my iPad and iPod to use iMessage between the two devices with the same Apple ID? SO i could iMessage if out from my iPod to my iPad at home to be viewed by a family member?

    Look into using Apple Configurator.  It's the easiest way to "reimage" and Manage iPads that I know of right now. 
    http://itunes.apple.com/us/app/apple-configurator/id434433123?mt=12
    Also, look into using the Educational Volume Purchase Program, if you have not already done so. 
    http://www.apple.com/education/volume-purchase-program/

  • How can I set up two iPhones with the same contact, photos, music etc... but a different sim card and phone number. They will both be my phones, but one will be for use in other countries.

    How can I set up two iPhones with the same contact, photos, music etc... but a different sim card and phone number. They will both be my phones, but one will be for use in other countries.

    Phone A = phone with information you want duplicated
    Phone B = phone that you want to copy from A
    Backup Phone A.
    Wipe Phone B using these instructions. What to do before selling or giving away your iPhone, iPad, or iPod touch - Apple Support
    Phone B should be on the 'Hello' screen. Do not swipe it. Launch iTunes. Plug in Phone B.
    When iTunes asks if you want to set up as new phone or restore from backup, choose restore from backup of Phone A.
    After this setup, any changes to one phone (i.e. adding a contact, downloading an app) will have to be manually duplicated on the second phone, if that is your desire). Making changes to one phone will not affect the other after setup.

  • How can I have two fields with the same name if it makes sense?

    Hello, folks :)
    I have a pretty hard time figuring out how I can have two text fields with the same binding name.
    The whole problem is that when I need two fields with the same binding name they are still differnent coz they have the same name but differnt indices.
    I should make a form filled at runtime by merging a pdf form file and an fdf file data file. And I have no choice to do it differently. And my form file needs some data like customerName, companyName twice in one form. But there's only one possible buinding name indexed zero.
    How can I create a field with absolutely the same name or is it just impossible due to possible name conflicts? And is there a workaround to this problem? I just need one piece of data repeated in different places.
    Thanks for your replies :)
    P.S. if u think that the problem is not clear enough let me know. I'll supply you with more details. But the general process can not be changed.
    One pdf should be mergred with an fdf with as the result of their merge a new filled and flattened form. I have no control over fdfs their are generated by Oracle and I can not fill the form using XML files coz this process should be integrated in a working application.

    I just thought about a really ugly workaround with a server-side script adding values to fdf files but it's a bit of work and tests and personally i think it's a bad idea :-(

  • Two persons with the same screen name?

    Am I seeing things, or here we have two persons with the same screen name?
    http://forums.adobe.com/people/Federico_Plat%C3%B3n
    http://forums.adobe.com/people/federico%20platon
    (Yes, I know it's really two identities belonging to the same person, but to my eye both screen names look identical on screen; and I thought the system prevented entering a screen name already in use).

    Jochem van Dieten wrote:
    Claudio González wrote on 4/21/2010 9:53 PM:
    Rick, I must confess that I had never thought of looking for participant's screen names down there. And I still find it curious that the accent is absent at the obvious position of screen names.
    Have you ever considered investigating this sort of thing? Create a new
    Adobe ID, change values for userID, screenname, firstname and lastname
    on the Adobe side and see what changes on the Jive side? The logic may
    turn out to be surprisingly simple.
    No, I haven't and most probably I will not, at least in the foreseeable future. I have enough problems with my own account, and I waste too much time as it is on re-logging in, and on waiting for pages to load and messages to be posted, to indulge in such an investigation. Even if the logic behind two accounts that on screen seem to be associated with exactly the same screen name turns out to be exceedingly simple.

  • Sharing two folders with the same name

    Hi all.
    I have two folders with the same name and I would like to be able to share these under different share names. Problem is, this doesn't seem to be possible.
    For instance, try doing this in File Sharing under Server Preferences:
    * Click +, add /Data/Media
    * Edit permissions on "Media" to permit guest access
    * Click +, add /Volumes/Drobo/Media
    * Edit permissions on "Media" (make sure you click the right one!) to permit guess access.
    This appears on the surface to work, but what it has actually done is to delete the share for /Data/Media. If you exit the File Sharing pane and go back into it again, it will be gone.
    Server Admin has the ability to rename a share's name from AFP,SMB,FTP,etc. but this doesn't appear to help either -- I tried adding the second media first, renaming its shared name to Media2 over in Server Admin, and then adding the first. Server Preferences just deletes the second one.
    Such a basic thing as being able to rename the share from Server Preferences would appear to be enough to get around this, but since Apple didn't make it possible, I have no idea how to proceed.
    Does anyone else have this working, and how did you do it?

    The best way to solve this, would be make sure you use database paraneter GLOBAL_NAME, to change your database from lets say orcl1 to orcl1.mycorpdomain.com, by this you can make sure each database actualy has a different name. Your other database then could be named orcl1.example.com.
    When chaning the display name in EM you might face other issues later on when for instance trying to run a restore using EM for one of these databases.
    Regards
    Rob
    http://oemgc.wordpress.com

  • How to use the TableSorter for two tables at the same view?

    Hello,
    I am using the TableSorter object in order to sort Dynpro tables.
    Suppose I have two tables at the same view, is it possible to use it seperatly for both of them?
    I assume that at the wdModifyView method I will need to catch the table that the user clicked on, yet I don't have an idea of how to do it...

    Hi Roy,
    Constructor of TableSorter
    public TableSorter(IWDTable table, IWDAction sortAction, Comparator[] comparators)
    So, you have to create instance of TableSorter class for each table on the view.
    best regards, Maksim Rashchynski.

  • Can I have two LANs with the same IP route to each other

    Hi there,
    I have a customer who has a televantage voip network on a private 192.68.0.0/24 network but has two sites connected via a wireless tower that wants to enable QOS over between the two sites by using a 2621XM router at each end. I've enabled QOS on both routers for voice and video but haven't deployed this yet since I'm not sure if I need to change one of the sites networks to a different network number since I'll have the routes in place with a 192.168.1.0 on the WAN side. If both remote networks stay with the same number scheme of 192.168.0.0/24 will they be able to find each other when requesting where a remote 192.168.0.0 host is or do I need to change of the offices networks to a 192.168.2.0 network to make this work? Sounds kind of basic but before deploying I wanted to get some input...thanks.

    Routers cannot route unless the address blocks for each interface are different.
    If you have two sites connected by any kind of link, and you'll use one site as a gateay to the Internet, then you'll need at least four different addresses/ blocks:
    The 'b' site LAN, i.e., fa/0/0:192.168.0.0/24
    The 'b' site WAN (interconnecting link), i.e., fa0/1: 192.168.1.1/30
    The 'a' site WAN (interconnecting link), i.e., fa0/1:192.168.1.2/30
    The 'a' side LAN, i.e., fa0/0:192.168.2.0/24
    (assumes that your wireless link is acting as a bridge or non-routing link) - the fa0/1 device connects to the wireless devices).
    If you use the same router on the 'a' side for the interconnecting link for both the 'a' LAN and the Internet gateway, then the third interface would be your Internet WAN address.
    The 'b' side LAN interface is your 'b' side default gateway for you clients
    The 'a' side LAN interface is the 'a' side default gateway for your clients
    Set a default gateway on the 'a' router to the ISPs Default gateway / next hop address.
    If you're using a third router for an Internet gateway, then the LAN interface address becomes the default gateway for the clients on that LAN, and you'll need to set up a static route pointing to the other LAN in the routers that connect the two LANs..
    A routing protocol may be useful but, depending on your actual bandwidth available, it's probably better to just set up static routes (no routing protocol bandwidth utilization).
    The /30 for the WAN link gives some economy of address usage, but it may also secure the link better, since there are no additional addresses for the intruder to use; they'd have to spoof one of the two valid addresses (.1 & .2) as well as crack your encryption (and / or other security).
    There's an armload of other possible configurations / topologies / address schemes, I believe this one would be reasonably common.
    The bottom line is that a router can only route from one address block to another. In order to pass traffic between two segments with the same address block, you need a bridge / switch, or some other layer one/two device (like a wireless transceiver pair).
    Good Luck
    Scott

  • Can two ipods with the same email address face time independantly?

    Can two ipods with the same email address face time independantly?

    Hey Bumblebee, To each other, no-- would be like trying to call yourself on the same phone. To different persons on other devices??? Not sure you'll have to try, I'm guessing if both are online you may well dial up on both, (once had the same address on the my computer and iPod, both would ring when called, this stopped when I changed the iPod's address). If you change one of the iPod's e-mail address you should be fine. You'll have to do a little experimenting. Hope this helps, Good luck. Cheers.

Maybe you are looking for