Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8051947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:25:46+00:00 2026-06-05T07:25:46+00:00

I have got data from XML parsing, and try to sort it based on

  • 0

I have got data from XML parsing, and try to sort it based on date which has format like “Wed, 06 Jun 2012 09:53:05 +0700”. So all news from every provider will be mixed and organized from the latest to the newest.

Here is the code:

int i=0;
while (i<vec.size()){

    row = new TableRowManager();

    prov = new LabelField(((BinNews)vec.elementAt(i)).getProv(),DrawStyle.ELLIPSIS){
        protected void paint(Graphics g) {
            g.setColor(Color.ORANGERED);
            super.paint(g);
        }
    };

    title = new LabelField(((BinNews)vec.elementAt(i)).getTitle(),DrawStyle.ELLIPSIS){
        protected void paint(Graphics g) {
            g.setColor(Color.BLUE);
            super.paint(g);
        }
    };
    title.setFont(Font.getDefault().derive(Font.BOLD));

    desc = new LabelField(((BinNews)vec.elementAt(i)).getDesc(),DrawStyle.ELLIPSIS){
        protected void paint(Graphics g) {
            g.setColor(Color.BLACK);
            super.paint(g);
        }
    };

    date = new LabelField(((BinNews)vec.elementAt(i)).getDate(),DrawStyle.ELLIPSIS){
        protected void paint(Graphics g) {
            g.setColor(Color.ORANGERED);
            super.paint(g);
        }
    };

    rows.addElement(row);
    setSize(rows.size());
    row.add(prov);
    row.add(date);
    row.add(title);
    row.add(desc);
    i++;
}

so, before I add it into the row, it will be sorted first. Can anyone help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:25:48+00:00Added an answer on June 5, 2026 at 7:25 am

    try this –

    public static SimpleSortingVector  vector = new SimpleSortingVector ();
    
    
    vector.setSortComparator(new MyComparator());
    vector.addElement(new FriendsRequestObject(id_,name_));
    vector.reSort();    
    
    
    
    import net.rim.device.api.util.Comparator;
    public class MyComparator implements Comparator {
     public int compare(Object o1, Object o2) {
        FriendsRequestObject f1 = (FriendsRequestObject)o1;
        FriendsRequestObject f2 = (FriendsRequestObject)o2;
    
        return f1.getSender_name().compareTo(f2.getSender_name());
      }
    
      public boolean equals(Object obj) {
        return compare(this, obj) == 0;
      }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got an application, that is getting data via XML-files. During the parsing-part
I've got some code which draws data from an xml file but it seems
i get data from xml file and sometime the date is empty. i have
So i have a .wav file. from this i got the data: as expected
I have got a list box in multi select mode which is data bound
I have this data coming from a XML: var searched = from c in
I've got an interesting problem. I have an iPad App which has to parse
I got a Spinner element which I populate with data from a Cursor using
I've got this data I get from an XML feed and parse as NSDictionaries.
I've got a speed question. I have a bash script which parses information from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.