Please help me to wirte a Java Porgram which was a frame program that was a robu
ID: 3697582 • Letter: P
Question
Please help me to wirte a Java Porgram which was a frame program that was a robust program and using layout to separate the frame in two part, the first part should be using arraylist to read the question and answer about a movie star inside the program,the second part should using arraylist to read the question and answer about sport star from a txt file, question need to be random show up in the frame. and it need to include the exception. last it need to give the user second chance to answer a same question, and the porgram will end after the user answer 10 question or answer wrong in second chance. Thank You!
example Question inside the program:
”When did the Leonardo DiCaprio get his first Oscars“ “2/28/2016"
example question inside the txt file:
"How long did Kobe Bryant Played for L.A. Lakers", "20 Years"
we would add more question after this program is complete.Thank You!
Explanation / Answer
import java.awt.Frame;
/*
* To create a stand alone window, class should be extended from
* Frame and not from Applet class.
*/
public class CreateFrameWindowExample extends Frame{
CreateFrameWindowExample(String title){
//call the superclass constructor
super();
//set window title using setTitle method
this.setTitle(title);
/*
* Newly created window will not be displayed until we call
* setVisible(true).
*/
this.setVisible(true);
}
public static void main(String args[]){
CreateFrameWindowExample window =
new CreateFrameWindowExample("Create Window Example");
/*
* In order to close the window, we will have to handle the events
* and call setVisible(false) method.
*
* This Example program does not handle events, so you will have
* to terminate the program (by pressing ctrl+C) in a terminal window
* to close the frame window.
*/
}
}
Example Output