Design and code a garden design application in Java. It should graphically display a ‘garden’ in a JFrame window.
• The ‘garden’ is contained in a JFrame. It should contain other components for graphics, painting etc.
• It can have a blank background, or pretty grass/a texture.
• It will contain 4 flowerbeds. Flowerbeds display rows of flowers. They can be all the same
• It is possible to achieve a maximum of 80% without displaying flowers in
patterns (ie plain beds with only one type of flower per bed).

Answers

Answer 1

JFrame extends java.awt.Frame class which extends java.awt.Window class. It is a top-level container that contains components like buttons, labels, panels, and so on.

Swing components are available on any platforms. Swing controls such as JButton, JTextArea, and JLabel can be dragged and dropped onto the container with a mouse click. The following code will display a garden design application in Java. It graphically displays a ‘garden’ in a JFrame window.

Here is the code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class GardenDesign extends JFrame implements ActionListener {
   private static final long serialVersionUID = 1L;
   private JPanel contentPane;
   private JButton exitButton;
   private JButton drawFlowerBedButton;
   public GardenDesign() {
       setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
       setBounds(100, 100, 500, 500);
       contentPane = new JPanel();
       contentPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
       contentPane.setLayout(new BorderLayout(0, 0));
       setContentPane(contentPane);
       JPanel buttonPanel = new JPanel();
       contentPane.add(buttonPanel, BorderLayout.NORTH);
       drawFlowerBedButton = new JButton("Draw Flowerbed");
       drawFlowerBedButton.addActionListener(this);
       buttonPanel.add(drawFlowerBedButton);
       exitButton = new JButton("Exit");
       exitButton.addActionListener(this);
       buttonPanel.add(exitButton);
   }
   public void actionPerformed(ActionEvent e) {
       if (e.getSource() == exitButton) {
           System.exit(0);
       }
       if (e.getSource() == drawFlowerBedButton) {
           Graphics g = getGraphics();
           g.setColor(Color.blue);
           g.drawRect(50, 50, 300, 300);
           int rows = 5;
           int cols = 5;
           int x = 50;
           int y = 50;
           int width = 300 / cols;
           int height = 300 / rows;
           for (int i = 0; i < rows; i++) {
               for (int j = 0; j < cols; j++) {
                   g.drawRect(x + j * width, y + i * height, width, height);
               }
           }
       }
   }
   public static void main(String[] args) {
       GardenDesign frame = new GardenDesign();
       frame.setVisible(true);
   }
}
Learn more about JFrame visit:

https://brainly.com/question/30471304

#SPJ11


Related Questions

which meaning does the abbreviation c/c represent?

Answers

The phrase "carbon copy" alludes to the message's recipient whose location appears after Cc: header.

What does CC stand for?

Carbon copies: To let the recipients of a business letter know who else received it, a cc designation would be placed at the bottom of the letter, followed by the names of those who received carbon copies of the original. The term "cc" in emails refers to the additional recipients who received the message.

A typical email will have a "To" box, a "CC" field, and only a "BCC" section that allows you to enter email addresses. The abbreviation for carbon copy is CC. "Blind carbon copy" is what BCC stands for. The abbreviation BCC stands in blind carbon copy, while Cc stands for carbon copy. When copying someone's email, use Cc for copy them openly or Bcc to copy them secretly.

To learn more about carbon copy refer to :
brainly.com/question/11513369
#SPJ4

I am getting two expected errors on this code for the bottom two “public static void” lines. Can someone tell me how I can fix it? Thanks

I am getting two expected errors on this code for the bottom two public static void lines. Can someone

Answers

Answer:

Declare variable b in both lines

i.e. int b

Explanation:

In the given code, the parameters of both functions were not properly declared.

When listing the parameters, the data type must be clearly stated for all parameters (individually)

In the declaration of both functions, only variable a is declared as integer while b is undeclared.

So, the correction is to declare b as integer

i should down-edit my email replies by

Answers

Answer:

Removing everything not necessary to the ongoing conversation.

Explanation:

Down-editing your email by removing everything except the content that is necessary to the ongoing conversation, and then responding point-by-point, helps to maintain clarity in your ongoing conversations.

You're welcome, make sure to follow me! <3

The option to send a publication in an e-mail is available in the _____ tab.

File
Home
View
Review

Answers

Answer:

File

Explanation:

what are the two major problems with the benchmark technique of measuring algorithm efficiency?

Answers

The two major problems with the benchmark technique of measuring algorithm efficiency are the dependency on specific hardware or software configurations and the lack of representation of real-world scenarios.

The benchmark technique for measuring algorithm efficiency can be problematic due to its reliance on specific hardware or software configurations. Different systems may have varying performance characteristics, making it challenging to compare algorithms accurately across different platforms. Additionally, the benchmark technique often fails to capture real-world scenarios and may not reflect the complexity and diversity of actual usage. This can lead to misleading results and inaccurate assessments of algorithm efficiency.

You can learn more about benchmark technique at

https://brainly.com/question/29589116

#SPJ11

Java Coding help please this is from a beginner's class(I AM DESPERATE)
The info is added in the picture

Java Coding help please this is from a beginner's class(I AM DESPERATE)The info is added in the picture

Answers

Answer:

import java.io.File;

import java.io.FileNotFoundException;

import java.util.*;

class Main {

 public static void main(String[] args) {

 try {

  Scanner scanner = new Scanner(new File("scores.txt"));

     int nrAthletes = scanner.nextInt();

     ArrayList<String> athletes = new ArrayList<String>();

     int winnerIndex = 0;

     Double highestAverage = 0.0;

     

  for(int i=0; i<nrAthletes; i++) {

       // Get the name of the athlete as the first item

       String athleteName = scanner.next();

       athletes.add(athleteName);

       

       // Start collecting scores

       ArrayList<Double> scores = new ArrayList<Double>();        

       while(scanner.hasNextDouble()) {

         scores.add(scanner.nextDouble());

       }

       

       // Remove lowest and highest

       scores.remove(Collections.min(scores));

       scores.remove(Collections.max(scores));

       

       // Calculate average

       double sum = 0.0;

       for(double score: scores) {

         sum += score;

       }

       Double averageScore = sum / scores.size();

       // Keep track of winner

       if (averageScore >= highestAverage) {

         highestAverage = averageScore;

         winnerIndex = i;

       }

       

       // Output to screen

      System.out.printf("%s %.2f\n", athleteName, averageScore );

  }

     // Output winner

     System.out.printf("Winner: %s\n", athletes.get(winnerIndex) );

  scanner.close();

 } catch (FileNotFoundException e) {

  e.printStackTrace();

 }

 }

}

Explanation:

Of course this code lacks error handling, but it shows an approach using the scanner object and array lists.

How much do high-end earners make as power plant operators? Type answer as numerical number.

Answers

Answer:

$78,430

Explanation:

The yearly salary of power plant operaters varies depending on the type of industry that they are working for. The highest paying industry for power plant operators would be the natural gas distribution companies. Individuals in this position are making $78,430 a year as of 2020. The second highest paid position would be working in the Scientific research operations industry as a power plant operator which are making roughly $74,000 a year.

what does the U in fun stand for?​

Answers

Answer:

You and me

Explanation:

F is for friend and N is for anytime and anywhere

What network setting defines the network device that routes packets intended for hosts on remote networks?A. Default routerB. NetmaskC. Host nameD. IP addressE. DNS server

Answers

The default router setting in network configurations specifies the network device responsible for routing packets to hosts on remote networks, ensuring proper communication between different networks. Therefore, option A is correct.

Default router refers to a crucial network setting that determines the network device responsible for directing packets to their intended destinations on remote networks.

Also known as the default gateway or default gateway router, it serves as the entry point for network traffic that needs to be routed outside of the local network.

The default router setting ensures that data from a host on one network is correctly forwarded to a host on another network by identifying the appropriate path to take.

It plays a pivotal role in enabling connectivity and efficient data transmission between networks in a network infrastructure.

Learn more about remote network here:

https://brainly.com/question/32406198

#SPJ4

In HTML, an opening tag and its closing tag must appear on the same line. True Or False​

Answers

Answer:

the answer is true, you cannot break the element apart EVERR!!!!!

In a DTP project, Fiona is looking for a way to make a page layout attractive to readers. Help Fiona pick the correct word to complete the sentence.
You’ll need a(n) _____ to capture the attention of your audience. It can be an illustration, a photograph, a block of bold text, or a quote in a column of white space.

Answers

You’ll need a(n)  a block of bold text to capture the attention of your audience.

How do you make text bold in pages?

First one need to select Format  and then Font and then Bold.

Note that  by bolding a selected text, it can capture the mind of the people to the page layout.

Hence, You’ll need a(n)  a block of bold text to capture the attention of your audience.

Learn more about  page layout  from

https://brainly.com/question/12129748

#SPJ1

Make up a python program that can do the following
Write a program to ask the user to input the number of hours a person has worked in a week and the pay rate per hour.​

Answers

Answer:

hrs=input("Enter Hour:")

rate=input("Eenter Rate per Hour:")

pay=float(hrs)*float(rate)

print("Pay:", pay)

Explanation:

A PIN is easier for the account owner to use and remember because it is shorter than a password. However, a PIN can only be used once. However, it is also easier for hackers to steal. However, a password can safely be stored. However, it is more difficult for hackers to steal.

Answers

Answer:

Pin

Explanation:

Pin number works for me.

Type the correct answer in the box. What is the output of the formula =NOT(12+12=24)? The output of the formula =NOT(12+12=24) is .

Answers

Answer:

In a programming language, the formula is that it is printing out whatever equation is NOT 12+12. This would mean it's printing out any other number than 24, or 12.

Explanation:

I hope this helps

In programming, a ‘class’ is often described as a ‘blueprint’ (such as for a house). Explain what this could mean to someone.

Answers

A class is a basic concept deeply rooted in programming, serving as a template for establishing objects.

In programming, a ‘class’ is often described as a ‘blueprint’. The meaning

This prototype is akin to a blue-print; much like this tangible architecture guide provides a basis for constructing physical households, classes present the frame and structure for generating digital entities.

To differentiate them from one another, classes commonly house various factors which are known as properties or attributes that establish a distinction among any features of the newly spawned objects.

Read more on programming here:https://brainly.com/question/23275071

#SPJ1

In what ways is the information provided by a line-item budget useful to the following:
Program manager
Department head
Central budget office
Elected officials
Citizens
How would one substantially address how this information is useful to each entity listed above.

Answers

A line-item budget provides useful information to program managers, department heads, central budget offices, elected officials, and citizens by offering a detailed breakdown of expenses, facilitating accountability, and enabling informed decision-making.

A line-item budget is a financial document that outlines specific expenditure categories and allocated amounts. It is useful to program managers as it allows them to track expenses and ensure that funds are allocated appropriately for their respective programs.

By providing a detailed breakdown of expenses, program managers can effectively manage their budgets, identify areas of overspending or underspending, and make necessary adjustments to optimize resource allocation.

For department heads, the information provided by a line-item budget is essential for monitoring and controlling departmental expenditures. It enables them to assess the financial health of their departments, identify cost-saving opportunities, and ensure compliance with budgetary guidelines.

With this information, department heads can make informed decisions regarding resource allocation, staffing, and program priorities.

Central budget offices rely on line-item budgets to consolidate and analyze financial data from various departments or programs. This information helps them establish a comprehensive overview of the organization's finances, identify trends, and develop long-term financial strategies.

Line-item budgets enable central budget offices to allocate funds strategically, align spending with organizational goals, and ensure efficient use of resources.

Elected officials, such as members of a legislative body or governing board, benefit from line-item budgets as they provide transparency and accountability. By reviewing the detailed breakdown of expenditures, elected officials can assess the effectiveness and efficiency of government programs or organizational initiatives. This information enables them to make informed decisions during budgetary discussions, prioritize funding for critical areas, and hold program managers and department heads accountable for their financial management.

Citizens also find value in the information provided by line-item budgets. It promotes transparency and allows them to understand how public funds are allocated and spent. By having access to a detailed breakdown of expenses, citizens can assess the priorities of their government or organization, hold elected officials accountable for budgetary decisions, and actively participate in discussions regarding resource allocation.

Overall, a line-item budget serves as a valuable tool for program managers, department heads, central budget offices, elected officials, and citizens. It offers a detailed breakdown of expenses, facilitates accountability, and enables informed decision-making, ultimately contributing to efficient resource allocation and effective financial management.

Learn more about line-item budget

brainly.com/question/32249432
#SPJ11

feasibility and effectiveness of an asthma/copd service for primary care: a cross-sectional baseline description and longitudinal results

Answers

The phrase "feasibility and effectiveness of an asthma/COPD service for primary care: a cross-sectional baseline description and longitudinal results".


Feasibility refers to whether the program can be realistically implemented and sustained in real-world conditions. In this context, it assesses whether the asthma/COPD service is practical, cost-effective, and can be efficiently integrated into primary care settings.

Effectiveness, on the other hand, examines how well the program achieves its intended goals. It measures the impact of the asthma/COPD service on patient outcomes, such as reducing symptoms, improving lung function, and enhancing quality of life.

The phrase "cross-sectional baseline description" suggests that the study provides an initial snapshot or overview of the program at a specific point in time.

The phrase "longitudinal results" indicates that the study also tracks the program's progress over time. It examines how the asthma/COPD service evolves, any modifications made, and how patient outcomes change over an extended period.

Longitudinal results provide a more comprehensive understanding of the program's effectiveness and sustainability.

To summarize, the phrase "feasibility and effectiveness of an asthma/COPD service for primary care: a cross-sectional baseline description and longitudinal results" refers to a study that investigates the practicality, success, and long-term outcomes of a healthcare program for managing asthma and COPD in primary care settings.

To know more about the word patient outcomes, visit:

https://brainly.com/question/17333646

#SPJ11

The correct question is,

Feasibility and effectiveness of an Asthma/COPD service for primary care: A cross-sectional baseline description and longitudinal results.

PLZ HELP 100 points!!!! 1. Imagine you are a screenplay writer. Discuss some possible activities or techniques you
could use to improve your character creation and development
2 Do you think it's possible for an entire film to be shot using only one camera angle?
Explain why or why not and how this might impact the film
3. The unit says that in film you must show, not tell. Is this always true? When might it be
better to tell rather than show? Explain
4. You learned that lighting can play an important role in films and animation but is the
same true of your everyday life? How does lighting impact your daily life, and how do you
use it to improve change your surroundings?
5. After becoming more familiar with the various roles that people play when making an
animated film - such as writer artist director assistant director lighting sound etc. –
which do you think that you would enjoy most and why? Which do you think would be the
most difficult and why? Explain your answers.

Answers

Answer:

One angle

Explanation:

I have seen several scripts with various directions such as "Close on" "from another angle", etc. And other scripts without such notations. I have seen conflicting comments concerning this practice---Some producers I have contacted say they want this IN the "finished script" they get and others, feel, like I do, that camera angles and lighting and such are up to the director in the production phase. I have also read that Spec Scripts do not have such notations. So what should I include or not, in this respect, in a Spec Script.

what construction work is the tender for​

Answers

Answer:

A tender is a submission made by a prospective supplier in response to an invitation to tender. It makes an offer for the supply of goods or services. In construction, the main tender process is generally for the selection of the contractor that will construct the works.

Explanation:

government construction projects.


Tendering Process under construction is a process of submitting a proposal to undertake government construction projects. Depending on the language in the bid proposal the construction companies make their bids for submission, and if accepted, a legally enforceable contract is created.23 Mar 2017

what is the main purpose of the circulatory system

Answers

The network of blood vessels and the heart that carries blood throughout the body. This system helps tissues get the right amount of nutrients, oxygen, and waste disposal.

The most important component of the circulatory system?

The primary function of the circulatory system is to carry oxygen, nutrients, and hormones to the muscles, tissues, and organs throughout the body. Another role of the circulatory system is to remove waste from cells and organs so that your body can eliminate it.

What is the primary goal of this quiz about the circulatory system?

The circulatory system's job is to provide nutrients and oxygen to body cells while returning carbon dioxide and oxygen-poor blood to the heart and lungs.

To know more about circulatory system visit:-

https://brainly.com/question/29259710

#SPJ4

1. what is the internet infrastructure stack? what is the relevance of this technological concept to marketers? what is the significance of cloud computing in relationship to the internet infrastructure? who is the leader in cloud computing for third parties by revenue, cisco, ibm, , or amazon?

Answers

The correct answer is Internet infrastructure stack are sets of hardware and services combined together which helps in making the data and information available on the web page.

Any hardware component that is housed inside a computer. a set of guidelines or software that instructs a computer on what to do or how to carry out a certain task (computer software runs on hardware). a computer application that gives users the resources they need to do a certain task. any hardware component that is housed inside a computer. a set of guidelines or software that instructs a computer on what to do or how to carry out a certain task (computer software runs on hardware). a computer application that gives users the resources they need to do a certain task.

To learn more about hardware  click on the link below:

brainly.com/question/15232088

#SPJ4

the best answer it requests services, data and other resources available on the server​

Answers

Answer:

Explanation:

?

The programmers on mythic quest are knowledge workers. a. Trueb. False

Answers

The statement "The programmers on Mythic Quest are knowledge workers" is a. True.

The programmers on Mythic Quest, a TV show set in a video game development studio, are portrayed as knowledge workers. Knowledge workers are individuals who primarily use their intellect, expertise, and creativity to perform tasks that involve analyzing, synthesizing, and creating information, often using technology and specialized knowledge in their fields. Programmers typically fall under the category of knowledge workers as they use their technical skills, problem-solving abilities, and domain knowledge to develop software applications and systems. In the context of the TV show Mythic Quest, the programmers are shown engaging in programming and software development activities, which align with the characteristics of knowledge workers.

Learn more about programmers: https://brainly.com/question/23275071

#SPJ11

Object-Oriented Analysis can be characterized by which of the following Selected Answer, Do the right thing Selected Answer, Emphasizes finding and describing the objects (or concepts) in the problem domain Selected Answer, An investigation of the problem (rather than how a solution is defined) Selected Answer, Defining software objects and how they collaborate to fulfill the requirements Answer, Designs are implemented in a programming language Selected Answer, Emphasizes a conceptual solution that fulfills the requirements Answer, Do the thing right

Answers

Answer:

Selected Answer, Emphasizes finding and describing the objects (or concepts) in the problem domain Selected Answer,

Explanation:

Please answer these questions! Will mark Brainliest!!

Please answer these questions! Will mark Brainliest!!

Answers

Answer:

1) bob behnken and doug hurley

2)yes

3) august

plssss helppp meee with itt

plssss helppp meee with itt

Answers

..................................d

Which of the following repetition operator can help initialize an empty list with values.

A. &
B. $
C. *
D. !

Answers

Answer:

C. *

Explanation:

For instance, [10]*4 gives [10, 10, 10, 10].

true false 1. Data and information are NOT interchangeable terms. 2. The operating system is a type of application software. 3. The Ethernet port is an example of a connectivity port. 4. A typical CPU can complete billions of machine cycles in one second

Answers

Although the words "data" and "information" are sometimes used interchangeably, they are not the same thing. These elements' functions and subtle distinctions between them.

What is the main difference between information and data?

Data and information differ primarily in that material is made up of unprocessed, raw facts and statistics, whilst information is made up of processed, distilled data that may be used by decision-makers.

What aspect of a computer's operation transforms data into information?

Electronic circuits that understand and carry out program instructions as well as communicate with input, output, and storage devices make up the central processor unit. Data are actually converted into information by the central processing unit.

To know more about data visit :-

https://brainly.com/question/11941925

#SPJ1

________ computers are present in such diverse applications as gasoline pumps, home appliances, and traffic lights.
A) Embedded
B) Distributed
C) Grid
D) Convertible

Answers

Embedded computers are present in such diverse applications as gasoline pumps, home appliances, and traffic lights.

What are embedded computers?

Embedded computers operate as part of a larger device or system, as opposed to stand-alone computers. Embedded computers usually serve her one purpose. Embedded PC applications ranging from industrial automation and in-vehicle computing to digital signage, robotics and more.

In general, when we think of computers, we think of a big rectangular black box with cables sticking out of the back. Vents built into the sides of these consumer PCs allow airflow to cool internal components. However, the size and design of computer systems have evolved significantly as technology has evolved. Today's commercial embedded computers bear little resemblance to desktop tower computers. But perhaps more importantly, the way computers are used in industry has changed. 

To know more about embedded computers, visit:

brainly.com/question/17317566

#SPJ4

Please help me with coding!

Please help me with coding!

Answers

Answer:

key code space

Explanation:

the transformation

The answer is the third question
Other Questions
the core of the os that is responsible for interacting with hardware is _____ When reporting on a nonissuer's internal control over financial reporting in a separate report, a practitioner should include a paragraph that describes theA.Documentary evidence regarding the control environment factors.B.Changes in the internal control structure since the prior report.C.The practitioner's responsibility to detect material misstatements in account balances.D.The criteria against which the internal control was measured.SHOW CORRECT ANSWER 1. Verify the Binet's formula for Fy for the case n= se n=1,2,3. consider the vectors u=i 2j 3k and v=3i-j 2k. find the scalar projection (compvu) and vector projection (projvu) of vector u onto vector v. PantherCorp stock has had returns of 1 percent, -9 percent, 11 percent. -8 percent, and 4 percent over the past five years, respectively. What is the variance of these returns? Answer should be in percentage form (e.g. 0.01 is 1%) without the percentage (%) symbol. Answer to two (2) decimals. In your own words, explain what code switching is? answer number 2 the other questions are answer already an inverted conical tank full of water has a height of 10 meters and a base radius of 7 meters. how much work is required to pump the water over the upper edge of the tank until the height of the water remaining in the tank is 4 meters? round to the nearest integer. note: the weight-density of water is 9800 nm3. Find the length of side x in simplest radical form with a rational denominator. jim came across an advertisement for an herbal supplement that claimed to cure lung cancer by targeting precancerous cells in the lungs. if this claim were true, which of the following is a possible mechanism by which it may act? please read the paragraph below to answer the following question. jim has become particularly interested in the genetic basis of cancer and has spent considerable time reading published papers about oncogenes. he learned that as early as 1972 researchers suggested that mutations in proto-oncogenes caused by carcinogens can convert the proto-oncogenes to oncogenes. he asked you to answer a couple of questions about this because he did not have a sufficient biology background. jim came across an advertisement for an herbal supplement that claimed to cure lung cancer by targeting precancerous cells in the lungs. if this claim were true, which of the following is a possible mechanism by which it may act? the supplement would stimulate translation of growth factors the supplement would increase mutation rates in proto-oncogenes. the supplement would restrict the transcription of oncogenes. the supplement would inhibit the production of tumor suppressor proteins. which of the following sociologists contributed to the discipline by successfully combining theory and research in their sociological work? all else constant, and assuming positive interest rates, an increase in the interest rate will cause the present value of some amount of money to be received in the future (for example, $1000 to be received exactly 15 years from today) to ____. and, all else constant, an increase in the number of periods (for example, $1000 to be received 20 years from today instead of 15 years from today) will cause the present value of some amount of money to be received in the future to____1) increase; increase 2) decrease; decrease . 3) decrease; increase 4) increase; decrease which of the following statements about republican warren harding's presidential campaign of 1920 are correct? What is the volume of a rectangular prism with a length of 5 cm, a height of 3 cm, and a width of 10 cm?A18 cm3B150 cm3C190 cm3D80 cm3 Which of the following incorrectly shows the bond polarity? Show the correct bond polarity for those that are incorrect.a. +HFb. +ClIc. +SiSd. +BrBre. +OP Translate into French: "I come from Brazil but I live in Sweden" what form does the trajectory of a particle have if the distance from any point a to point b is equal to the magnitude of the displacement from a to b? One of these is NOT an example of prose fiction a composite aquitard consists of 1.1-foot-deep lacustrine clay layer on top of 5.8-foot-deep glacial till layer. the composite aquitard is found to permit 0.13 gpd of vertical ground-water flow over an area of 34.2 feet2 with a total head loss of 2.4 feet. the hydraulic conductivity of the glacial till is determined to be 2.2 x 10-6 cm/sec (0.0466 gpd/ft2). what is the hydraulic conductivity of the lacustrine clay? What acts of communication are used by companies with buffering strategy?ADefensive statementsB SponsorshipC BriefingD Spread of the word