Java: Finish the statement to create a JLabel named welcome that holds the words
ID: 3809437 • Letter: J
Question
Java:
Finish the statement to create a JLabel named welcome that holds the words “Welcome Home”.
ANS:
JLabel __________ = new JLabel(___________);
12. Finish the statement to create a layout manager named myLayout that centers components in each row.
FlowLayout ___________ = new FlowLayout(_____________);
13. Finish the statement to provide a JTextField object named myInfo that allows enough room for a user to enter 15 characters.
JTextField myInfo = new JTextField(___);
14. Write the statement to clear out a JTextField named myText.
15. Write the statement to create a JButton named submitButton with the label “Submit your data”.
Explanation / Answer
11. JLabel welcome=new JLabel("Welcome Home");
12. FlowLayout myLayout=new FlowLayout(FlowLayout.CENTER);
13. JTextField myInfo=new JTextField(15);
14. myText.setText("");
15. JButton submitButton=new JButton("Submit your data");
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.