Which statements create a JLabel that holds the words "Happy birthday" and adds the greeting to a JFrame object named aGreeting ?
A) JLabel mygreeting = aFrame.add(mygreeting) ; new JLabel( "Happy Brithday") ;
B) JLabel mygreeting = new Frame( "Happy Brithday") ;
C) JLabel("Happy Brithday") ; aGreeting.add(Label) ;
D) JLabel mygreeting = new JLabel("Happy Birthday") ; aGreeting.add(mygreeting) ;
Correct Answer:
Verified
Q2: Each Swing component is a descendant of
Q3: What class is the immediate parent of
Q4: A _ is a Component used to
Q5: You can use the setEnabled() method to
Q6: The Swing classes are part of a
Q7: Which method do you use to assign
Q8: When a JFrame is closed, you can
Q9: If a user enters more characters than
Q10: When setting a JFrame 's size, part
Q11: You cannot change the font of strings
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents