import javax.swing.*;
import java.awt.*;
public class JFrame6
{
public static void main(String[] args)
{
final int FRAME_WIDTH = 250;
final int FRAME_HEIGHT = 100;
JFrame aFrame = new JFrame("Sixth frame");
aFrame.setSize(FRAME_WIDTH, FRAME_HEIGHT);
aFrame.setVisible(true);
aFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel greeting = new JLabel("Hello");
JLabel greeting2 = new JLabel("Who are you?");
_________________________
aFrame.add(greeting);
aFrame.add(greeting2);
}
}
Using the above code, write the FlowLayout statement in the blank line provided that will display the two greeting JLabels side by side.
Correct Answer:
Verified
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q49: Write the statement to add a tool
Q61: Create the statements to construct two JFrame
Q65: Write the statement to create a JButton
Q65: import javax.swing.*;
public class JFrameLook
{
public static void main(String[]
Q67: Write the statement to create a layout
Q68: import javax.swing.*;
public class JFrame1
{
public static void main(String[]
Q70: Write the code to build a JComboBox
Q72: Write the statement to create a JCheckBox
Q75: Write the statement to provide a JTextField
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