Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Trouble apending a textArea with the contents of a parameter

  1. #1
    Junior Member
    Join Date
    Nov 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Trouble apending a textArea with the contents of a parameter

    Hi all!!


    I have a method

     public String methodTester(Method [] mtd)


    which does the following amongst other things:

     
    for (Method m : mtd) { // introducing all methods in the array
                if (!(m.getName().startsWith("test"))) { //
     
                        return("Object or Class does not contain such methods");
     
                }else {
                        result = result + m.getName();
                }
     
                // more code here
     
    return result;


    Then I have a listener on a button and when clicked it is supposed to display the results on a textArea on a frame. The frame works fine and it outputs all correctly except the third line which I write below which gives me an error “cannot find symbol”.

     
                   ClassAnalyzer analyzer = new ClassAnalyzer(textField.getText());
     
                    textArea.append(analyzer.getClassMember()+ "\n"); // this works fine
     
                    textArea.append(analyzer.methodTester(mtd)); // this does not work


    Can anyone please help me?

    Thank you and best regards,

    bluetxxth
    Last edited by bluetxxth; November 21st, 2010 at 12:56 PM.


  2. #2
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,676
    Thanks
    25
    Thanked 329 Times in 305 Posts

    Default Re: Trouble apending a textArea with the contents of a parameter

    mtd doesn't seem to be within scope of that code.
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

Similar Threads

  1. Reading contents of another window
    By jimmys in forum Java Theory & Questions
    Replies: 8
    Last Post: October 4th, 2010, 11:40 PM
  2. Initialization parameter of servlets
    By rakesh in forum Java Servlet
    Replies: 3
    Last Post: April 13th, 2010, 03:14 AM
  3. How to create a sorted set from the contents of an array
    By davie in forum Collections and Generics
    Replies: 1
    Last Post: March 11th, 2010, 03:44 PM
  4. How to read from all files in a directory & plot the contents?
    By 123 in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: February 11th, 2010, 12:43 PM
  5. Convert contents of JTextArea / JEditorPane to PDF
    By rangarajank in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: September 30th, 2009, 02:38 PM