Results 1 to 2 of 2
  1. #1
    maram is offline Member
    Join Date
    Aug 2007
    Posts
    1
    Rep Power
    0

    Default how to make abcxyz to zyxcba

    import javax.swing.JOptionPane;
    import java.util.Scanner;
    public class Change{
    public static void main (String[]args){
    String Input = JOptionPane.showInputDialog("Enter Word: ");
    for(int i=0; i<Input.length()-1; i++)
    JOptionPane.showMessageDialog(null,("The Results Is : " + i ));
    }
    }
    I can get the result but I've to click manually to get it.. :confused:

  2. #2
    yiweiang is offline Member
    Join Date
    Aug 2007
    Posts
    15
    Rep Power
    0

    Default

    Let me see if i've got your question right. You have one string and you just want to flip it over.
    public class StringFlip
    {
    public static void main(String Args[])
    {
    String a="abcde";
    String b="";

    for(int x=a.length();x>0; x--)
    {
    b=b+a.substring(x-1,x);
    }

    System.out.println(b);
    }
    }

    Tell me if this is what you are looking for.

Similar Threads

  1. How to make a modal JFrame?
    By surot in forum New To Java
    Replies: 20
    Last Post: 06-11-2011, 11:31 PM
  2. i need help to make this program
    By masaka in forum New To Java
    Replies: 2
    Last Post: 03-23-2008, 01:26 PM
  3. Can't make JTable work -- please help!!
    By cagalli83 in forum Advanced Java
    Replies: 0
    Last Post: 02-13-2008, 09:31 AM
  4. How to make popups like in eclipse
    By ekadosh in forum SWT / JFace
    Replies: 0
    Last Post: 02-04-2008, 07:58 AM
  5. can i make a login form?
    By mitsakos in forum New To Java
    Replies: 2
    Last Post: 12-19-2007, 10:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •