Results 1 to 9 of 9
  1. #1
    mansoorhacker is offline Member
    Join Date
    Nov 2008
    Posts
    2
    Rep Power
    0

    Default Help me to solve problem

    hi every body.


    i want to know the code used behind the string() method in java.


    thx.

    mansoor.

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  3. #3
    exornextman is offline Member
    Join Date
    Jan 2009
    Posts
    3
    Rep Power
    0

    Default help me to display messages

    hi......
    can you help me to display more than one messages or statements in JOptionPane which is inside of a loop
    example.
    for(int index=0;index<5;index++){
    int num=1+index;
    JOptionPane.showMessageDialog(" "+num);
    }
    how could i display the 1 2 3 4 in one JOptionPane window of frame?
    in my could the said numbers 1 2 3 4 will display after one another and after clicking the OK

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Since showMessageDialog() didn't return anything on user event, better to use showConfirmDialog(). Look at the following code segment.

    Java Code:
    import javax.swing.JOptionPane;
    
    /**
     *
     * @author Eranga Thennakoon
     */
    public class MultipleJOptions {
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            int response = 0;
            int val = 0;
    
            while(response == 0) {
                response = JOptionPane.showConfirmDialog(null, ++val, "Message" ,
                    JOptionPane.OK_CANCEL_OPTION);
            }
    
        }
    
    }

  5. #5
    exornextman is offline Member
    Join Date
    Jan 2009
    Posts
    3
    Rep Power
    0

    Default very much thank you!!!

    thanks for the helped that you gave.........see ya!

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  7. #7
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    7

    Default can he?

    He's not the OP.... can he mark the thread as solved?

    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

  8. #8
    subashm28 is offline Member
    Join Date
    Jan 2009
    Posts
    6
    Rep Power
    0

    Default see the links

    see the links ya..or goolge search lik this....

    how to get the code for string() method in java in google.co.in

  9. #9
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Similar Threads

  1. Please solve the problem related to PDf reader
    By kavithaprabhaker in forum New To Java
    Replies: 5
    Last Post: 11-23-2011, 10:08 AM
  2. JList and records, what to do to solve the problem
    By willemjav in forum Java Applets
    Replies: 10
    Last Post: 06-11-2008, 02:28 PM
  3. how to solve transformer exception
    By java_arc in forum Advanced Java
    Replies: 1
    Last Post: 04-19-2008, 12:46 PM
  4. Help mi solve my error
    By Deon in forum New To Java
    Replies: 3
    Last Post: 01-11-2008, 05:26 AM
  5. Cannot solve the coding problem of my assignment
    By elimmom in forum New To Java
    Replies: 3
    Last Post: 08-13-2007, 11:33 AM

Posting Permissions

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