File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes How to align in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to align in java" Watch "How to align in java" New topic
Author

How to align in java

puni doms
Greenhorn

Joined: Feb 06, 2012
Posts: 6
Can anyone help me to write a code in java applet in eclipse


For eg: If you have English 1
Hindi2
English 4
Hindi1
English 2
Hindi4
English 3
Hindi3

And the answer must be English 1
English 2
English 3
English 4
Hindi1
Hindi2
Hindi3
Hindi4
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
I think you mean "sorting", not "aligning", yes?

Depends on the kind of data structure you're using to store these. If it's String objects in a java.util.List (like an ArrayList), you could simply call Collections.sort(...).
puni doms
Greenhorn

Joined: Feb 06, 2012
Posts: 6
The same what the above is.....
i dont knoe wheather it sort or align....
can you tell , in which code the answer willl come.
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3742
    
  16
puni doms wrote:can you tell , in which code the answer willl come.

Did you read the second part of Tim's post ?


Joanne
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4664
    
    5

Nothing specific to Applets. I'm moving this thread to Beginning Java.


luck, db
There are no new questions, but there may be new answers.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4664
    
    5

Please BeForthrightWhenCrossPostingToOtherSites
http://www.java-forums.org/new-java/55201-how-align-java.html
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11498
    
  16

An example is not a spec. It may be enough to start the conversation, but it is a LONG way from defining what needs to be done. It is not clear if you are sorting the list of inputs alphabetically, if English must always come first (what if instead of Hindi it was Arabic - should English still come first?), if the first language listed should come first, or something else entirely.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40051
    
  28
And welcome to the Ranch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to align in java