Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question for problem 31 chapter 13 How to Java How do I implement this \"For str

ID: 3685218 • Letter: Q

Question

Question for problem 31 chapter 13 How to Java

How do I implement this "For strokes, if the user chooses a solid line, then create the Stroke with the expression new BasicStroke(width, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)

where variable width is the width specified by the user in the line-width text field. If the user chooses a dashed line, then create the Stroke with the expression

new BasicStroke(width, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 10, dashes, 0)" in an else if statement in a public void itemStateChanged(ItemEvent event)

Explanation / Answer

public void itemStateChanged (java.awt.event.ItemEvent evt)

{                                                

if(evt.getStateChange() == 1)

    {

new BasicStroke(width, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);

    }

else

new BasicStroke(width, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 10, dashes, 0)

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote