Deck 14: Introduction to Swing Components

ملء الشاشة (f)
exit full mode
سؤال
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);
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Each Swing component is a descendant of a JComponent .
سؤال
What class is the immediate parent of JFrame ?

A) Container
B) Component
C) Frame
D) Window
سؤال
A ____ is a Component used to trigger an action or make a selection when the user clicks it.

A) JCheckBox
B) JButton
C) JLabel
D) JComboBox
سؤال
You can use the setEnabled() method to make a component available or unavailable by passing true or false to it.
سؤال
The Swing classes are part of a more general set of UI programming capabilities that are collectively called the ____.

A) JavaX Classes
B) Java Foundation Classes
C) UI packages
D) Java Extension Libraries
سؤال
Which method do you use to assign a font object to a JLabel ?

A) setFont()
B) fontLabel()
C) assignFont()
D) JLabel.font()
سؤال
When a JFrame is closed, you can end a program that you have forgotten to exit by typing Alt+E.
سؤال
If a user enters more characters than specified in a JTextField , the extra characters are deleted.
سؤال
When setting a JFrame 's size, part of the area is unusable because it is consumed by the JFrame 's title bar and borders.
سؤال
You cannot change the font of strings displayed in GUI components.
سؤال
Which constructor constructs a new JTextField with the specified text and columns?

A) public JTextField(String text)
B) public JTextField(int columns, String text )
C) public JTextField(String text, int columns)
D) public JTextField(String text, int columns, int location)
سؤال
Java provides you with a Font class from which you can create an object that holds typeface and size information.
سؤال
An object that is interested in an event is called a source.
سؤال
Which method overrides the default behavior for the JFrame to be positioned in the upper-left corner of the computer screen's desktop?

A) setSize()
B) title()
C) setBounds()
D) isResizable()
سؤال
What is the default layout manager for JFrame ?

A) GridLayout
B) FlowLayout
C) FrameLayout
D) BorderLayout
سؤال
The default behavior of a JFrame is to use the border layout format, which divides a container into regions.
سؤال
When a user closes a JFrame by clicking the Close button in the upper-right corner, the default behavior is for the JFrame to close and the application to terminate.
سؤال
What is the immediate parent class of JTextField ?

A) JTextComponent
B) JComponent
C) Container
D) JFrame
سؤال
You can call a JFrame 's setDefaultCloseOperation() method and use ____ as an argument to keep the JFrame visible and continue running the program.

A) JFrame.EXIT_ON_CLOSE
B) WindowConstants.DISPOSE_ON_CLOSE
C) WindowConstants.DO_NOTHING_ON_CLOSE
D) WindowConstants.HIDE_ON_CLOSE
سؤال
When constructing a Font object, which of the following arguments is NOT required?

A) typeface
B) style
C) weight
D) point size
سؤال
A component can be made available or unavailable by passing true or false to the ____ method.

A) getSource()
B) setEnabled()
C) setSelected()
D) setBounds()
سؤال
A ____ is a component that combines a button or an editable field and a drop-down list.

A) JCheckBox
B) JComboBox
C) JButton
D) JTextBox
سؤال
Which of the following statements will change the value displayed in a JLabel named hello ?

A) hello.setText("Hello");
B) setText.hello = "Hello"
C) hello = setText("Hello");
D) setText = hello
سؤال
Look and feel comprises the elements of design, style, and ____ in any user interface.

A) font faces
B) functionality
C) logistics
D) syntactic sugar
سؤال
The ____ responds to keyboard events.

A) KeyListener
B) ActionListener
C) ChangeListener
D) FocusListener
سؤال
The ____ layout manager places components in a row, and when a row is filled, it automatically spills components into the next row.

A) flow
B) border
C) grid
D) group
سؤال
The ____ responds to keyboard focus events.

A) KeyListener
B) ActionListener
C) ChangeListener
D) FocusListener
سؤال
The JButton , JCheckBox , JComboBox , and JRadioButton components are associated with the ____ method.

A) addAdjustmentListener()
B) addChangeListener()
C) addWindowListener()
D) addItemListener()
سؤال
Which method sets the state of the JCheckBox to true for selected or false for unselected?

A) isSelected
B) getSelected
C) setSelected
D) setState
سؤال
The ____ method of JComboBox returns the maximum number of items the combo box can display without a scroll bar.

A) getSelectedItem()
B) getItemCount()
C) getMaximumRowCount()
D) getSelectedIndex()
سؤال
A method that executes because it is called automatically when an appropriate event occurs is an event ____.

A) responder
B) listener
C) handler
D) source
سؤال
Within an implementation of the itemStateChanged() method, you can use the ____ method to determine which object generated the event, and the getStateChange() method to determine whether the event was a selection or a deselection.

A) getSource()
B) getEvent()
C) getItem()
D) getState()
سؤال
Which of the following statements will correctly set a JFrame named myFrame to be visible?

A) myFrame.Visible = True
B) myFrame.setVisible(true)
C) myFrame.Visibility.True
D) myFrame.true = Visible
سؤال
Which method do you use to change the state of a JCheckBox ?

A) void setSelected(boolean)
B) boolean isSelected()
C) void setText(String)
D) String getText()
سؤال
A ____ consists of a label positioned beside a square; you can click the square to display or remove a check mark.

A) ButtonGroup
B) RadioButton
C) JComboBox
D) JCheckBox
سؤال
Swing  components are UI elements such as dialog boxes and buttons. You can usually recognize their names because they begin with ____.

A) the letter S
B) Swing
C) the letter J
D) UI
سؤال
When you create a(n) ____, you can group several components, such as JCheckBox es, so a user can select only one at a time.

A) CheckGroup
B) ButtonGroup
C) OptionBox
D) OptionGroup
سؤال
The ActionListener interface contains the ____ method specification.

A) actionOccurred(Action e)
B) actionPerformed(ActionEvent e)
C) actionEvent(ActionEvent e)
D) action(Event e)
سؤال
Within an event-driven program, a component on which an event is generated is the ____ of the event.

A) handler
B) driver
C) listener
D) source
سؤال
Match between columns
Are written completely in Java and do not have to rely on the local operating system code
point size
Are written completely in Java and do not have to rely on the local operating system code
layout manager
Are written completely in Java and do not have to rely on the local operating system code
lightweight components
Are written completely in Java and do not have to rely on the local operating system code
window decorations
Are written completely in Java and do not have to rely on the local operating system code
editable
Are written completely in Java and do not have to rely on the local operating system code
look and feel
Are written completely in Java and do not have to rely on the local operating system code
heavyweight components
Are written completely in Java and do not have to rely on the local operating system code
fonts
Are written completely in Java and do not have to rely on the local operating system code
event handler
Are written completely in Java and do not have to rely on the local operating system code
container
Are written completely in Java and do not have to rely on the local operating system code
frame
Are written completely in Java and do not have to rely on the local operating system code
border layout manager
Are written completely in Java and do not have to rely on the local operating system code
listener
Are written completely in Java and do not have to rely on the local operating system code
flow layout manager
Are written completely in Java and do not have to rely on the local operating system code
register
سؤال
Match between columns
Require interaction with the local operating system
point size
Require interaction with the local operating system
layout manager
Require interaction with the local operating system
lightweight components
Require interaction with the local operating system
window decorations
Require interaction with the local operating system
editable
Require interaction with the local operating system
look and feel
Require interaction with the local operating system
heavyweight components
Require interaction with the local operating system
fonts
Require interaction with the local operating system
event handler
Require interaction with the local operating system
container
Require interaction with the local operating system
frame
Require interaction with the local operating system
border layout manager
Require interaction with the local operating system
listener
Require interaction with the local operating system
flow layout manager
Require interaction with the local operating system
register
سؤال
How do you change the font of a JLabel ?
سؤال
Match between columns
Sign up an object as a listener
point size
Sign up an object as a listener
layout manager
Sign up an object as a listener
lightweight components
Sign up an object as a listener
window decorations
Sign up an object as a listener
editable
Sign up an object as a listener
look and feel
Sign up an object as a listener
heavyweight components
Sign up an object as a listener
fonts
Sign up an object as a listener
event handler
Sign up an object as a listener
container
Sign up an object as a listener
frame
Sign up an object as a listener
border layout manager
Sign up an object as a listener
listener
Sign up an object as a listener
flow layout manager
Sign up an object as a listener
register
سؤال
What are the four JFrame constructors?
سؤال
Match between columns
An object that is interested in an event
point size
An object that is interested in an event
layout manager
An object that is interested in an event
lightweight components
An object that is interested in an event
window decorations
An object that is interested in an event
editable
An object that is interested in an event
look and feel
An object that is interested in an event
heavyweight components
An object that is interested in an event
fonts
An object that is interested in an event
event handler
An object that is interested in an event
container
An object that is interested in an event
frame
An object that is interested in an event
border layout manager
An object that is interested in an event
listener
An object that is interested in an event
flow layout manager
An object that is interested in an event
register
سؤال
Match between columns
The measurement between lines of text in a single-spaced text document
point size
The measurement between lines of text in a single-spaced text document
layout manager
The measurement between lines of text in a single-spaced text document
lightweight components
The measurement between lines of text in a single-spaced text document
window decorations
The measurement between lines of text in a single-spaced text document
editable
The measurement between lines of text in a single-spaced text document
look and feel
The measurement between lines of text in a single-spaced text document
heavyweight components
The measurement between lines of text in a single-spaced text document
fonts
The measurement between lines of text in a single-spaced text document
event handler
The measurement between lines of text in a single-spaced text document
container
The measurement between lines of text in a single-spaced text document
frame
The measurement between lines of text in a single-spaced text document
border layout manager
The measurement between lines of text in a single-spaced text document
listener
The measurement between lines of text in a single-spaced text document
flow layout manager
The measurement between lines of text in a single-spaced text document
register
سؤال
Match between columns
A window with a title bar and border
point size
A window with a title bar and border
layout manager
A window with a title bar and border
lightweight components
A window with a title bar and border
window decorations
A window with a title bar and border
editable
A window with a title bar and border
look and feel
A window with a title bar and border
heavyweight components
A window with a title bar and border
fonts
A window with a title bar and border
event handler
A window with a title bar and border
container
A window with a title bar and border
frame
A window with a title bar and border
border layout manager
A window with a title bar and border
listener
A window with a title bar and border
flow layout manager
A window with a title bar and border
register
سؤال
Match between columns
A class that controls component positioning
point size
A class that controls component positioning
layout manager
A class that controls component positioning
lightweight components
A class that controls component positioning
window decorations
A class that controls component positioning
editable
A class that controls component positioning
look and feel
A class that controls component positioning
heavyweight components
A class that controls component positioning
fonts
A class that controls component positioning
event handler
A class that controls component positioning
container
A class that controls component positioning
frame
A class that controls component positioning
border layout manager
A class that controls component positioning
listener
A class that controls component positioning
flow layout manager
A class that controls component positioning
register
سؤال
How are computer programs more user friendly when they contain GUI components? How does Java address GUI components?
سؤال
Match between columns
The design, style, and functionality of a user interface
point size
The design, style, and functionality of a user interface
layout manager
The design, style, and functionality of a user interface
lightweight components
The design, style, and functionality of a user interface
window decorations
The design, style, and functionality of a user interface
editable
The design, style, and functionality of a user interface
look and feel
The design, style, and functionality of a user interface
heavyweight components
The design, style, and functionality of a user interface
fonts
The design, style, and functionality of a user interface
event handler
The design, style, and functionality of a user interface
container
The design, style, and functionality of a user interface
frame
The design, style, and functionality of a user interface
border layout manager
The design, style, and functionality of a user interface
listener
The design, style, and functionality of a user interface
flow layout manager
The design, style, and functionality of a user interface
register
سؤال
Match between columns
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
point size
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
layout manager
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
lightweight components
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
window decorations
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
editable
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
look and feel
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
heavyweight components
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
fonts
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
event handler
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
container
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
frame
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
border layout manager
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
listener
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
flow layout manager
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
register
سؤال
Match between columns
A JTextField that has the capability of accepting keystrokes
point size
A JTextField that has the capability of accepting keystrokes
layout manager
A JTextField that has the capability of accepting keystrokes
lightweight components
A JTextField that has the capability of accepting keystrokes
window decorations
A JTextField that has the capability of accepting keystrokes
editable
A JTextField that has the capability of accepting keystrokes
look and feel
A JTextField that has the capability of accepting keystrokes
heavyweight components
A JTextField that has the capability of accepting keystrokes
fonts
A JTextField that has the capability of accepting keystrokes
event handler
A JTextField that has the capability of accepting keystrokes
container
A JTextField that has the capability of accepting keystrokes
frame
A JTextField that has the capability of accepting keystrokes
border layout manager
A JTextField that has the capability of accepting keystrokes
listener
A JTextField that has the capability of accepting keystrokes
flow layout manager
A JTextField that has the capability of accepting keystrokes
register
سؤال
Match between columns
A method that executes because it is called automatically when an appropriate event occurs
point size
A method that executes because it is called automatically when an appropriate event occurs
layout manager
A method that executes because it is called automatically when an appropriate event occurs
lightweight components
A method that executes because it is called automatically when an appropriate event occurs
window decorations
A method that executes because it is called automatically when an appropriate event occurs
editable
A method that executes because it is called automatically when an appropriate event occurs
look and feel
A method that executes because it is called automatically when an appropriate event occurs
heavyweight components
A method that executes because it is called automatically when an appropriate event occurs
fonts
A method that executes because it is called automatically when an appropriate event occurs
event handler
A method that executes because it is called automatically when an appropriate event occurs
container
A method that executes because it is called automatically when an appropriate event occurs
frame
A method that executes because it is called automatically when an appropriate event occurs
border layout manager
A method that executes because it is called automatically when an appropriate event occurs
listener
A method that executes because it is called automatically when an appropriate event occurs
flow layout manager
A method that executes because it is called automatically when an appropriate event occurs
register
سؤال
How can you customize the appearance of a JFrame ?
سؤال
Match between columns
Divides a container into regions
point size
Divides a container into regions
layout manager
Divides a container into regions
lightweight components
Divides a container into regions
window decorations
Divides a container into regions
editable
Divides a container into regions
look and feel
Divides a container into regions
heavyweight components
Divides a container into regions
fonts
Divides a container into regions
event handler
Divides a container into regions
container
Divides a container into regions
frame
Divides a container into regions
border layout manager
Divides a container into regions
listener
Divides a container into regions
flow layout manager
Divides a container into regions
register
سؤال
How do you change the text of a JLabel ? Provide an example.
سؤال
Match between columns
Arial, Century, Monospaced, and Times New Roman
point size
Arial, Century, Monospaced, and Times New Roman
layout manager
Arial, Century, Monospaced, and Times New Roman
lightweight components
Arial, Century, Monospaced, and Times New Roman
window decorations
Arial, Century, Monospaced, and Times New Roman
editable
Arial, Century, Monospaced, and Times New Roman
look and feel
Arial, Century, Monospaced, and Times New Roman
heavyweight components
Arial, Century, Monospaced, and Times New Roman
fonts
Arial, Century, Monospaced, and Times New Roman
event handler
Arial, Century, Monospaced, and Times New Roman
container
Arial, Century, Monospaced, and Times New Roman
frame
Arial, Century, Monospaced, and Times New Roman
border layout manager
Arial, Century, Monospaced, and Times New Roman
listener
Arial, Century, Monospaced, and Times New Roman
flow layout manager
Arial, Century, Monospaced, and Times New Roman
register
سؤال
Match between columns
Component that holds other components
point size
Component that holds other components
layout manager
Component that holds other components
lightweight components
Component that holds other components
window decorations
Component that holds other components
editable
Component that holds other components
look and feel
Component that holds other components
heavyweight components
Component that holds other components
fonts
Component that holds other components
event handler
Component that holds other components
container
Component that holds other components
frame
Component that holds other components
border layout manager
Component that holds other components
listener
Component that holds other components
flow layout manager
Component that holds other components
register
سؤال
Match between columns
Places components in rows
point size
Places components in rows
layout manager
Places components in rows
lightweight components
Places components in rows
window decorations
Places components in rows
editable
Places components in rows
look and feel
Places components in rows
heavyweight components
Places components in rows
fonts
Places components in rows
event handler
Places components in rows
container
Places components in rows
frame
Places components in rows
border layout manager
Places components in rows
listener
Places components in rows
flow layout manager
Places components in rows
register
سؤال
Create the statements to construct two JFrame s. One JFrame should be declared as welcomeFrame and have the title "Welcome", and the second JFrame should be declared as noTitleFrame and have no title.
سؤال
Assume you have declared a JFrame named welcomeFrame . Write the statement to set the welcomeFrame object's size to 300 pixels horizontally by 110 pixels vertically. Create a second statement to set the JFrame 's title to display the text "My Sized Frame".
سؤال
import javax.swing.*;
public class JFrame1
{
     public static void main(String[] args)
     {
         JFrame aFrame = new JFrame("First frame");
         aFrame.setSize(300, 125);
         aFrame.setVisible(true);
     }
}
Explain the purpose of each statement in the main() method above and why they are necessary for creating a JFrame .
سؤال
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?");
     -----Code here-----
     aFrame.add(greeting);
     aFrame.add(greeting2);
   }
}
Using the above code, write the FlowLayout statement in the indicated line that will display the two greeting JLabel s side by side.
سؤال
Write the statement to create a JButton named submitButton with the label "Submit your data".
سؤال
Write the statement to create a JLabel named welcome that holds the words "Welcome Home".
سؤال
Write the statement to create a layout manager named myLayout that centers components in each row.
سؤال
What are the tasks you must perform when you declare a class that handles an event?
سؤال
import javax.swing.*;
public class JFrameLook
{
    public static void main(String[] args)
    {
        ----Code here----
        JFrame myFrame = new JFrame("Look and Feel");
        myFrame.setSize(300, 120);
        myFrame.setVisible(true);
     }
}
In the indicated line above, write the statement to set the JFrame 's look and feel using the setDefaultLookAndFeelDecorated() method.
سؤال
Write the code to build a JComboBox named sideDish with no arguments. Then, create the addItem() methods to provide options for "Fries", "Salad", and "Fruit".
سؤال
Provide an example of an event-driven program.
سؤال
Write the statement to create a JCheckBox object named feeWaived that is selected. Include the label "Fee Waived".
سؤال
Describe a flow layout manager compared to a border layout manager.
سؤال
What are some of the decisions you must make when extending a JFrame ?
سؤال
Write the statement to provide a JTextField object named myInfo that allows enough room for a user to enter 15 characters.
سؤال
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);
       -----Code here-----
       -----Code here-----
     }
}
The above code shows an application in which a JFrame is created and its size, visibility, and close operation are set. In the indicated 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 .
سؤال
How do you modify whether or not a JTextField can be edited?
سؤال
Write the statement to clear out a JTextField named myText .
سؤال
import javax.swing.*;
import java.awt.*;
public class JFrame4
{
   public static void main(String[] args)
   {
      final int FRAME_WIDTH = 250;
      final int FRAME_HEIGHT = 100;
      -----Code here-----
      JFrame aFrame = new JFrame("Fourth frame");
      aFrame.setSize(FRAME_WIDTH, FRAME_HEIGHT);      
      aFrame.setVisible(true);
      aFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      JLabel greeting = new JLabel("Good day");
      -----Code here-----
      aFrame.add(greeting);
   }
}
In the first indicated line, write the statement to create a Font object named myLook with a typeface of Times New Roman, italic, and 30-point size. In the second indicated line, create the statement to apply myLook to the greeting JLabel .
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/79
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 14: Introduction to Swing Components
1
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);
D
2
Each Swing component is a descendant of a JComponent .
True
3
What class is the immediate parent of JFrame ?

A) Container
B) Component
C) Frame
D) Window
C
4
A ____ is a Component used to trigger an action or make a selection when the user clicks it.

A) JCheckBox
B) JButton
C) JLabel
D) JComboBox
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
5
You can use the setEnabled() method to make a component available or unavailable by passing true or false to it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
6
The Swing classes are part of a more general set of UI programming capabilities that are collectively called the ____.

A) JavaX Classes
B) Java Foundation Classes
C) UI packages
D) Java Extension Libraries
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
7
Which method do you use to assign a font object to a JLabel ?

A) setFont()
B) fontLabel()
C) assignFont()
D) JLabel.font()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
8
When a JFrame is closed, you can end a program that you have forgotten to exit by typing Alt+E.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
9
If a user enters more characters than specified in a JTextField , the extra characters are deleted.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
10
When setting a JFrame 's size, part of the area is unusable because it is consumed by the JFrame 's title bar and borders.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
11
You cannot change the font of strings displayed in GUI components.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
12
Which constructor constructs a new JTextField with the specified text and columns?

A) public JTextField(String text)
B) public JTextField(int columns, String text )
C) public JTextField(String text, int columns)
D) public JTextField(String text, int columns, int location)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
13
Java provides you with a Font class from which you can create an object that holds typeface and size information.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
14
An object that is interested in an event is called a source.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
15
Which method overrides the default behavior for the JFrame to be positioned in the upper-left corner of the computer screen's desktop?

A) setSize()
B) title()
C) setBounds()
D) isResizable()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
16
What is the default layout manager for JFrame ?

A) GridLayout
B) FlowLayout
C) FrameLayout
D) BorderLayout
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
17
The default behavior of a JFrame is to use the border layout format, which divides a container into regions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
18
When a user closes a JFrame by clicking the Close button in the upper-right corner, the default behavior is for the JFrame to close and the application to terminate.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
19
What is the immediate parent class of JTextField ?

A) JTextComponent
B) JComponent
C) Container
D) JFrame
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
20
You can call a JFrame 's setDefaultCloseOperation() method and use ____ as an argument to keep the JFrame visible and continue running the program.

A) JFrame.EXIT_ON_CLOSE
B) WindowConstants.DISPOSE_ON_CLOSE
C) WindowConstants.DO_NOTHING_ON_CLOSE
D) WindowConstants.HIDE_ON_CLOSE
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
21
When constructing a Font object, which of the following arguments is NOT required?

A) typeface
B) style
C) weight
D) point size
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
22
A component can be made available or unavailable by passing true or false to the ____ method.

A) getSource()
B) setEnabled()
C) setSelected()
D) setBounds()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
23
A ____ is a component that combines a button or an editable field and a drop-down list.

A) JCheckBox
B) JComboBox
C) JButton
D) JTextBox
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
24
Which of the following statements will change the value displayed in a JLabel named hello ?

A) hello.setText("Hello");
B) setText.hello = "Hello"
C) hello = setText("Hello");
D) setText = hello
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
25
Look and feel comprises the elements of design, style, and ____ in any user interface.

A) font faces
B) functionality
C) logistics
D) syntactic sugar
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
26
The ____ responds to keyboard events.

A) KeyListener
B) ActionListener
C) ChangeListener
D) FocusListener
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
27
The ____ layout manager places components in a row, and when a row is filled, it automatically spills components into the next row.

A) flow
B) border
C) grid
D) group
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
28
The ____ responds to keyboard focus events.

A) KeyListener
B) ActionListener
C) ChangeListener
D) FocusListener
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
29
The JButton , JCheckBox , JComboBox , and JRadioButton components are associated with the ____ method.

A) addAdjustmentListener()
B) addChangeListener()
C) addWindowListener()
D) addItemListener()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
30
Which method sets the state of the JCheckBox to true for selected or false for unselected?

A) isSelected
B) getSelected
C) setSelected
D) setState
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
31
The ____ method of JComboBox returns the maximum number of items the combo box can display without a scroll bar.

A) getSelectedItem()
B) getItemCount()
C) getMaximumRowCount()
D) getSelectedIndex()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
32
A method that executes because it is called automatically when an appropriate event occurs is an event ____.

A) responder
B) listener
C) handler
D) source
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
33
Within an implementation of the itemStateChanged() method, you can use the ____ method to determine which object generated the event, and the getStateChange() method to determine whether the event was a selection or a deselection.

A) getSource()
B) getEvent()
C) getItem()
D) getState()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
34
Which of the following statements will correctly set a JFrame named myFrame to be visible?

A) myFrame.Visible = True
B) myFrame.setVisible(true)
C) myFrame.Visibility.True
D) myFrame.true = Visible
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
35
Which method do you use to change the state of a JCheckBox ?

A) void setSelected(boolean)
B) boolean isSelected()
C) void setText(String)
D) String getText()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
36
A ____ consists of a label positioned beside a square; you can click the square to display or remove a check mark.

A) ButtonGroup
B) RadioButton
C) JComboBox
D) JCheckBox
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
37
Swing  components are UI elements such as dialog boxes and buttons. You can usually recognize their names because they begin with ____.

A) the letter S
B) Swing
C) the letter J
D) UI
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
38
When you create a(n) ____, you can group several components, such as JCheckBox es, so a user can select only one at a time.

A) CheckGroup
B) ButtonGroup
C) OptionBox
D) OptionGroup
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
39
The ActionListener interface contains the ____ method specification.

A) actionOccurred(Action e)
B) actionPerformed(ActionEvent e)
C) actionEvent(ActionEvent e)
D) action(Event e)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
40
Within an event-driven program, a component on which an event is generated is the ____ of the event.

A) handler
B) driver
C) listener
D) source
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
41
Match between columns
Are written completely in Java and do not have to rely on the local operating system code
point size
Are written completely in Java and do not have to rely on the local operating system code
layout manager
Are written completely in Java and do not have to rely on the local operating system code
lightweight components
Are written completely in Java and do not have to rely on the local operating system code
window decorations
Are written completely in Java and do not have to rely on the local operating system code
editable
Are written completely in Java and do not have to rely on the local operating system code
look and feel
Are written completely in Java and do not have to rely on the local operating system code
heavyweight components
Are written completely in Java and do not have to rely on the local operating system code
fonts
Are written completely in Java and do not have to rely on the local operating system code
event handler
Are written completely in Java and do not have to rely on the local operating system code
container
Are written completely in Java and do not have to rely on the local operating system code
frame
Are written completely in Java and do not have to rely on the local operating system code
border layout manager
Are written completely in Java and do not have to rely on the local operating system code
listener
Are written completely in Java and do not have to rely on the local operating system code
flow layout manager
Are written completely in Java and do not have to rely on the local operating system code
register
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
42
Match between columns
Require interaction with the local operating system
point size
Require interaction with the local operating system
layout manager
Require interaction with the local operating system
lightweight components
Require interaction with the local operating system
window decorations
Require interaction with the local operating system
editable
Require interaction with the local operating system
look and feel
Require interaction with the local operating system
heavyweight components
Require interaction with the local operating system
fonts
Require interaction with the local operating system
event handler
Require interaction with the local operating system
container
Require interaction with the local operating system
frame
Require interaction with the local operating system
border layout manager
Require interaction with the local operating system
listener
Require interaction with the local operating system
flow layout manager
Require interaction with the local operating system
register
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
43
How do you change the font of a JLabel ?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
44
Match between columns
Sign up an object as a listener
point size
Sign up an object as a listener
layout manager
Sign up an object as a listener
lightweight components
Sign up an object as a listener
window decorations
Sign up an object as a listener
editable
Sign up an object as a listener
look and feel
Sign up an object as a listener
heavyweight components
Sign up an object as a listener
fonts
Sign up an object as a listener
event handler
Sign up an object as a listener
container
Sign up an object as a listener
frame
Sign up an object as a listener
border layout manager
Sign up an object as a listener
listener
Sign up an object as a listener
flow layout manager
Sign up an object as a listener
register
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
45
What are the four JFrame constructors?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
46
Match between columns
An object that is interested in an event
point size
An object that is interested in an event
layout manager
An object that is interested in an event
lightweight components
An object that is interested in an event
window decorations
An object that is interested in an event
editable
An object that is interested in an event
look and feel
An object that is interested in an event
heavyweight components
An object that is interested in an event
fonts
An object that is interested in an event
event handler
An object that is interested in an event
container
An object that is interested in an event
frame
An object that is interested in an event
border layout manager
An object that is interested in an event
listener
An object that is interested in an event
flow layout manager
An object that is interested in an event
register
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
47
Match between columns
The measurement between lines of text in a single-spaced text document
point size
The measurement between lines of text in a single-spaced text document
layout manager
The measurement between lines of text in a single-spaced text document
lightweight components
The measurement between lines of text in a single-spaced text document
window decorations
The measurement between lines of text in a single-spaced text document
editable
The measurement between lines of text in a single-spaced text document
look and feel
The measurement between lines of text in a single-spaced text document
heavyweight components
The measurement between lines of text in a single-spaced text document
fonts
The measurement between lines of text in a single-spaced text document
event handler
The measurement between lines of text in a single-spaced text document
container
The measurement between lines of text in a single-spaced text document
frame
The measurement between lines of text in a single-spaced text document
border layout manager
The measurement between lines of text in a single-spaced text document
listener
The measurement between lines of text in a single-spaced text document
flow layout manager
The measurement between lines of text in a single-spaced text document
register
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
48
Match between columns
A window with a title bar and border
point size
A window with a title bar and border
layout manager
A window with a title bar and border
lightweight components
A window with a title bar and border
window decorations
A window with a title bar and border
editable
A window with a title bar and border
look and feel
A window with a title bar and border
heavyweight components
A window with a title bar and border
fonts
A window with a title bar and border
event handler
A window with a title bar and border
container
A window with a title bar and border
frame
A window with a title bar and border
border layout manager
A window with a title bar and border
listener
A window with a title bar and border
flow layout manager
A window with a title bar and border
register
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
49
Match between columns
A class that controls component positioning
point size
A class that controls component positioning
layout manager
A class that controls component positioning
lightweight components
A class that controls component positioning
window decorations
A class that controls component positioning
editable
A class that controls component positioning
look and feel
A class that controls component positioning
heavyweight components
A class that controls component positioning
fonts
A class that controls component positioning
event handler
A class that controls component positioning
container
A class that controls component positioning
frame
A class that controls component positioning
border layout manager
A class that controls component positioning
listener
A class that controls component positioning
flow layout manager
A class that controls component positioning
register
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
50
How are computer programs more user friendly when they contain GUI components? How does Java address GUI components?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
51
Match between columns
The design, style, and functionality of a user interface
point size
The design, style, and functionality of a user interface
layout manager
The design, style, and functionality of a user interface
lightweight components
The design, style, and functionality of a user interface
window decorations
The design, style, and functionality of a user interface
editable
The design, style, and functionality of a user interface
look and feel
The design, style, and functionality of a user interface
heavyweight components
The design, style, and functionality of a user interface
fonts
The design, style, and functionality of a user interface
event handler
The design, style, and functionality of a user interface
container
The design, style, and functionality of a user interface
frame
The design, style, and functionality of a user interface
border layout manager
The design, style, and functionality of a user interface
listener
The design, style, and functionality of a user interface
flow layout manager
The design, style, and functionality of a user interface
register
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
52
Match between columns
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
point size
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
layout manager
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
lightweight components
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
window decorations
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
editable
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
look and feel
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
heavyweight components
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
fonts
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
event handler
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
container
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
frame
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
border layout manager
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
listener
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
flow layout manager
A coffee-cup icon in the frame's title bar, and the Minimize, Restore, and Close buttons
register
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
53
Match between columns
A JTextField that has the capability of accepting keystrokes
point size
A JTextField that has the capability of accepting keystrokes
layout manager
A JTextField that has the capability of accepting keystrokes
lightweight components
A JTextField that has the capability of accepting keystrokes
window decorations
A JTextField that has the capability of accepting keystrokes
editable
A JTextField that has the capability of accepting keystrokes
look and feel
A JTextField that has the capability of accepting keystrokes
heavyweight components
A JTextField that has the capability of accepting keystrokes
fonts
A JTextField that has the capability of accepting keystrokes
event handler
A JTextField that has the capability of accepting keystrokes
container
A JTextField that has the capability of accepting keystrokes
frame
A JTextField that has the capability of accepting keystrokes
border layout manager
A JTextField that has the capability of accepting keystrokes
listener
A JTextField that has the capability of accepting keystrokes
flow layout manager
A JTextField that has the capability of accepting keystrokes
register
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
54
Match between columns
A method that executes because it is called automatically when an appropriate event occurs
point size
A method that executes because it is called automatically when an appropriate event occurs
layout manager
A method that executes because it is called automatically when an appropriate event occurs
lightweight components
A method that executes because it is called automatically when an appropriate event occurs
window decorations
A method that executes because it is called automatically when an appropriate event occurs
editable
A method that executes because it is called automatically when an appropriate event occurs
look and feel
A method that executes because it is called automatically when an appropriate event occurs
heavyweight components
A method that executes because it is called automatically when an appropriate event occurs
fonts
A method that executes because it is called automatically when an appropriate event occurs
event handler
A method that executes because it is called automatically when an appropriate event occurs
container
A method that executes because it is called automatically when an appropriate event occurs
frame
A method that executes because it is called automatically when an appropriate event occurs
border layout manager
A method that executes because it is called automatically when an appropriate event occurs
listener
A method that executes because it is called automatically when an appropriate event occurs
flow layout manager
A method that executes because it is called automatically when an appropriate event occurs
register
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
55
How can you customize the appearance of a JFrame ?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
56
Match between columns
Divides a container into regions
point size
Divides a container into regions
layout manager
Divides a container into regions
lightweight components
Divides a container into regions
window decorations
Divides a container into regions
editable
Divides a container into regions
look and feel
Divides a container into regions
heavyweight components
Divides a container into regions
fonts
Divides a container into regions
event handler
Divides a container into regions
container
Divides a container into regions
frame
Divides a container into regions
border layout manager
Divides a container into regions
listener
Divides a container into regions
flow layout manager
Divides a container into regions
register
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
57
How do you change the text of a JLabel ? Provide an example.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
58
Match between columns
Arial, Century, Monospaced, and Times New Roman
point size
Arial, Century, Monospaced, and Times New Roman
layout manager
Arial, Century, Monospaced, and Times New Roman
lightweight components
Arial, Century, Monospaced, and Times New Roman
window decorations
Arial, Century, Monospaced, and Times New Roman
editable
Arial, Century, Monospaced, and Times New Roman
look and feel
Arial, Century, Monospaced, and Times New Roman
heavyweight components
Arial, Century, Monospaced, and Times New Roman
fonts
Arial, Century, Monospaced, and Times New Roman
event handler
Arial, Century, Monospaced, and Times New Roman
container
Arial, Century, Monospaced, and Times New Roman
frame
Arial, Century, Monospaced, and Times New Roman
border layout manager
Arial, Century, Monospaced, and Times New Roman
listener
Arial, Century, Monospaced, and Times New Roman
flow layout manager
Arial, Century, Monospaced, and Times New Roman
register
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
59
Match between columns
Component that holds other components
point size
Component that holds other components
layout manager
Component that holds other components
lightweight components
Component that holds other components
window decorations
Component that holds other components
editable
Component that holds other components
look and feel
Component that holds other components
heavyweight components
Component that holds other components
fonts
Component that holds other components
event handler
Component that holds other components
container
Component that holds other components
frame
Component that holds other components
border layout manager
Component that holds other components
listener
Component that holds other components
flow layout manager
Component that holds other components
register
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
60
Match between columns
Places components in rows
point size
Places components in rows
layout manager
Places components in rows
lightweight components
Places components in rows
window decorations
Places components in rows
editable
Places components in rows
look and feel
Places components in rows
heavyweight components
Places components in rows
fonts
Places components in rows
event handler
Places components in rows
container
Places components in rows
frame
Places components in rows
border layout manager
Places components in rows
listener
Places components in rows
flow layout manager
Places components in rows
register
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
61
Create the statements to construct two JFrame s. One JFrame should be declared as welcomeFrame and have the title "Welcome", and the second JFrame should be declared as noTitleFrame and have no title.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
62
Assume you have declared a JFrame named welcomeFrame . Write the statement to set the welcomeFrame object's size to 300 pixels horizontally by 110 pixels vertically. Create a second statement to set the JFrame 's title to display the text "My Sized Frame".
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
63
import javax.swing.*;
public class JFrame1
{
     public static void main(String[] args)
     {
         JFrame aFrame = new JFrame("First frame");
         aFrame.setSize(300, 125);
         aFrame.setVisible(true);
     }
}
Explain the purpose of each statement in the main() method above and why they are necessary for creating a JFrame .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
64
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?");
     -----Code here-----
     aFrame.add(greeting);
     aFrame.add(greeting2);
   }
}
Using the above code, write the FlowLayout statement in the indicated line that will display the two greeting JLabel s side by side.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
65
Write the statement to create a JButton named submitButton with the label "Submit your data".
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
66
Write the statement to create a JLabel named welcome that holds the words "Welcome Home".
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
67
Write the statement to create a layout manager named myLayout that centers components in each row.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
68
What are the tasks you must perform when you declare a class that handles an event?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
69
import javax.swing.*;
public class JFrameLook
{
    public static void main(String[] args)
    {
        ----Code here----
        JFrame myFrame = new JFrame("Look and Feel");
        myFrame.setSize(300, 120);
        myFrame.setVisible(true);
     }
}
In the indicated line above, write the statement to set the JFrame 's look and feel using the setDefaultLookAndFeelDecorated() method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
70
Write the code to build a JComboBox named sideDish with no arguments. Then, create the addItem() methods to provide options for "Fries", "Salad", and "Fruit".
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
71
Provide an example of an event-driven program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
72
Write the statement to create a JCheckBox object named feeWaived that is selected. Include the label "Fee Waived".
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
73
Describe a flow layout manager compared to a border layout manager.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
74
What are some of the decisions you must make when extending a JFrame ?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
75
Write the statement to provide a JTextField object named myInfo that allows enough room for a user to enter 15 characters.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
76
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);
       -----Code here-----
       -----Code here-----
     }
}
The above code shows an application in which a JFrame is created and its size, visibility, and close operation are set. In the indicated 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 .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
77
How do you modify whether or not a JTextField can be edited?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
78
Write the statement to clear out a JTextField named myText .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
79
import javax.swing.*;
import java.awt.*;
public class JFrame4
{
   public static void main(String[] args)
   {
      final int FRAME_WIDTH = 250;
      final int FRAME_HEIGHT = 100;
      -----Code here-----
      JFrame aFrame = new JFrame("Fourth frame");
      aFrame.setSize(FRAME_WIDTH, FRAME_HEIGHT);      
      aFrame.setVisible(true);
      aFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      JLabel greeting = new JLabel("Good day");
      -----Code here-----
      aFrame.add(greeting);
   }
}
In the first indicated line, write the statement to create a Font object named myLook with a typeface of Times New Roman, italic, and 30-point size. In the second indicated line, create the statement to apply myLook to the greeting JLabel .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 79 في هذه المجموعة.