Results 1 to 5 of 5
  1. #1
    leunam123 is offline Member
    Join Date
    Aug 2010
    Posts
    2
    Rep Power
    0

    Post How to make a TEXT TWIST using GUI

    help me with my problem....please


    i need to make a Java GUI
    making like a Text Twist
    please....i need this urgently, asap:(

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    Where is your code? What doesn't work? We're no "do it for me" service. It's your job. Post your best attempt and ask specific questions.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    leunam123 is offline Member
    Join Date
    Aug 2010
    Posts
    2
    Rep Power
    0

    Default

    i want to have a GUI application but i cant...

    public class TextTwist {
    private static final int ALPHABET = 256;

    // return profile of ASCII string s
    public static int[] profile(String s) {
    int[] cnt = new int[ALPHABET];
    for (int i = 0; i < s.length(); i++)
    ++cnt[s.charAt(i)];
    return cnt;
    }

    // are two profiles identical?
    public static boolean contains(int[] cnt1, int[] cnt2) {
    for (int i = 0; i < ALPHABET; i++)
    if (cnt1[i] < cnt2[i]) return false;
    return true;
    }


    public static void main(String[] args) {

    // comptue profile of input word
    String word = args[0].toLowerCase();
    int[] cnt1 = profile(word);

    // read in dictionary words, one at a time and process
    while (!StdIn.isEmpty()) {
    String s = StdIn.readString().toLowerCase();

    // check that s is of right length
    if (s.length() < 4 || s.length() > word.length()) continue;

    // compute profile of s
    int[] cnt2 = profile(s);

    // check against input word
    if (contains(cnt1, cnt2)) System.out.println(s);
    }
    }

    }

  4. #4
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    Post your code between a pair of [CODE] tags.
    That is: [CODE]... your code goes here ... [/CODE]

    Read this:
    Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. How do you make a basic Java JSlider with a text box ???
    By danielmessick in forum New To Java
    Replies: 1
    Last Post: 03-07-2010, 01:59 PM
  2. How do you make a basic Java JSlider with a text box ???
    By danielmessick in forum Java Applets
    Replies: 1
    Last Post: 03-07-2010, 01:55 PM
  3. How to make text bold using java
    By gundyguyz in forum New To Java
    Replies: 2
    Last Post: 07-28-2009, 06:06 AM
  4. How to make a text field to accept numbers only?
    By Robert_85 in forum Advanced Java
    Replies: 15
    Last Post: 04-07-2009, 02:30 PM
  5. Make a text in Jlabel down to next Line
    By hungleon88 in forum AWT / Swing
    Replies: 2
    Last Post: 12-02-2008, 12:10 AM

Tags for this Thread

Posting Permissions

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