Question

in java make a frame and a panel that show your full name at each corner...

in java

make a frame and a panel that show your full name at each corner of the frame. Let the names be (MyNamePanel, MyNameFrame) and choose whatever formats you want.

my name is (lamaa khaled)

Homework Answers

Answer #1

Steps:

1. Create a frame using JFrame and assign the name here.

(Import the headerfile to use JFrame)

2. Create a panel using JPanel

(Import the headerfile to use JPanel)

3. Add the frame to the panel

4. Set the size of the frame using the setSize method.

5. Add the close icon to the frame, which closes the frame when clicked

6. Finally, set the visibilty to true

Code:

import javax.swing.JFrame;
import javax.swing.JPanel;

public class Frame extends JFrame{

        public static void main(String[] args) {

        //Create a frame and assign the name here
                JFrame frame = new JFrame("Lamaa Khaled");

        //Create a Panel using JPanel
                JPanel panel = new JPanel();

        //Add the panel into the frame
                frame.add(panel);

        //Set the size of the frame using the setSize(width, height)
                frame.setSize(300, 300);

        //Add the close icon to the frame, which closes the frame when clicked
                frame.setDefaultCloseOperation(EXIT_ON_CLOSE);

        //Set the visibility to true
                frame.setVisible(true);

        }

}
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
The following data counts the number of letters in a person’s full name, including middle initials....
The following data counts the number of letters in a person’s full name, including middle initials. For example, my full name is “Lily Y Lum”, so my name has 8 letters (length is 8). I have surveyed 11 CCSF students. Include your own name to make a dataset having 12 values. Write your full name: __________________ Length (number of letters): ________ 15, 22, 17, 9, 11, 16, 18, 13, 25, 17, 24, __length of your name__ (a). Construct the 97%...
Write the following problem in Java Create a class Dog, add name, breed, age, color as...
Write the following problem in Java Create a class Dog, add name, breed, age, color as the attributes. You need to choose the right types for those attributes. Create a constructor that requires no arguments. In this constructor, initialize name, breed, age, and color as you wish. Define a getter and a setter for each attribute. Define a method toString to return a String type, the returned string should have this information: “Hi, my name is Lucky. I am a...
Objective: Write a Java program that will use a JComboBox from which the user will select...
Objective: Write a Java program that will use a JComboBox from which the user will select to convert a temperature from either Celsius to Fahrenheit, or Fahrenheit to Celsius. The user will enter a temperature in a text field from which the conversion calculation will be made. The converted temperature will be displayed in an uneditable text field with an appropriate label. Specifications Structure your file name and class name on the following pattern: The first three letters of your...
use CSS, java and HTML to make a charity admin page. It's a web page after...
use CSS, java and HTML to make a charity admin page. It's a web page after you log in to your account. I can have personal information, the amount of money donated, the children who have received charity, and some blogs. In fact, all the things are what I want. But you are free to do whatever You like, even if you don't say what I say. I just need a charity Admin page for charity User.Don't ask me for...
USE THE NAME: FRANK. If you write down your full name on a piece of paper,...
USE THE NAME: FRANK. If you write down your full name on a piece of paper, and rip apart each letter and throw the pieces into a hat. (a) You draw 5 letters, with replacement. What is the probability that you draw three or more consonants? (b) You draw 10 letters, with replacement. What is the probability that you draw at least two vowels? (c) You begin to draw letters indefinitely, with replacement. What is the probability that you draw...
Start the price at the number of letters in your first and last names combined for...
Start the price at the number of letters in your first and last names combined for Q = 1, and then reduce the price as Q increases. ( My First name letters are 6 and the last name letters are 8 ) For costs, begin with TC = 6 at Q = 1, then you may use any numbers you like for costs. You may need to play around with the numbers to make this work out. Show that MR...
Please make a Java program that has a menu method and includes dialog boxes. The program...
Please make a Java program that has a menu method and includes dialog boxes. The program will call the proper method, but each method will be completed later. Your program will keep track of information for a Hospital. The program will be menu-driven. Your menu is to look something like the following: UPMC Medical Center Add/Modify Patient Information Add/Modify Physician Information Add/Modify Medical Information Hospital Report Section Exit the Medical System Please Make your selection > In this first phase,...
JAVA (Don't make it too complicated) Write a program that prompts the user for the name...
JAVA (Don't make it too complicated) Write a program that prompts the user for the name of a text file. The file should consist of a sequence of integers, one integer per line. The program will read in each line (using nextLine()), parse it as an int (using Integer.parseInt()), and report the number of values and their average. The average should be computed as a double. Your program should do some basic exception handling: (1) If the file cannot be...
USE CALCULATOR AND SHOW FULL STEPS FOR EACH TEST INCLUDING WHAT YOU INPUT Below are random...
USE CALCULATOR AND SHOW FULL STEPS FOR EACH TEST INCLUDING WHAT YOU INPUT Below are random samples of enrollments for medical schools that specialize in research and for those that specialize in primary care. Is there a difference in the average enrollment for the two specializations? Use a significance level of a = 0.05. a) Give the name of the hypothesis test that would be appropriate for this situation. (1 point) b) State the hypotheses in symbols. (2 points) c)...
Free​ Response: You must show your work in order to get full credit. Put work in...
Free​ Response: You must show your work in order to get full credit. Put work in the SHOW MY WORK tab. The rate of defects among CD players of a certain brand is 17 defects per 1000 CD players. A store received 580 CD players. Answer the following​ questions: a. What is the expected number of defected CD​ players? (Round to 2 decimal​ place)       b. What is the probability that among 580 such CD players received by a​ store, there...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT