Swing Application

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anubhav vij
    New Member
    • Jun 2007
    • 27

    #1

    Swing Application

    can anybody help me by telling the method how to display a GUI text area using java and display the information from a file (FOR EG: abc.doc) ????

    plz help...
    Last edited by anubhav vij; Jun 21 '07, 06:55 AM. Reason: spelling mistake
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by anubhav vij
    can anybody help me by telling the method how to display a GUI text area using java and display the information from a file (FOR EG: abc.doc) ????

    plz help...
    Read the swing tutorial on how to use JTextArea. We've already talked about the .doc part.

    Comment

    • anubhav vij
      New Member
      • Jun 2007
      • 27

      #3
      i have read the swing tutorial i know how to display the text area but i wanted to know that how do i get the text on it which i have stored in the .DOC file somewhere else.????

      Originally posted by r035198x
      Read the swing tutorial on how to use JTextArea. We've already talked about the .doc part.

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        A JTextArea even has a read method that slorps an entire text file
        into its model and shows it in its view.

        kind regards,

        Jos

        Comment

        • anubhav vij
          New Member
          • Jun 2007
          • 27

          #5
          can u provide me a sample code for the same????
          Originally posted by JosAH
          A JTextArea even has a read method that slorps an entire text file
          into its model and shows it in its view.

          kind regards,

          Jos

          Comment

          • JosAH
            Recognized Expert MVP
            • Mar 2007
            • 11453

            #6
            Originally posted by anubhav vij
            can u provide me a sample code for the same????
            Sure; here it is:

            [code=java]
            JTextArea yourArea= new JTextArea();
            Reader r= /* your reader here, given a file */;

            yourArea.read(r );
            [/code]

            kind regards,

            Jos

            Comment

            • anubhav vij
              New Member
              • Jun 2007
              • 27

              #7
              i didn't got the meaning of 2nd line....

              what have we to enter????
              Originally posted by JosAH
              Sure; here it is:

              [code=java]
              JTextArea yourArea= new JTextArea();
              Reader r= /* your reader here, given a file */;

              yourArea.read(r );
              [/code]

              kind regards,

              Jos

              Comment

              • r035198x
                MVP
                • Sep 2006
                • 13225

                #8
                Originally posted by anubhav vij
                i didn't got the meaning of 2nd line....

                what have we to enter????
                Read the comment there .

                Comment

                • anubhav vij
                  New Member
                  • Jun 2007
                  • 27

                  #9
                  not getting in man....
                  m passing the parameters and file name and path everything but not able to get it....


                  plz explain a bit more???
                  Originally posted by r035198x
                  Read the comment there .

                  Comment

                  • r035198x
                    MVP
                    • Sep 2006
                    • 13225

                    #10
                    Originally posted by anubhav vij
                    not getting in man....
                    m passing the parameters and file name and path everything but not able to get it....


                    plz explain a bit more???
                    What do you mean by "not able to get it"? Are you getting an Exception/compile time error?

                    Comment

                    • anubhav vij
                      New Member
                      • Jun 2007
                      • 27

                      #11
                      when i m giving the full path or simply the file name i m getting a compile time error....

                      Originally posted by r035198x
                      What do you mean by "not able to get it"? Are you getting an Exception/compile time error?

                      Comment

                      • r035198x
                        MVP
                        • Sep 2006
                        • 13225

                        #12
                        Originally posted by anubhav vij
                        when i m giving the full path or simply the file name i m getting a compile time error....
                        Great. I hope you haven't ...oh never mind.
                        Open the docs for the Reader and see how to use it.

                        Comment

                        • anubhav vij
                          New Member
                          • Jun 2007
                          • 27

                          #13
                          can u again send me the docs. which u wanna me to read....


                          Originally posted by r035198x
                          Great. I hope you haven't ...oh never mind.
                          Open the docs for the Reader and see how to use it.

                          Comment

                          • r035198x
                            MVP
                            • Sep 2006
                            • 13225

                            #14
                            Originally posted by anubhav vij
                            can u again send me the docs. which u wanna me to read....
                            I typed Reader.java in google and I got a link to this.

                            Comment

                            • JosAH
                              Recognized Expert MVP
                              • Mar 2007
                              • 11453

                              #15
                              Originally posted by r035198x
                              I typed Reader.java in google and I got a link to this.
                              Which incidentally is part of this and it can be downloaded too; hint hint;
                              wink, wink, nudge nudge.

                              kind regards,

                              Jos ;-)

                              Comment

                              Working...