Answered You can hire a professional tutor to get the answer.

QUESTION

Write a graphical applicaton overriding the paint method of the JFrame class. Inside it, cast the Graphics object to aGraphics2D object and draq a...

36.Write a graphical applicaton overriding the paint method of the JFrame class. Inside it, cast the Graphics object to aGraphics2D object and draq a dashed, rounded rectangle. The length of the dashes should be longer than the length of the spaces between dashes. Hint: Loionok up the Graphics2D, BasicStrokes, and RoundRectangle2D. Double classes in Java Class Library.

Public class game

{

Private String description;

Public Game ( String newDescription)

{

setDescription (newDescription);

}

public String getDescription()

{

Return description;

}

Public void setDescription ( String newDescription)

{

Description= newDescription;

}

Public String toString()

{

Return ( "description: " + description);

}

}

12.

Assuming the file words.txt holds the following data:

CS1 Java Illuminated

what is the output of this code sequence:

a.If the file is found?

b.If the file is not found?

Try

{

Scanner file = new Scanner ( new File( "words.txt"));

String result = "";

While ( file.hasNext())

{

String s = file.next();

Result += s;

Result+= " And";

}

System.out.println ( "result is "+result);

File.close();

}

Catch ( FileNotFoundExcption fne)

{

System.out.println( "Unable to find words.txt");

}

Catch (I0Exception ioe)

{

Ioe.printStackTrace();

}

46.

Write a program that reads a file and counts how many lines it contains.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question