Order of elements in Hashtable

My code:
Hashtable tabCtrl = new Hashtable();
tabCtrl.put("jTextField01", jTextField01);
tabCtrl.put("jTextField02", jTextField02);
tabCtrl.put("jTextField03", jTextField03);
tabCtrl.put("jTextField04", jTextField04);
tabCtrl.put("jTextField05", jTextField05);
tabCtrl.put("06", jTextField05);
tabCtrl.put("07", jTextField05);
tabCtrl.put("08", jTextField05);
tabCtrl.put("09", jTextField05);
tabCtrl.put("10", jTextField05);
tabCtrl.put("11", jTextField05);
Enumeration ex = tabCtrl.keys();
while (ex.hasMoreElements()) {
String alias = (String)ex.nextElement();
System.out.println(alias);
Output:
jTextField05
jTextField04
jTextField03
jTextField02
jTextField01
11
09
10
08
07
06
Why not so:
11
09
10
08
07
06
jTextField05
jTextField04
jTextField03
jTextField02
jTextField01

Hi,
I tried a TreeMap to keep ordering of my elements but it doesn't work. Why ?
import java.util.*;
class Mapping {
  public static void main(String[] args) {
    TreeMap map = new TreeMap();
    map.put("Type of realm used", "0");
    map.put("Name of the file used", "1");
    map.put("The database's driver", "2");
    map.put("The database's URL", "3");
    map.put("The database's user", "4");          
    System.out.println("\nmap0>"+ map +"\n");
}Here's the output :
map0>{Name of the file used=1, The database's URL=3, The database's driver=2, The database's user=4, Type of realm used=0}
Anyone knows how to do ?
I'm using JDK1.3.x, so I can't use the class LinkedHashMap from JDK1.4.
Thank you for your help.
Yann P.

Similar Messages

  • Travel Expenses settlements against Service Order/WBS Element/Project Ord

    Hi Experts,
    I have one req. in Travel Expenses, i.e. need to settle travel expneses against Service Order/WBS Element/Project Order.
    Can you guide me how to do this req.
    Thanks & Regards
    Rajesh

    Hye mate,
    This is possible for sure what you need to do is to go at travel request . In travel Request there is an option of Enhanced Travel cost/ Alternative master cost center. if you click on it . you would find an option of cost assignmnet click on it
    there you would have option , like an excel sheet like fields of  the cost centre, wbs element, profit center, order number what eve is requred and save it.
    now the cot of trip would go that particulat cost center or der numbe or WBS rather then the cost center assigned at master data in ifototype 0027.
    Regards
    Waqas Anwar

  • How can i change the order of  elements in a JList ?

    Hi,
    i would like to know if it is possible to change the order of elements in a JList ? Maybe i could use drag and drop to do this ?
    Thanks for answering.

    The simplest way is probably to implement ur own listmodel and then supply the listitems in the order u want. Example:
    class MyListModel
              extends AbstractListModel
              implements ContactListListener {
    public int getSize() {
    return listitemcount;
    public Object getElementAt(int index) {
    //here u return the item for the index at the list
    //if u for example have an array of strings
    //which u wanna have listed in reversed order (reversed to
    //the order in the array, u could do
         return myarray[getSize()-index];
    }

  • How to export an album and keep images in the same order in elements 11 mac

    I made an album of my trip to Australia (lots of pictures) and changed the order of the images (not the same as shooting order) and when I export the images in the album to a folder or memorystick, the images are copied to that place but I lost the album order of the images.
    How can I prevent that, without having to renumber al 500 images separatly?
    Gr Jos

    Thanks for the tip, Michel
    It worked like a charm…
    cheers Jos
    Op 28 okt. 2013, om 18:49 heeft MichelBParis <[email protected]> het volgende geschreven:
    Re: How to export an album and keep images in the same order in elements 11 mac
    created by MichelBParis in Photoshop Elements - View the full discussion
    JosU a écrit:
    I made an album of my trip to Australia (lots of pictures) and changed the order of the images (not the same as shooting order) and when I export the images in the album to a folder or memorystick, the images are copied to that place but I lost the album order of the images.
    How can I prevent that, without having to renumber al 500 images separatly?
    Gr Jos
    The order in album is only kept in the organizer database, so the only way not to lose that order is to rename files.
    If you are using the 'export' function, select your album in custom order, select all photos and in the dialog, choose to rename with a common base name.
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5794538#5794538
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5794538#5794538
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5794538#5794538. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Photoshop Elements at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Reverse the order of elements in an array

    how would i go about Reverse the order of elements in an array??

    I link to the javadocs can't be too bad. [url
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Coll
    >
    ections.html#reverse(java.util.List)]Collections.rever
    se(List)Of course I fortell the next question, but I wantan
    Array not a List? So I provide the next link:[url
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Arr
    ys.html#asList(T...)]Arrays.asList(T...)Yeah but then you have to worry about the next
    question which is more of a statement: "I can't use
    Arrays".
    Then I would as them: How would you do it in real life? Of course they could think a real world way of doing it. In that case, I'll give them an real life example.
    Assumed List
    1 2 3 4 5 6 7 8 9 10 11 12 13
    Switch the first and the last elements
    13 2 3 4 5 6 7 8 9 10 11 12 1
    Then the second and second to the last
    13 12 3 4 5 6 7 8 9 10 11 2 1
    And repeat until your half way.
    13 12 10 4 5 6 7 8 9 3 2 1
    13 12 10 9 5 6 7 8 4 3 2 1
    13 12 10 9 8 6 7 5 4 3 2 1
    13 12 10 9 8 7 6 5 4 3 2 1
    Done.

  • Will the order of elements stored in pl.sql table retains

    Hello Friends,
    I am having a record type and the for each element of record , i am having corresponding pl.sql table type .
    If i am storing the values into the records from a query and also the individual elements in the pl.sql table type will the order of data is stored as it is . ..
    example...
    in a record type the data is stored as ( name1 , age1 , salary1) , (name2, age2, salary2)
    if i store in corresponding pl sql table type name1 , name2
    age1, age2
    salary1, salary2
    can i relate the index of record type with that of pl/sql table type ..
    pls advice
    thanks/kumar

    Kumar,
    Yes, the order of elements will be the same.
    Any specific reason why you would want to create a collection for each individual attribute of the record ?
    You can as well declare another variable of the same record and initialize it.
    A few other suggestions for your code :
    1) The 2nd FOR loop can be modified to accommodate the query of the first cursor there-by eliminating one extra iteration.
    SELECT MINC.FAMID,
                         MINC.MEMBNO,
                         MEMB.AGE,
                         SALARYX,
                         SALARYBX,
                         NONFARMX,
                         NONFRMBX,
                         FARMINCX,
                         FRMINCBX,
                         CU_CODE
                    FROM MINC, MEMB, FMLY
                   WHERE MINC.FAMID = MEMB.FAMID
                     AND MINC.MEMBNO = MEMB.MEMBNO
                     AND MINC.FAMID = FMLY.FAMID
                     AND MEMB.FAMID = FMLY.FAMID
                   ORDER BY MINC.FAMID2) The collections can be alternately initialized as follows :
       v_member_rec(v_member_rec.last).FAMID := j.FAMID;
       max_earnings_tab(max_earnings_tab.last) := v_max_earnings;The tried the below example for confirmation ...
    declare
    type emp_rec is record
    (name emp.ename%TYPE,
      dept emp.edept%TYPE,
      sal  emp.esal%TYPE
    TYPE emp_rec_tab is table of emp_rec;
    ert emp_rec_tab := emp_rec_tab();
    TYPE ename_tab is table of varchar2(20);
    ent  ename_tab := ename_tab();
    TYPE edept_tab is table of number;
    edt  edept_tab := edept_tab();
    begin
    for i in (select * from emp)
    loop
         ert.extend;
         ent.extend;
         edt.extend;
         ert(ert.last).name := i.ename;
         ert(ert.last).dept := i.edept;
         ert(ert.last).sal := i.esal;
         ent(ent.last) := i.ename;
         edt(edt.last) := i.edept;
    end loop;
    for i in 1..ert.count
    loop
         dbms_output.put_line(ert(i).name||','||ent(i));
         dbms_output.put_line(ert(i).dept||','||edt(i));
         dbms_output.put_line('');
    end loop;
    end;

  • Have ordered Photoshop Elements 12 and Premiere Elements 12 (for MAC, EN version). Order went through but finally order was cancelled as Adobe Store was unable to approve. Subsequently order was cancelled. did anybody experience the same issue and how to

    Have ordered Photoshop Elements 12 and Premiere Elements 12 (for MAC, EN version). Order went through but finally order was cancelled as Adobe Store was unable to approve. Subsequently order was cancelled. did anybody experience the same issue and how to proceed.

    Hi there
    Please check with your credit card issuer to see why payment is not being approved.  When this is resolved you should be able to place a new order.
    Thanks
    Bev

  • I uploaded the upgrade to Photoshop Elements 12 today.  I got a "dispatching error" for Photoshop Elements, but was able to download Premier elements!  I did not order Premier Elements, so I'm confused (unless this was a package that I did not know about)

    I uploaded the upgrade to Photoshop Elements 12 today.  I got a "dispatching error" for Photoshop Elements, but was able to download Premier elements!  I did not order Premier Elements, so I'm confused (unless this was a package that I did not know about).  I really want the Photoshop Elements upgrade - not Premier Elements.  I do hope I did not pay for both - I only want one.  Help!

    Maryrhire910 I am sorry that you are facing difficulty downloading and installing Photoshop Elements 12.  Are you downloading the installation files from Download Photoshop Elements products | 13, 12, 11, 10?  If so what specific error are you receiving?

  • How to sort elements in Hashtable.

    I am adding elements in sorted order in Hashtable. But when I iterate through the Hashtable using 'Enumeration' on the keys the the elements are not fetched in sorted order. I want to retrieve the keys in sorted order. How can we fetch the keys on sorted order?
    import java.util.* ;
    public class temp
         public static void main(String [] abc)
              Hashtable hashList = new Hashtable();
              hashList.put("1","One");
              hashList.put("2","Two");
              hashList.put("33","Three");
              hashList.put("44","Four");
         Enumeration keys = hashList.keys();
         while(keys.hasMoreElements() )
                        System.out.println("Key: " + keys.nextElement());
    Output for this is -
    Key: 2
    Key: 1
    Key: 33
    Key: 44

    obtain a set view of the keys contained in this Hashtable and sort it.

  • Last element in hashtable?

    Is there a way to get the last filled element in a hashtable?

    What do you mean with the last one ? The last one added, the one with the highest key (whatever highest mean) )
    I do not know how Java implements it's hashmaps, but usually the index is computed from the key, so that the table has empty gaps between filled entries. and the last filled entry is not necesserally the highest by by any sort order nor the last one added. Also any element might not really be an element, but a list of elements that have the same index.
    You can get all the keys in form of a set. You can use the set to find out the last of this set or perform any algorithm on it to determine what the last key is.
    Regards
    SH

  • Sale order - Wbs element Report

    Hi
    Is there any report for sale order wise wbs element report.
    In my sale order i will give wbs element and now i want to check "for one sale order , what are the wbs elements"

    You can check the WBS for a sales order from the table view of VBAP.
    The WBS field is PS_PSP_PNR.
    Goto SE16 and give VBAP.
    Enter your sales order number and execute. Look for your WBS elements in foeld PS_PSP_PNR for the different line items.
    You can also create a quick SAP query on this.

  • Get hierarchy of internal order / WBS element

    dear all ABAP guru,
    i have a problem to view hierarchy of internal table or WBS element,
    anyone know function module or table to view hierarchy of internal order / WBS
    many thx,

    You can also use BAPI_PROJECT_MAINTAIN for Project/WBS for internal order  following function module can help BAPI_INTERNALORDER_GETDETAIL
    BAPI_INTERNALORDER_GETLIST.
    Nabheet

  • Creation of sales order/wbs element

    Hi SAP gurus,
    While creating a sales order after entering the WBS element, I am getting an error
    Profit Ctr not consistent between Plant and Material/WBS for line item 0010
    can somebody throw light and help to solve.
    regards
    Pranav shah

    Hi ,
    check the plant for your material and in your project. both should be same.
    cheers,
    sumith

  • Settlement of order -WBS Element

    Dear Experts,
    Can any one tell me what is meant by WBS element and in what scenario,PM orders settlement rule created with category as WBS.If possible tell me with any practical example.
    regards
    KRISHNAN

    Dear,
    Dear,
    Budget: Amount of resources allocated under a particular head in a financial year.
    Budget Control: Having/ creating a control on the resources allocated in a financial year.
    Original Budget: The initial budget that you have allocated to a WBS element.
    Supplement of Budget: One time/ discrete increment in the original budget.
    Return of Budget: Taking out the unutilized portion of the budget.
    Transfer of Budget: Transferring the budget among two or more expense heads.
    Project Definition: A framework for a business undertaking with a fixed goal to achieve with given resources.
    The project definition contains dates and organizational information that are binding for the entire project.
    WBS Element: Individual structural element in a work breakdown structure (WBS) representing the hierarchical organization of an R/3 project. Describes either a concrete task or a partial one that can be further subdivided.
    Proposed Business Process
    Assume there are seven expense heads in maintenance department. There may be addition of expense head in near future.
    Based on the maintenance heads, maintenance department will create a project in project system. This project will be used for ‘statistical purpose’ only & will not have any financial implication.
    Upon creation of a project, WBS elements will be created as per the expense heads. So for each expense head, there will be one top level WBS element. Again these WBS elements will be divided in twelve WBS elements. These twelve WBS elements represent twelve calendar months.
    Budget will be allocated to each WBS element & the WBS element will be released from the project.
    Maintenance department will create maintenance orders as per their work requirements. These orders will be settled to cost centre, which is maintained in the settlement rule. Also WBS element will have to be mentioned in each order so that the budget control can take place. So as to capture cost from each maintenance order, the WBS element field will be made ‘mandatory field’ in maintenance order.
    So when a maintenance order is released, system will do a budget check against the WBS element mentioned. If the budget check status is OK, order is released or else it will stopped from release. If the order is stopped from release, maintenance department will have to supplement the budget. Upon supplementing, the order is released again & the maintenance cost such as, labour, material costs can be booked on the order. Again the order cost is settled to cost centre & at the same time, budget is consumed from the respective WBS element.
    Every year, maintenance department will copy the previous year’s project so as to save time & efforts to create project & WBS elements. And the maintenance department will assign the budget allocated to each WBS element in a financial year.
    It is also possible to return the unutilised budget or, transfer of budget from one WBS element to another.
    Create a project CJ20N
    Create WBS element CJ20N
    Assign Budget to WBS elementsKO22
    Display assigned Budget KO23
    Supplement Budget KO24
    Display Supplement budget KO25
    Return Budget KO26
    Display Return budget KO27
    Transfer of budget CJ34
    Hope u wull get ur answer
    Regards
    Rakesh

  • Service order - WBS element

    In Service Order,
    we are doing a settlement to WBS element.
    I want to see a report through WBS element the costs, settled through Service Orders.
    Is there any Standard report.
    Please suggest.
    Raja

    Hi,
          If settlement is done to WBS then the cost would reflect under Actual Costs of WBS :
    Check if u can find in report :-S_ALR_87100188 or S_ALR_87013531 ..
    regards
    pushpa

Maybe you are looking for

  • IPod touch 2G not restoring after paid 3.1 update

    Hi I'm new here, this is my problem. I have an iPod touch 8GB 2G, purchased in August last year, anyway, I decided to treat myself last Saturday and update it, thing is, when it updated it froze then put itself in restore mode, thinking this was just

  • My iPod all of a sudden started to screw up the track listings! Help!

    I am one of those people that likes to make sure all of my music in iTunes is with all of its album art, track listings, titles, album order, etc. are all correct. My iPod on the most latest sync decided to seemly arbitrarily scramble some of my albu

  • Sync'ing a Palm Zire 72 with Windows 7 (Home Premium 64)

    Ok I am probably a dinasour but have relied on my Zire 72 for years for all the contacts and calendar items I don't want to keep on my phone but now cannot get it to sync with Windows 7.  I never used Vista, migrated straight from XP to Windows 7 but

  • Dropdown in Query input selection

    Hi all, In my report i have 2 input variable for expample  PLANT and 'STORAGE LOCATION' plant 1 contains list of storage locations an plant 2 contains list of storage locations. if i choose plant1, the storage locations of plant1 have to be populated

  • SECURITY ISSUE! Can someone get my home address fr...

    Hello. Can a person get my full home address/name etc from my youtube account? or indeed from a public forum post such as this one? When someone says "i have your ip address" can they actually find my house now? This is a very serious issue as i have