Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Demo: https://www.youtube.com/watch?v=MOfqM-zy2r0 The task is to make the shapes moveable across the screen as shown in the link above. Right now my code shows a

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Demo: https://www.youtube.com/watch?v=MOfqM-zy2r0

The task is to make the shapes moveable across the screen as shown in the link above. Right now my code shows a shape when clicked on but I am not able to move it around.

Therefore the help that I need is for the shapes to be moveable around the screen. THANK YOU

ALL CODE ARE IN JAVA

1 import java.awt. Graphics; public interface drawable ff public void draw(Graphics g); 3 import javax.swing. ; public class Plaineanel extends JPanel \{ public PlainPanel() \{ JPanel southPanel = new JPanel(); southPanel. setlayout(new GridLayout (2,2) ); JPanel upper = new JPanel () ; JPanel lower = new JPanel(); upper. setlayout (neiv GridLayout (1,2) ); lower.setLayout(new GridLayout (1,1)); upper.add (new JButton( "Previous")); upper .add (new JButton ("Next")); lower , add(new Button ("Submit")); southPanel .add (upper); southPanel.add (lower); this.setlayout(new BorderLayout()); this. add (southPanel, Borderlayout. SOUTH); this.add (new FramedPanel(Color.red), Borderkayout.CENTER); FramedPanel drawingSurfacePanel = new FramedPanel ( Color.RED); this. add(drawingSurfacePanel, BorderLayout. CENTER); new FramedPanelMouselistener (drawingSurfacePanel); \}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Donald A. Carpenter Fred R. McFadden

1st Edition

8178088045, 978-8178088044

More Books

Students also viewed these Databases questions