Question

In: Computer Science

Part 1 Write a program that displays a frame containing two labels that display your name,...

Part 1 Write a program that displays a frame containing two labels that display your name, one for your first name and one for your last. Experiment with the size of the window to see the labels change their orientation to each other. USE FIRST NAME: Aya LAST NAME: KAYED. SEND THE CODE IN THE EXACT FORMAT FOR JAVA ECLIPSE. I WILL COPY AND PASTE THE CODE SO I CAN RUN IT. Part 2 Propose and solve your own digital design problem.

Solutions

Expert Solution

Q1.

In the ActionListener event of Button write the following code-

jLabel1.setText("AYA");
jLabel2.setText("KAYED");

Q2. let a problem be of a shopping list-

  • the user selects the item that he considers for buying.
  • he selects them using the checkbox.
  • after completion of selection final bill amount is displayed in the textfield.

CODE :

write it in actionevent listener of the button

int price=0;
if(jCheckBox1.isSelected()){
price=price+10;
}
if(jCheckBox2.isSelected()){
price=price+15;
}
if(jCheckBox3.isSelected()){
price=price+30;
}
  
jTextField1.setText(""+price);
}


Related Solutions

Write an assembly program that displays the following two options: 1. Display the current date. 2....
Write an assembly program that displays the following two options: 1. Display the current date. 2. Enter a date for a meeting and display remaining days. If the user selects the first option, the program should display the current date in dd/mm/yyyy format. If the user selects the second option, the program asks the user to enter a date for a meeting within year 2020 (in decimal) in dd/mm format. The program then calculates and displays the number of days...
ACTIVITY #1: Defining Strings √ Write an assembly program that display your name, your id, and...
ACTIVITY #1: Defining Strings √ Write an assembly program that display your name, your id, and your college name on the screen. √ Remember: the format of the assembly program should be like this. TITLE your title (FileName.asm) .MODEL FLAT .386 .STACK 64 .DATA str1 DB "My name: Essam Alnatsheh",13,10,'$' .CODE main PROC mov ax,@data mov ds,ax mov ah,09h mov dx, offset str1 int 21h ​mov ah,4Ch​​ ; terminate process ​mov al,0​​ ; return code ​int 21h main ENDP END...
Using c++, write a program that will display your name as a void function then will...
Using c++, write a program that will display your name as a void function then will perform the following by user-defined functions: a. to compute for the sum of two numbers (n1, n2) using function.
Write a C++ program to display toy name
Write a C++ program to display toy name
Description: Write and test a MASM program to perform the following tasks: 1. Display your name...
Description: Write and test a MASM program to perform the following tasks: 1. Display your name and program title on the output screen. 2. Display instructions for the user. 3. Prompt the user to enter two numbers. 4. Calculate the sum, difference, product, (integer) quotient and remainder of the numbers. 5. Display a terminating message. Requirements: 1. The main procedure must be divided into sections:  introduction  get the data  calculate the required values  display the results...
Using python Write a program that displays all of states in the U.S. and display each...
Using python Write a program that displays all of states in the U.S. and display each state that begins with the letter A.
(Display a Circle and Its Attributes) Write a program that displays a circle of random size...
(Display a Circle and Its Attributes) Write a program that displays a circle of random size and calculates and displays the area, radius, diameter and circumference. Use the following equations: diameter = 2 × radius, area = π × radius2, circumference = 2 × π × radius. Use the constant Math.PI for pi (π). All drawing should be done on a subclass of JPanel, and the results of the calculations should be displayed in a read-only JTextArea.
Part 1:Write a program in Java that declares an array of 5 elements and displays the...
Part 1:Write a program in Java that declares an array of 5 elements and displays the contents of the array. Your program should attempt to access the 6th element in the array (which does not exist) and using try. catch your program should prevent the run-time error and display your error message to the user. The sample output including the error message is provided below. Part (1) Printing an element out of bounds 5 7 11 3 0 You went...
Write a JavaFX application that displays a Label containing the opening sentence or two from your...
Write a JavaFX application that displays a Label containing the opening sentence or two from your favorite book. Save the project as FXBookQuote1a. Add a button to the frame in the FXBookQuote program. When the user clicks the button, display the title of the book that contains the quote in a second label. Save the project as FXBookQuote1b // FXBookQuote1a.java import javafx.application.Application; import static javafx.application.Application.launch; import javafx.geometry.Insets; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.layout.Pane; import javafx.scene.text.Font; import javafx.stage.Stage; public class FXBookQuote1a...
PYTHON program that: Asks for a name, and then displays "Welcome student" plus your name on...
PYTHON program that: Asks for a name, and then displays "Welcome student" plus your name on the screen. (concatenate your name after the string) and prompts the user for 2 numbers, then calculates and displays the sum, product and average.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT