Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Add the logic in order to work the form. Shoud implement exception handling import javax.swing. * ; public class BMICalculator { public static void main

Add the logic in order to work the form.
Shoud implement exception handling
import javax.swing.*;
public class BMICalculator {
public static void main(String[] args){
JFrame frame = new JFrame("BMI Calculator");
frame.setSize(300,200);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel();
frame.add(panel);
placeComponents(panel);
frame.setVisible(true);
}
private static void placeComponents(JPanel panel){
panel.setLayout(null);
JLabel userLabel = new JLabel("BMI");
userLabel.setBounds(10,20,80,25);
panel.add(userLabel);
JLabel weightLabel = new JLabel("How many pounds you weight?");
weightLabel.setBounds(10,50,200,25);
panel.add(weightLabel);
JLabel heightLabel = new JLabel("What is your height in inches?");
heightLabel.setBounds(10,80,200,25);
panel.add(heightLabel);
JLabel bmiLabel = new JLabel("Your BMI is");
bmiLabel.setBounds(10,110,80,25);
panel.add(bmiLabel);
JLabel categoryLabel = new JLabel("(Obese)");
categoryLabel.setBounds(10,140,80,25);
panel.add(categoryLabel);
}
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions

Question

5. Identify the logical fallacies, deceptive forms of reasoning

Answered: 1 week ago

Question

6. Choose an appropriate organizational strategy for your speech

Answered: 1 week ago