Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!