The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Would anyone be able to assist?
Example 1:
// 1. What are the following import statements for?
// 2. Why do we need each one?
import javax.swing.*; // Why do we need this?
import java.awt.*; // Why do we need this?
import java.awt.event.*; // Why do we need this?
import java.util.*; // Why do we need this?
import java.math.*; // Why do we need this?
Example 2:
// Test field
// 1. What is a JLabel?
// 2. How do you create a JLabel?
// 3. What does “SwingConstants.RIGHT” mean?
t1L = new JLabel("Test score 1: ", SwingConstants.RIGHT);
t2L = new JLabel("Test score 2: ", SwingConstants.RIGHT);
t3L = new JLabel("Test score 3: ", SwingConstants.RIGHT);
t4L = new JLabel("Test score 4: ", SwingConstants.RIGHT);
Example 3:
// Text field
// 1. What is a JTextField?
// 2. How do you create a JTextField?
// 3. What does “setHorizontalAlignment(JTextField.CENTER);” mean?
t1TF = new JTextField(“0”, 5);
t1TF.setHorizontalAlignment(JTextField.CENTER);
t2TF = new JTextField(“0”, 5);
t2TF.setHorizontalAlignment(JTextField.CENTER);
t3TF = new JTextField(“0”, 5);
t3TF.setHorizontalAlignment(JTextField.CENTER);
t4TF = new JTextField(“0”, 5);
t4TF.setHorizontalAlignment(JTextField.CENTER);
Example 4:
// Calc button.
// 1. What is a JButton?
// 2. How do you create a JButton?
// 3. What is a CalculateButtonHandler()?
// 4. How do you create a CalculateButtonHandler()?
// 5. What is an ActionListener? Where is it in our textbook?
calculateB = new JButton("Calculate");
cbHandler = new CalculateButtonHandler();
calculateB.addActionListener(cbHandler);
-----------