Search:

Type: Posts; User: Lotus2013

Page 1 of 2 1 2

Search: Search took 0.24 seconds.

  1. Replies
    4
    Views
    365

    Re: TitledBorder Size and Color

    I don't know why the last time I tried, It didn't show the title. Then I changed the code and again pasted this code and it worked. Everything was OK. Thankssssss :)@};-
  2. Replies
    4
    Views
    365

    Re: TitledBorder Size and Color

    :) Thank you. I checked it but there's something that I don't understand. for creating a TitledBorder, there are 6 ways:
    1: createTitledBorder(Border border)
    2: createTitledBorder(Border border,...
  3. Replies
    4
    Views
    365

    TitledBorder Size and Color

    I created a titledBorder. How can I change the size and the color of my border?
    Thanks in advance :)
  4. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    Here is the error message:


    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.ArrayList.elementData(Unknown Source)
    at java.util.ArrayList.get(Unknown...
  5. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    Again, Hello :)

    I want to know how can I say that search the whole tokens[] Array and if you find the token containing "the" then print the next tokens till it was all finished.



    int...
  6. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    int lent = chars.size();
    if(lent == 3){
    int one = chars.get(2);
    System.out.println(one);
    }

    }

    I did this, but it doesn't work :|
    The size of the arraylist is 3 and...
  7. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    import java.util.ArrayList;
    import java.util.StringTokenizer;

    //import java.util.StringTokenizer;

    public class Parser {

    public static void main(String args[]){
    ...
  8. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    Thank you :) :) And I also want to remove the plural s in the word. For example to make the word "tables" into "Table". :-?
  9. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    There is also something else :-? for example when the parser finds the wanted word ( e.g it's the position (room) ) then I want to print it in this way:
    Position: Room
    I mean I want the first...
  10. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    In some cases, there are more than just one word after the word "the" that declare the position. for example:
    "There are 5 tables (dimension: 4 in 5 in 3 meters) in the Mike's room." Now I want to...
  11. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    for(int i= 0; i < tokens.length; i++){

    if(tokens[i].equals("the")){
    System.out.println(tokens[i+1]);
    }

    I changed it and it worked :) Thank you :) :)
  12. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    for(int i= 0; i < tokens.length; i++){

    if(tokens[i] == "the"){
    System.out.println(tokens[i+1]);
    }

    I did this but It doesn't work. It doesn't throw exception and doesn't have any...
  13. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    for example: "There are 5 tables (dimension: 4 in 5 in 3 meters) in the room."
    the position is this part: "in the room" and I want to say that:


    if(tokens.equals("the")){...
  14. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    I want to say that if the token equals to the, print the next token as position. How can I say this? :( Using split.
  15. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    I changed the code in this way to use split method instead of StringTokenizer



    public class Parser {
    public static void main(String args[]){

    parser("There are 5 table (dimension: 4 in...
  16. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    StringTokenizer strTok = new StringTokenizer(str, " ");

    It's the StrinTokenizer in which the tokens are separated by a space :-?
  17. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    I think I got what you mean. I added this to the code and changed the verb to are, But it doesn't work :(


    if(strTok.equals("are")){
    System.out.println(strTok.nextToken());
    }
  18. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    Sorry, I made a mistake there. I wanted to say that if the verb was "are" print out the third token (which is the number) as number. I'm so sorry. And the reason why I am counting the tokens is...
  19. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    I edited the code :)
  20. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    import java.util.StringTokenizer;

    public class Parser {
    public static void main(String args[]){

    parser("There is a table (dimension: 4 in 5 in 3 meters) in the room.");


    }
  21. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    I think I understood what you mean. I'll try to define the syntax and the rules for the parser. Thank you so much :) This is my first time to ask a question in a forum and I'm really happy about it....
  22. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    Sorry I'm very new to the programming so I don't really get Norm's question :confused:

    --- Update ---

    Yes, all the tokens are delimited by space. The other thing is that the number may change,...
  23. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    I guess I'd better use String tokenizer :-? I think It's much more efficient than split method. What is your opinion?
  24. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    No, the position does not change. But the sentence itself may change. for example we may have: There are 67 whiteboards(dimension: 3 in 5 meters) in the class.
  25. Thread: java parser

    by Lotus2013
    Replies
    48
    Views
    981

    Re: java parser

    I used the substring method and split method but there are some points which I should pay attention to. One is that the verb here can change. for example if we have two or more tables, then the verb...
Results 1 to 25 of 29
Page 1 of 2 1 2