Java program doesnt work please help. import java.applet.*; import java.awt.*; import java.awt.event.*; public class Truck extends Applet implement ActionListener { int x,y,z; int t1,t2: Button b1,b2; String msg=" "; void slep() { try { Thread.sleep(100); } catch(Exception ex) { } } public void init() { t1=0; t2=1; X=20; y=60; setLayout(new FlowLayout(FlowLayout.CENTER)); Label 1=new Label("webeduclick"); b1=new Button("Forward"); add(b1); b2=new Button("Stop"); add(b2); b1.addActionListener(this); b2.addActionListener(this); } public void start() { } public void actionPerformed(ActionEvent e) { String s=e.getActionCommand(); if(s.equals("Stop")) { msg=" "; repaint(); } } public void paint(Graphics g) { setBackground(Color.green); z=getWidth(); Color c1=new Color(20.160.200); Color c2=new Color(200.60.200); g.setColor(c1); g.drawline(0,y+75,z,y=75); g.setColor(Color.yellow); g.fillRoundRect(x,y+20,100,40,5,5); g.fillArc(x+90,y+20,20,40,270,180); g.setColor(Color.orange); g.fillRoundRect(x+10,y,70,25,10,10); g.setColor(Color.blue); g.fillRect(x+20,y+5,20,25); g.fillRect(x+50,y+5,20,25); g.setColor(Color.Pink); g.fillRoundRect(x+55,y+10,10,10,20,10,10); g.fillOval(x+10,y+50,25,25); g.fillOval(x+60,y+50,25,25); g.setColor(Color.white); g.fillOval(x+15,y+55,10,10); g.fillOval(x+65,y+55,10,10); x=x+10; slep(); if(msg.equals("Forward")) { if(x+120
Java program doesnt work please help. import java.applet.*; import java.awt.*; import java.awt.event.*; public class Truck extends Applet implement ActionListener { int x,y,z; int t1,t2: Button b1,b2; String msg=" "; void slep() { try { Thread.sleep(100); } catch(Exception ex) { } } public void init() { t1=0; t2=1; X=20; y=60; setLayout(new FlowLayout(FlowLayout.CENTER)); Label 1=new Label("webeduclick"); b1=new Button("Forward"); add(b1); b2=new Button("Stop"); add(b2); b1.addActionListener(this); b2.addActionListener(this); } public void start() { } public void actionPerformed(ActionEvent e) { String s=e.getActionCommand(); if(s.equals("Stop")) { msg=" "; repaint(); } } public void paint(Graphics g) { setBackground(Color.green); z=getWidth(); Color c1=new Color(20.160.200); Color c2=new Color(200.60.200); g.setColor(c1); g.drawline(0,y+75,z,y=75); g.setColor(Color.yellow); g.fillRoundRect(x,y+20,100,40,5,5); g.fillArc(x+90,y+20,20,40,270,180); g.setColor(Color.orange); g.fillRoundRect(x+10,y,70,25,10,10); g.setColor(Color.blue); g.fillRect(x+20,y+5,20,25); g.fillRect(x+50,y+5,20,25); g.setColor(Color.Pink); g.fillRoundRect(x+55,y+10,10,10,20,10,10); g.fillOval(x+10,y+50,25,25); g.fillOval(x+60,y+50,25,25); g.setColor(Color.white); g.fillOval(x+15,y+55,10,10); g.fillOval(x+65,y+55,10,10); x=x+10; slep(); if(msg.equals("Forward")) { if(x+120<z) { x=x+1; ShowStatus("Press Forward for Starting Truck")); repaint(); } } } } {
![O Truck
Your name
Create JavaFX application that displays similar picture.
You can use your own color palette.
You do not have to match sizes exactly.
You are free to add more details, but do not forget to print your name in the lower right angle.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fc58c7bfc-8dc9-4fce-a5cc-e22a5f751428%2F5450a8f6-569e-406f-ac21-5550f433fd4a%2Fuuukfpn_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)