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)
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.