I basically am working on a final project for JAVA and I cant figure out how to move the strings into the paint class. Here are my 2 codes.

import java.util.Scanner;
public class FinalProjectQuestions
{
    public static void main(String []args)
    {
        Scanner in = new Scanner(System.in);
        System.out.println("We will design the stick face of your dreams");
        System.out.print("Choose gender M for Male, or F for Female: ");
        String gender = in.next();
         String hair = "";
        String haircolor = "";
        String eyecolor = "";
        String eyesize = "";
        String mouthsize = "";
        String m = "m";
        String m2 = "M";
        String femalehair = "";
        String femalehaircolor = "";
        String femaleeyecolor = "";
        String femaleeyesize = "";
        String femalemouthsize = "";
        String femalemakeup = "";
        if (gender.equals(m) || gender == "M")
        {
            System.out.print("Hair Length, Short, Mediuem, or Long: ");
            hair = in.next();
            System.out.print("Hair Color, Red, Brown, Blond, Blue, Black, or Purple: ");
            haircolor = in.next();
            System.out.print("Eye Color, Blue, Red, Brown, or Black: ");
            eyecolor = in.next();
            System.out.print("Eye size, Big, Small, or Mediuem: ");
            eyesize = in.next();
            System.out.print("Mouth Size, Big, Small, or Mediem: ");
            mouthsize = in.next();
        }

        else
        {
            System.out.print("Hair Length, Short, Mediuem, or Long: ");
            femalehair = in.next();
            System.out.print("Hair Color, Red, Brown, Blond, Blue, Black, or Purple: ");
            femalehaircolor = in.next();
            System.out.print("Eye Color, Blue, Red, Brown, or Black: ");
            femaleeyecolor = in.next();
            System.out.print("Eye size, Big, Small, or Mediuem: ");
            femaleeyesize = in.next();
            System.out.print("Mouth Size, Big, Small, or Mediem: ");
            femalemouthsize = in.next();
            System.out.print("MakeUp, None, Little, Average, or Tons: ");
            femalemakeup = in.next();

        }
    }
}


import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.geom.Ellipse2D;
import javax.swing.JComponent;
public class FinalProjectMale extends JComponent
{
   public void paintComponent(Graphics g)
   {
       Graphics2D g2 = (Graphics2D) g;
       Ellipse2D.Double faceshape = new Ellipse2D.Double(100,100,100,100);
}
}

This is where I am lost at, I have no idea how to move strings.

Your FinalProjectQuestions class is written as if it's a first Java project, not a final.
For a final project then you are probably expected to define a class that holds all the information for a face. You create a new instance using the input that you get from the user, then pass that instance to the class/method where it is needed.

Comments
I kind of understand what you are syaing, but how would I go about doing that. I havent done that stuff before

Hi AgentOxegen
I think you're in trouble here - trying to write some custom graphics before you know to to create a simple class. There's to much missing inbetween for me to be able to give you the help you need in the time I have available. I can only suggest that must have missed part of your syllabus somehow, and that the info you need will be in your course materials somewhere. Anyway, I wish you good luck.
JC

This article has been dead for over six months. Start a new discussion instead.