How to identify the current displaying card in CardLayout

hi all,
i have a CardLayout() containing some "cards" that are JPanels...i know i could "flip through" the "cards" by using those previous(), next(), etc...but how do i get the "name" of the card the is currently showing...
i guess i need a function that is the reverse of show(Container parent, String name)...this show() gets the parent and the "name" of the card as parameters and show the card out...what i want to do is...to get the "name" of the card that is currently shown...
any ideas?
thank you very much!

This is just a shot in the dark, but you could write a method that goes through the JPanels that are in the CardLayout calling the JPanel.isShowing() method. This may tell you whether or not the JPanel is visible. You could then link it back to the name with a corresponding string array.
Just a thought.
Good luck!
Cardwell

Similar Messages

  • How to identify the current display configuration from registry?

    I wanted to read the current configuration of display from registry. Suppose, a dual output system is configured with "Extended these displays" settings then i want to know where in registry this information will be stored?
    I tried to get the info from 
    1. HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\VIDEO which gives only the display devices being registered in the system.
    2. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video which has multiple guid tags and then multiple subkeys.
    3. HKEY_CURRENT_CONFIG\System\CurrentControlSet\Control\VIDEO which has multiple subkeys.
    Unable to get the right registry for this case. when multiple displays connected, then i want to know whether it is configured as extended/duplicate. 
    Please guide me if it is possible.

    There is no direct way for getting the monitor count. we need to code for each graphic card separately. 
    i found a way like below, for those of you interested in getting the exact monitor count:
    int ComputerInfo::GetRegistryValue( CSString regPath, CSString valueName, int cntIndex )
    int monCount = 0;
    BYTE pBuffer[1024];
    DWORD nMaxLength;
    CSString szSubKey = regPath;
    szSubKey = szSubKey.substr(18);
    CSString szValueName = valueName;
    DWORD rc;
    DWORD dwType;
    HKEY hOpenedKey;
    LOG_INFO ( "Registry key " << szSubKey << "\\" << szValueName );
    if( ERROR_SUCCESS == RegOpenKeyEx (
    HKEY_LOCAL_MACHINE, // handle of open key
    szSubKey, // address of name of subkey to open
    0, // reserved
    KEY_READ, // security access mask
    &hOpenedKey // address of handle of open key
    rc = RegQueryValueEx(
    hOpenedKey,
    (const char*)szValueName,
    0,
    &dwType,
    (LPBYTE)pBuffer,
    &nMaxLength );
    if( rc != ERROR_SUCCESS )
    LOG_INFO ( "Registry key " << valueName << " not found." );
    monCount = 0;
    else
    LOG_INFO ( "Monitor Count: " << CSString(pBuffer[cntIndex]) );
    monCount = pBuffer[cntIndex];
    RegCloseKey( hOpenedKey );
    else
    monCount = 0;
    return monCount;
    int ComputerInfo::GetMonitorCount()
    int fResult;
    fResult = GetSystemMetrics(SM_CMONITORS);
    LOG_INFO( "Video Output Count from System: " << fResult );
    if ( fResult == 1 )
    // I need to get the address of a few multi-monitor functions
    HMODULE user32 = GetModuleHandle ("User32.DLL");
    typedef BOOL WINAPI tEnumDisplayDevices (void*, DWORD, DISPLAY_DEVICE*, DWORD);
    tEnumDisplayDevices* fEnumDisplayDevices = (tEnumDisplayDevices*) GetProcAddress (user32, "EnumDisplayDevicesA");
    if (fEnumDisplayDevices == NULL) return false;
    // count the number of monitors attached to the system
    DISPLAY_DEVICE dd; dd.cb = sizeof(dd);
    for (DWORD dev=0; fEnumDisplayDevices (NULL, dev, &dd, 0); ++dev)
    LOG_INFO ("Device: " << dd.cb << ", " << dd.DeviceID << ", " << dd.DeviceKey << ", " << dd.DeviceName << ", " << dd.DeviceString << ", " << dd.StateFlags );
    CSString devName = dd.DeviceName;
    DISPLAY_DEVICE dd1; dd1.cb = sizeof(dd1);
    // after second call DispDev.DeviceString contains monitor's name
    EnumDisplayDevices(devName, 0, &dd1, 0);
    LOG_INFO ("Device: " << dd1.cb << ", " << dd1.DeviceID << ", " << dd1.DeviceKey << ", " << dd1.DeviceName << ", " << dd1.DeviceString << ", " << dd1.StateFlags );
    if (dd.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER)
    LOG_INFO ("Device: " << dd.DeviceName << " is a mirroring driver device. " );
    continue;
    if (dd.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)
    LOG_INFO ("Device: " << dd.DeviceName << " is attached to the desktop. " );
    if ( StringUtils::StartsWith( dd.DeviceString, "Matrox", false ) )
    return GetRegistryValue(dd.DeviceKey, "ContextItem.Config", 40);
    else if ( StringUtils::StartsWith( dd.DeviceString, "NVIDIA", false ) )
    if ( !StringUtils::StartsWith( dd.DeviceString, "NVIDIA ION", false ) )
    return GetRegistryValue(dd.DeviceKey, "NV_TargetData", 0);
    else
    return GetSystemMetrics(SM_CMONITORS);
    else if ( StringUtils::StartsWith( dd.DeviceString, "Intel", false ) )
    return GetRegistryValue(dd.DeviceKey, "CurrentState", 0);
    else
    return GetSystemMetrics(SM_CMONITORS);
    else
    LOG_INFO ("Device: " << dd.DeviceName << " is not attached. " );
    LOG_INFO ( "No Devices found." );
    return 0;
    else
    LOG_INFO( "Considered Video Output Count from System. " << fResult );
    return fResult;

  • How to identify the current lead selection is child or parent in rec node

    Hi
    I am using a recursive node to populate a table with TreeByNestingTableColumn as master column. Now my problem is how do I identify if the current selected row in the table is a child or parent? When I get the lead selection value, I find that its the same for the parent and the child. I am setting the isLeaf and hasChildren boolean properties appropriately as false and true for parent and true and false for child. But since the lead selection is returning the same the below rsTableElement always gives me the parent, I always get those parameter values as that of parent. I am writing this inside the onleadSelect event of the table.
    IRsTableElement rsTableElement = (IRsTableElement) wdContext.nodeRsTable().getElementAt(wdContext.nodeRsTable().getLeadSelection());
    In this scenario how do I know if the current selection is made on a child?
    Appreciate for all help and any code snippets.
    Thanks,
    KN.

    Hi KN,
    I guess you want to check if the node that you selected is parent or child.. This can be achieved by using getTreeSelection() method of IWDNode.
    If you write following code in your lead selection action, you can determine the if it is a parent or child node.
    wdComponentAPI.getMessageManager().reportSuccess(wdContext.nodeRsTable().getTreeSelection() +"");
    the output will be something like
    <ViewName>.RsTable.0.ChildRsTable.1.ChildRsTable.0.. depending upon which node you have selected.
    That way you can find out if it is a parent or child node.
    Abhinav

  • How to Identify the current step in execution

    Hi,
    My merge query takes a long time to run. I monitored the session and it was doing a full table scan and it registered as a long-operation. Now thats finished and it goes off to do whatever else it needs to do.
    How do I know whats its executing at any given point in time? I want to know what it scans / writes next and what object its scanning. In other words, I want to know which step of the execution plan is it currently executing.
    Is there a way of identifying this? Any V$ views which provide this information?
    Thanks in advance,
    K

    Will tracing the session tell me where it is
    currently?Tracing the session generates a file on disk with all the various waits in it. Generally, you would analyze that trace file at the end of the process to see where the time was spent. In theory, I suppose that it may be possible to watch that trace file and deduce what step the query was on. It's far from obvious to me, though, that this would be particularly practical-- the trace file grows pretty quickly and isn't particularly trivial to read, particularly in real time.
    Justin

  • How to get the current page URL

    HI All
    I am working in oracle apps 4.0
    I have one page called history in that i have one page item called Application url. My application id is 122 but its a copy of application 106
    How to get the current page url for the page item.
    Any steps should be help ful
    Thanks & Regards
    Srikkanth.M

    I'm not 100% clear on what the requirement is from the description, however it does sound like you are making things unnecessarily complicated.
    If you want permanent/ID-independent links then use application and page aliases.
    so here we used to display the url like this: <tt>{noformat}http://81.131.254.171:8080/apex/f?p=122{noformat}</tt>
    Do you mean that the URL is displayed like that? If so that doesn't seem particularly helpful. How is anyone supposed to know what it is?
    There are many ways to provide links in APEX&mdash;including lists and nav bars.
    Where the link is to another resource located on the same server (such as another page in the same app, or a different app in the workspace), relative addressing can be used, making it unecessary to include scheme, domain and port information in the URL. For example, if the page to be linked to has a page alias <tt>ABOUT</tt> in an application with alias <tt>UNITY</tt>, and the apps share an authentication scheme/cookie to permit shared sessions, then the link URL is simply
    f?p=UNITY:ABOUT:&APP_SESSION.

  • How to get the Current User on the UI page?

    All,
    Could you please let me know how to get the Current user on the UI input page , i need to display the current user ID when some one clicks the submit button, i want o get the current user to display in the javascript alert box.
    Edited by: 951930 on Oct 24, 2012 12:21 PM

    lucky,
    my schema has already defined for
    <user mapField="USER_ID" default="%CurrentUser"/>
    and in my UI page
    <td oraLabel="user"></td><td oraField="user" id="userId" ></td>
    and my javascript
    function showUserId () {                        
    var curUser = document.getElementById('userId').value;
    alert(curUser);
    and i have called this function on my submit button, but i am not able to get Current Logged User ID value to show in the alert nor able to show the current logged user on the UI page.
    my requirement is on custom UI page i need to show Current Logged User in one corner of the page and also need to show the same user in alert when he submits the button.
    Appreciate for the help.
    Edited by: 951930 on Oct 25, 2012 8:42 AM
    Edited by: 951930 on Oct 25, 2012 9:06 AM

  • How to get the current month number

    Hi everyone,
    Does anybody know how to get the current month number in Oracle Discoverer Worksheet calculation?
    I try to use EUL_DATE_TRUNC(CURRENT_DATE, 'MM'), but instead I got 01-AUG-00.
    If I change the data display format to MM, it will give me "08" but if I use TO_NUMBER function to convert it to number I get error "invalid number"
    Is there anyway to get the current month value in number? Thanks

    Scott,
    Thank you so much! It works perfectly! :)
    Hope you have a great day ahead!
    Cheers,
    Angeline

  • How to get the current logged in username from windows and put it into an AS var

    Hello,
    I was hopeing someone would know how to get the current logged in username from windows and put it into a var, so I can create a dynamic text box to display it.
    Thanks in advance
    Michael

    Just for everyone’s info, this is the script I have used to get the logged in windows username into flash ---- not and air app.
    In the html page that publishes with the .swf file under the <head> section:-
    <script language="JavaScript" type="text/javascript">
    function findUserName() {
         var wshell=new ActiveXObject ("wscript.shell");
         var username=wshell.ExpandEnvironmentStrings("%username%");
         return username;
    </script>
    The ActionScript:-
    import flash.external.ExternalInterface;
    var username:String = ExternalInterface.call ("findUserName");
    trace (username); // a quick test to see it in output

  • Q: How to retrieve the current URL with PL/SQL

    I've got a pair of dynamic page portlets on a page. The first is simply an input text box and a submit button, the second is an inventory 'report' based on what is entered in the text box. When a value is entered and the button pressed, there is javascript behind the button that takes the current URL, adds '&ITEM=XXXXXXXX' (removing it first if this is not the first invocation of the page), and redirects to the new page.
    The second portlet uses the &ITEM parm to list a bill of materials for the item. If one of the items possesses a sub-assembly, I want to display the item# in an <a href= manner to make it so the user can simply click on the link to see the BOM of the subassembly.
    To do this, I believe I need to capture the current url and modify it as required to pass the new &ITEM value. I'm having a lot of trouble trying to figure out how to get the current page url. Any help would be greatly appreciated!
    Geoff

    Hello
    I have a similar problem I have developed a pl/sql portlet and put it into a page, this portlets display a dynamic page. This dynamic page have a search functionality, what I am trying to do is that when I click the search button on the dynamic page it recall the whole page and pass the paremeter that the user wrote on the search box, then the portlet that contains the dynamic page recieve the parameter and recall the dynamic page with the parameter that was received. The problem that I have is that the portlet receive the parameter but when I pass the parameter to the dynamic page it doesn't get it. This is the way the I am calling the dynamic page inside my portlet into the show procedure:
    EXECUTE IMMEDIATE
    'begin
    APP_NAME.PG_DYN_DIR_ALFABETICO.show (
    p_arg_names => PORTAL30.wwv_standard_util.string_to_table2(''url_page'',''search_param''),
    p_arg_values => PORTAL30.wwv_standard_util.string_to_table2(:1,:2));
    end;'
    using url_pg,p_text1;
    The dynamic page receive the first parameter(url_page) but not the second one(p_text1), I have checked that the p_text1 has a value on my portlet before I send it to the dynamic page so I really don't understand why my dynamic page doesn't work.
    Please HELP ME. I am desperate
    Ana Lasprilla

  • Using PHP to identify the current page - by David Powers

    Hi There,
    I'm trying to write a script so I can identify the sub-pages under "Gallery" in my website
    Under Gallery I have more than hundred pages describing the photos but I want to identify them as the "Gallery" page.
    How do I achieve that?
    It would be tedious to write the "PHP if" statement for each photo link.
    I trust there is a simpler solution.
    In PHP solutions by David Powers, Ch.4 "Using PHP to identify the current page"
    The script is:
    <?php $currentPage = basename($_SERVER['SCRIPT_NAME']); ?>
    <ul id="nav">
      <li><a href="index.php" <?php if ($currentPage == 'index02.php') {echo 'id="here"';} ?>>Home</a></li>
      <li><a href="journal.php" <?php if ($currentPage == 'journal.php') {echo 'id="here"';} ?>>Journal</a></li>
      <li><a href="gallery.php" <?php if ($currentPage == 'gallery.php') {echo 'id="here"';} ?>>Gallery</a></li>
      <li><a href="contact.php" <?php if ($currentPage == 'contact.php') {echo 'id="here"';} ?>>Contact</a></li>
    </ul>
    Let's say that the gallery pages contains hundreds of links gallery like gallery/photos1.php, gallery/photos2.php, gallery/photos3.php, gallery/photos4.php, gallery/photos5.php, gallery/photos6.php, gallery/photos7.php etc...
    How would I identify the sub-pages so when we are there Gallery is highlighted?
    Thank you!
    Best,

    Hello Siddhardha,
    To get the details of a process you need to use Locator class from BPEL api. You can locate your process by listInstances method which accepts WhereCondition parameter used to build a query on process instances. Once you've found the process you were looking for you can use getAuditTrail method to retrieve audit trail of a given instance. You can also use setStatus() method from a BPELX java exec tag within your process and later retrieve it from instance handle by getStatus method.
    A sample snippet to retrieve instance handles to all child processes of a given process:
    StringBuffer sb = new StringBuffer();
    Locator locator = new Locator(domain,domainpassword);
    WhereCondition wc = new WhereCondition();
    String query = sb.append(SQLDefs.AL_ci_root_id).append(" = ? ").toString();
    wc.append(query);
    wc.setLong(1,parentInstance);
    IInstanceHandle[] ih = locator.listInstances(wc);
    You can read more about querying processes on http://blogs.oracle.com/matt/2006/06/27?print-friendly=true
    Radoslaw

  • Don't know how to calcualte the current page in smartform for second layout

    Hi All ,
       Iam creating an smart form which contains two layout in a single form. I need the page number to be displayed as followes.
    1st layout : 1 of 2
                     2 of 2.
    in 2nd layout 1 of 2.
                        2 0f 2.
    I dont have any issues in printing total number of pages. i dont know how to calculate the current page for the 2nd layout. <<text removed>>
    Edited by: Matt on Jun 25, 2009 5:09 PM - Removed ALL CAPITALS from subject

    Hi,
    Create a New window of Type 'Final Window' and Position it in the layout where u want to display the page numbers.
    Now, create a text element in the window and create the text like below in the text element.
    P1 Page &SFSY-PAGE& of  &SFSY-FORMPAGES(3CZ)&
    &SFSY-PAGE&                            - Current Page No.
    &SFSY-FORMPAGES(3CZ)&         - Total No of Pages.
    Note: dont forget to create the window type as 'Final Window', otherwise it will show ssome junk...
    Hope it helps!!
    Rgds,
    Pavan

  • How to identify the bind variable peeking problem?

    How to identify the bind variable peeking problem whether my db hitting or not and how to resolve it?
    currently we are doing the dbms_stat of application schema's with gather auto option and i hope this option we take the histogram stats also. Is there any option to improve it and its highly transactions oltp env of 11g.

    What is your exact 4 digits Oracle version ?
    Bind peeking issues are supposed to be solved with adaptative cursor sharing in 11.1 and 11.2:
    11.1 http://download.oracle.com/docs/cd/B28359_01/server.111/b28274/optimops.htm#sthref919.
    11.2 http://download.oracle.com/docs/cd/E11882_01/server.112/e16638/optimops.htm#PFGRF94588
    which says also:
    >
    Adaptive cursor sharing is enabled for the database by default and cannot be disabled. Note that adaptive cursor sharing does not apply to SQL statements containing more than 14 bind variables.
    >
    Edited by: P. Forstmann on 10 nov. 2011 13:50

  • How to identify the the cellphone compagny (Fido, AT

    How to identify the cellphone compagny (At&t, telus, rogers ...) of an iphone 4 without a sim card?

    Call Apple Support and give them the serial number of the phone.

  • How to identify the iphone compagny (Fido, Telus, AT

    How to identify the iphone 4 compagny (fido, telus, rogers, AT&T ....) without sim card inside

    Call AppleCare and give them the model and serial number.

  • How to get the current path of my application in java ?

    how to get the current path of my application in java ?
    thanks

    To get the path where your application has been installed you have to do the following:
    have a class called "what_ever" in the folder.
    then you do a litte:
    String path=
    what_ever.class.getRessource("what_ever.class").toString()
    That get you a string like:
    file:/C:/Program Files/Cool_program/what_ever.class
    Then you process the result a little to remove anything you don't want:
    path=path.substring(path.indexOf('/')+1),path.lastIndexOf('/'))
    //Might be a little error here but you should find out //quickly if it's the case
    And here you go, you have a nice
    C:/Program Files/Cool_program
    which is the path to your application.
    Hooray

Maybe you are looking for

  • Using my 30 inch Cinema display to watch my Comcast Cable?

    Just a thought, my monitor is much larger than my tv. Is there such a way to hook my cinema display into my comcast cable/dvr box? Thanks, Christine

  • How to add the cookie to the response/redirect?

    Hi, Can someone provide detail on how to add the cookie to the response/redirect? The current object I have is the UserSession object and the Session Token (string). Thx.

  • Convert Sub-Report to Crystal Command

    I'm attempting to convert a sub-report and a shared variable from the report to a Command. Can someone help with the conversion Here is the part of the Crystal SQL I can't convert This is within last7days >>>  (ORDER_PROC.ORDER_INST>={ts '2014-06-18

  • Enterprise Services Bundles in PI

    Hi ALL, need help in how to use Enterprise Services Bundles in PI. if someone worked on this pls give me some idea about this and methods to use this .. if there is any best practice in using this Enterprise Services Bundles ..and i find in some docu

  • Please Help Upgrade Path

    Hello, We are currently on Crystal Enterprise 10 and I need to decide what version I need to upgrade too. Please help - Do I want Enterprise XI 3.1 or Crystal 2008? Thanks Norm