import javax.swing.*;
public class JFrameLabel
{
public static void main(String[] args)
{
final int FRAME_WIDTH = 300;
final int FRAME_HEIGHT = 120;
JFrame myFrame = new JFrame("Frame with label");
myFrame.setSize(FRAME_WIDTH, FRAME_HEIGHT);
myFrame.setVisible(true);
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
_________________________
_________________________
}
}
The above code shows an application in which a JFrame is created and its size, visibility, and close operation are set. In the blank lines provided, write the code to create a JLabel named thanks that holds the words "Thank you for your business". Then, write the statement to add the JLabel to the JFrame.
Correct Answer:
Verified
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q58: Match each term with the correct statement
Q59: What type of method must you implement
Q60: Match each term with the correct statement
Q61: import javax.swing.*;
import java.awt.*;
public class JFrame4
{
public static void
Q62: Assume you have declared a JFrame named
Q65: import javax.swing.*;
public class JFrameLook
{
public static void main(String[]
Q65: Write the statement to create a JButton
Q67: Write the statement to create a layout
Q68: import javax.swing.*;
public class JFrame1
{
public static void main(String[]
Q78: Write the statement to clear out a
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