[Solved]Java Please Explanations Comments Much Appreciated Ll Give Thumbs Done Way Study Q37069830
Has to be in Java. Please have explanations in the comments.Much appreciated. I’ll give you a thumbs up if this is done in away where I can study it.



How to Submit You need to submit java files to appropriate submission folder on iCollege. import java.awt.Graphics; import java.awt.Graphics2D; import java.awt. Image; import java.awt. Toolkit; import javax.swing.JComponent; class ImageComponent extends 3Component ( private static final long serialVersionUID-1L; private String filePath = “”; public ImageComponent() 0; public ImageComponent (String inFilePath) filePath = inFilePath; public void paint(Graphics g) Graphics2D g2-(Graphics2D) g; Image img1-Toolkit.getDefaultTooLkit().getImage(filePath) g2.drawImage(img1, 0, 0, this); g2.finalize(); Given the ImageComponent class above, implement a simple application, that will ask user to pick an imag ddisplay it, similar to the example on pictures Please note that .On start, user is asked to pick a file Open Documents Look In: Music Pictures Videos OS Install (C:) 4A Ad Auda Batt Users melni Documents Data (D:) File Name: Files of Iype: All Files Open Cancel Once image is picked, it is displayed: Display image You only need to implement client code (main) method), that will use ImageComponent class from the above; Start by creating a frame, similar to the examples from slides; Use file chooser to pick file (similar to the example from slides); You can get a path of selected file using the following (assuming you have a JFileChooser object named fileChooser): String pathToPickedImage fileChooser.getselectedFile().getPath); To make sure image component displays the picked image, you need to pass the path to the image to the constructor: ImageComponent imageComponentnew ImageComponent (pathToPickedImage); Set frame size to 1024 x 768 pixels as the following: frame.setsize(1024, 768); Show transcribed image text How to Submit You need to submit java files to appropriate submission folder on iCollege. import java.awt.Graphics; import java.awt.Graphics2D; import java.awt. Image; import java.awt. Toolkit; import javax.swing.JComponent; class ImageComponent extends 3Component ( private static final long serialVersionUID-1L; private String filePath = “”; public ImageComponent() 0; public ImageComponent (String inFilePath) filePath = inFilePath; public void paint(Graphics g) Graphics2D g2-(Graphics2D) g; Image img1-Toolkit.getDefaultTooLkit().getImage(filePath) g2.drawImage(img1, 0, 0, this); g2.finalize(); Given the ImageComponent class above, implement a simple application, that will ask user to pick an imag ddisplay it, similar to the example on pictures
Please note that .On start, user is asked to pick a file Open Documents Look In: Music Pictures Videos OS Install (C:) 4A Ad Auda Batt Users melni Documents Data (D:) File Name: Files of Iype: All Files Open Cancel Once image is picked, it is displayed: Display image
You only need to implement client code (main) method), that will use ImageComponent class from the above; Start by creating a frame, similar to the examples from slides; Use file chooser to pick file (similar to the example from slides); You can get a path of selected file using the following (assuming you have a JFileChooser object named fileChooser): String pathToPickedImage fileChooser.getselectedFile().getPath); To make sure image component displays the picked image, you need to pass the path to the image to the constructor: ImageComponent imageComponentnew ImageComponent (pathToPickedImage); Set frame size to 1024 x 768 pixels as the following: frame.setsize(1024, 768);
Expert Answer
Answer to Has to be in Java. Please have explanations in the comments. Much appreciated. I’ll give you a thumbs up if this is done… . . .
OR

