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.


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

Results 1 to 2 of 2

Thread: calling this method

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Thanked 0 Times in 0 Posts

    Default calling this method

     public void changeWhole(double amount)
        Pixel[] pixelArray = this.getPixels();
        Pixel pixel = null;
        int value = 0;
        int i = 0;
        while( i < pixelArray.length)
          pixel = pixelArray[i];
          value = pixel.getBlue();
          pixel.setBlue((int) (value * 0.9));
      public static void main(String[] args) 
         String fileName = FileChooser.pickAFile();
         Picture pictObj = new Picture(fileName);
    I want to call the changeWhole method in my main method but I don't have any idea on how to type it out.

  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    My Mood
    Thanked 263 Times in 232 Posts

    Default Re: calling this method

    FileChooser.pickAFile(); is a method call.
    pixel.getBlue(); is a method call.
    pizelArray[i]; is a more advanced method call.
    this.getPixels(); is a method call.
    i++; is a method call.

    With all the working examples you have, surely you have tried to call the changeWhole method in some way.
    What did you try?
    If nothing, try something now.
    What is the error message?

Similar Threads

  1. calling a method in class
    By MrBean in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 31st, 2012, 12:31 AM
  2. Calling another method on my code
    By Caliichick in forum Java Theory & Questions
    Replies: 3
    Last Post: June 12th, 2012, 05:01 PM
  3. Calling method cant get the parameters right
    By frozen java in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 22nd, 2011, 02:23 PM
  4. [SOLVED] method calling
    By javapenguin in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 4th, 2010, 01:43 AM
  5. Help Calling Method From Another Class
    By CheekySpoon in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 15th, 2010, 10:24 AM