import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; public class bmicalc extends JFrame { public static void main(String[] args) { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { bmicalc GUI = new bmicalc(); GUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); GUI.setVisible(true); } }); } public bmicalc() { initComponents(); } private void metricCalculateButtonActionPerformed(ActionEvent e) { // if calculate button is pressed in the metric panel System.out.println(3); calc.setMetric(); } private void imperialCalculateButtonActionPerformed(ActionEvent e) { // TODO add your code here } private void usaCalculateButtonActionPerformed(ActionEvent e) { // TODO add your code here } private void stonesSpinnerStateChanged(ChangeEvent e) { // TODO add your code here } private void footSpinnerStateChanged(ChangeEvent e) { // TODO add your code here } private void poundsSpinnerStateChanged(ChangeEvent e) { // TODO add your code here } private void inchesSpinnerStateChanged(ChangeEvent e) { // TODO add your code here } private void stonesSpinnerImperialStateChanged(ChangeEvent e) { // TODO add your code here } private void poundsSpinnerImperialStateChanged(ChangeEvent e) { // TODO add your code here } private void footSpinnerImperialStateChanged(ChangeEvent e) { // TODO add your code here } private void inchesSpinnerImperialStateChanged(ChangeEvent e) { // TODO add your code here } private void heightSpinnerMetricStateChanged(ChangeEvent e) { // TODO add your code here } private void weightSpinnerMetricStateChanged(ChangeEvent e) { // TODO add your code here } private void stonesSpinnerUSAStateChanged(ChangeEvent e) { // TODO add your code here } private void feetSpinnerUSAStateChanged(ChangeEvent e) { // TODO add your code here } private void inchesSpinnerUSAStateChanged(ChangeEvent e) { // TODO add your code here } private void initComponents() { JFrame bmiCalculatorFrame = new JFrame(); tabbedPane1 = new JTabbedPane(); imperialPanel = new JPanel(); imperialCalculateButton = new JButton(); weightLabelImperial = new JLabel(); heightLabelImperial = new JLabel(); stonesSpinnerImperial = new JSpinner(); footSpinnerImperial = new JSpinner(); poundsSpinnerImperial = new JSpinner(); inchesSpinnerImperial = new JSpinner(); poundsLabelImperial = new JLabel(); stonesLabelImperial = new JLabel(); feetLabelImperial = new JLabel(); inchesLabelImperial = new JLabel(); metricPanel = new JPanel(); metricCalculateButton = new JButton(); weightLabelMetric = new JLabel(); heightLabelMetric = new JLabel(); weightSpinnerMetric = new JSpinner(); kgLabelMetric = new JLabel(); metresLabelMetric = new JLabel(); heightSpinnerMetric = new JSpinner(); usPanel = new JPanel(); usaCalculateButton = new JButton(); heightLabelUSA = new JLabel(); weightLabelUSA = new JLabel(); stonesSpinnerUSA = new JSpinner(); stonesUSALabel = new JLabel(); inchesSpinnerUSA = new JSpinner(); feetSpinnerUSA = new JSpinner(); feetLableUSA = new JLabel(); inchesLabelUSa = new JLabel(); ImperialCalculatePopUp = new JPopupMenu(); //======== bmiCalculatorFrame ======== { bmiCalculatorFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); bmiCalculatorFrame.setTitle("BMI Calculator"); Container bmiCalculatorFrameContentPane = bmiCalculatorFrame.getContentPane(); bmiCalculatorFrameContentPane.setLayout(new GridLayout()); //======== tabbedPane1 ======== { //======== imperialPanel ======== { // JFormDesigner evaluation mark imperialPanel.setBorder(new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), imperialPanel.getBorder())); imperialPanel.addPropertyChangeListener(new java.beans.PropertyChangeListener(){public void propertyChange(java.beans.PropertyChangeEvent e){if("border".equals(e.getPropertyName()))throw new RuntimeException();}}); //---- imperialCalculateButton ---- imperialCalculateButton.setText("Calculate"); imperialCalculateButton.setComponentPopupMenu(ImperialCalculatePopUp); imperialCalculateButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { imperialCalculateButtonActionPerformed(e); } }); //---- weightLabelImperial ---- weightLabelImperial.setText("Weight"); weightLabelImperial.setFont(new Font("MoolBoran", Font.BOLD|Font.ITALIC, weightLabelImperial.getFont().getSize() + 12)); //---- heightLabelImperial ---- heightLabelImperial.setText("Height"); heightLabelImperial.setFont(new Font("MoolBoran", Font.BOLD|Font.ITALIC, heightLabelImperial.getFont().getSize() + 12)); //---- stonesSpinnerImperial ---- stonesSpinnerImperial.setModel(new SpinnerNumberModel(3, 3, 31, 1)); stonesSpinnerImperial.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { stonesSpinnerStateChanged(e); stonesSpinnerImperialStateChanged(e); } }); //---- footSpinnerImperial ---- footSpinnerImperial.setModel(new SpinnerNumberModel(4, 4, 6, 1)); footSpinnerImperial.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { footSpinnerStateChanged(e); footSpinnerImperialStateChanged(e); } }); //---- poundsSpinnerImperial ---- poundsSpinnerImperial.setModel(new SpinnerNumberModel(0.0, 0.0, 13.0, 1.0)); poundsSpinnerImperial.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { poundsSpinnerStateChanged(e); poundsSpinnerImperialStateChanged(e); } }); //---- inchesSpinnerImperial ---- inchesSpinnerImperial.setModel(new SpinnerNumberModel(0, 0, 11, 1)); inchesSpinnerImperial.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { inchesSpinnerStateChanged(e); inchesSpinnerImperialStateChanged(e); } }); //---- poundsLabelImperial ---- poundsLabelImperial.setText("Pounds"); poundsLabelImperial.setFont(new Font("MoolBoran", Font.PLAIN, poundsLabelImperial.getFont().getSize() + 10)); poundsLabelImperial.setHorizontalAlignment(SwingConstants.RIGHT); //---- stonesLabelImperial ---- stonesLabelImperial.setText("Stones"); stonesLabelImperial.setFont(new Font("MoolBoran", Font.PLAIN, stonesLabelImperial.getFont().getSize() + 10)); stonesLabelImperial.setHorizontalAlignment(SwingConstants.RIGHT); //---- feetLabelImperial ---- feetLabelImperial.setText("Feet"); feetLabelImperial.setFont(new Font("MoolBoran", Font.PLAIN, feetLabelImperial.getFont().getSize() + 9)); feetLabelImperial.setHorizontalAlignment(SwingConstants.RIGHT); //---- inchesLabelImperial ---- inchesLabelImperial.setText("Inches"); inchesLabelImperial.setFont(new Font("MoolBoran", Font.PLAIN, inchesLabelImperial.getFont().getSize() + 10)); inchesLabelImperial.setHorizontalAlignment(SwingConstants.RIGHT); GroupLayout imperialPanelLayout = new GroupLayout(imperialPanel); imperialPanel.setLayout(imperialPanelLayout); imperialPanelLayout.setHorizontalGroup( imperialPanelLayout.createParallelGroup() .addGroup(imperialPanelLayout.createSequentialGroup() .addContainerGap() .addGroup(imperialPanelLayout.createParallelGroup() .addGroup(imperialPanelLayout.createSequentialGroup() .addGroup(imperialPanelLayout.createParallelGroup() .addComponent(weightLabelImperial, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE) .addComponent(heightLabelImperial, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)) .addGap(58, 58, 58) .addGroup(imperialPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING) .addComponent(footSpinnerImperial, GroupLayout.PREFERRED_SIZE, 66, GroupLayout.PREFERRED_SIZE) .addGroup(imperialPanelLayout.createParallelGroup() .addComponent(stonesLabelImperial, GroupLayout.PREFERRED_SIZE, 60, GroupLayout.PREFERRED_SIZE) .addComponent(stonesSpinnerImperial, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE)) .addComponent(feetLabelImperial, GroupLayout.PREFERRED_SIZE, 60, GroupLayout.PREFERRED_SIZE)) .addGap(43, 43, 43) .addGroup(imperialPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING) .addGroup(imperialPanelLayout.createParallelGroup() .addComponent(poundsLabelImperial, GroupLayout.PREFERRED_SIZE, 60, GroupLayout.PREFERRED_SIZE) .addComponent(poundsSpinnerImperial, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE)) .addComponent(inchesLabelImperial, GroupLayout.PREFERRED_SIZE, 60, GroupLayout.PREFERRED_SIZE) .addComponent(inchesSpinnerImperial, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE)) .addGap(0, 55, Short.MAX_VALUE)) .addComponent(imperialCalculateButton, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 367, Short.MAX_VALUE)) .addContainerGap()) ); imperialPanelLayout.setVerticalGroup( imperialPanelLayout.createParallelGroup() .addGroup(imperialPanelLayout.createSequentialGroup() .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(imperialPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(poundsLabelImperial, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(stonesLabelImperial, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(imperialPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(poundsSpinnerImperial, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE) .addComponent(weightLabelImperial, GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE) .addComponent(stonesSpinnerImperial, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(imperialPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(inchesLabelImperial, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(feetLabelImperial, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)) .addGap(5, 5, 5) .addGroup(imperialPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(footSpinnerImperial, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE) .addComponent(heightLabelImperial, GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE) .addComponent(inchesSpinnerImperial, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(imperialCalculateButton, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)) ); } tabbedPane1.addTab("Imperial", imperialPanel); //======== metricPanel ======== { //---- metricCalculateButton ---- metricCalculateButton.setText("Calculate"); metricCalculateButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { metricCalculateButtonActionPerformed(e); } }); //---- weightLabelMetric ---- weightLabelMetric.setText("Weight"); weightLabelMetric.setFont(new Font("MoolBoran", Font.BOLD|Font.ITALIC, weightLabelMetric.getFont().getSize() + 12)); //---- heightLabelMetric ---- heightLabelMetric.setText("Height"); heightLabelMetric.setFont(new Font("MoolBoran", Font.BOLD|Font.ITALIC, heightLabelMetric.getFont().getSize() + 12)); //---- weightSpinnerMetric ---- weightSpinnerMetric.setModel(new SpinnerNumberModel(25.0, 25.0, 200.0, 0.5)); weightSpinnerMetric.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { weightSpinnerMetricStateChanged(e); weightSpinnerMetricStateChanged(e); } }); //---- kgLabelMetric ---- kgLabelMetric.setText("Kg"); kgLabelMetric.setFont(new Font("MoolBoran", Font.PLAIN, kgLabelMetric.getFont().getSize() + 9)); kgLabelMetric.setHorizontalAlignment(SwingConstants.RIGHT); //---- metresLabelMetric ---- metresLabelMetric.setText("Metres"); metresLabelMetric.setFont(new Font("MoolBoran", Font.PLAIN, metresLabelMetric.getFont().getSize() + 9)); metresLabelMetric.setHorizontalAlignment(SwingConstants.RIGHT); //---- heightSpinnerMetric ---- heightSpinnerMetric.setModel(new SpinnerNumberModel(1.4, 1.4, 2.0, 0.01)); heightSpinnerMetric.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { heightSpinnerMetricStateChanged(e); } }); GroupLayout metricPanelLayout = new GroupLayout(metricPanel); metricPanel.setLayout(metricPanelLayout); metricPanelLayout.setHorizontalGroup( metricPanelLayout.createParallelGroup() .addGroup(metricPanelLayout.createSequentialGroup() .addContainerGap() .addGroup(metricPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING, false) .addComponent(metricCalculateButton, GroupLayout.PREFERRED_SIZE, 367, GroupLayout.PREFERRED_SIZE) .addGroup(GroupLayout.Alignment.TRAILING, metricPanelLayout.createSequentialGroup() .addGroup(metricPanelLayout.createParallelGroup() .addComponent(weightLabelMetric, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE) .addComponent(heightLabelMetric, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(metricPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING, false) .addComponent(heightSpinnerMetric, GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE) .addComponent(weightSpinnerMetric, GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(metricPanelLayout.createParallelGroup() .addComponent(kgLabelMetric, GroupLayout.PREFERRED_SIZE, 60, GroupLayout.PREFERRED_SIZE) .addComponent(metresLabelMetric, GroupLayout.PREFERRED_SIZE, 60, GroupLayout.PREFERRED_SIZE)))) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); metricPanelLayout.setVerticalGroup( metricPanelLayout.createParallelGroup() .addGroup(GroupLayout.Alignment.TRAILING, metricPanelLayout.createSequentialGroup() .addContainerGap(47, Short.MAX_VALUE) .addGroup(metricPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(weightLabelMetric, GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE) .addComponent(kgLabelMetric, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(weightSpinnerMetric, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE)) .addGap(37, 37, 37) .addGroup(metricPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(heightLabelMetric, GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE) .addComponent(metresLabelMetric, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(heightSpinnerMetric, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(metricCalculateButton, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)) ); } tabbedPane1.addTab("Metric", metricPanel); //======== usPanel ======== { //---- usaCalculateButton ---- usaCalculateButton.setText("Calculate"); usaCalculateButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { usaCalculateButtonActionPerformed(e); } }); //---- heightLabelUSA ---- heightLabelUSA.setText("Height"); heightLabelUSA.setFont(new Font("MoolBoran", Font.BOLD|Font.ITALIC, heightLabelUSA.getFont().getSize() + 12)); //---- weightLabelUSA ---- weightLabelUSA.setText("Weight"); weightLabelUSA.setFont(new Font("MoolBoran", Font.BOLD|Font.ITALIC, weightLabelUSA.getFont().getSize() + 12)); //---- stonesSpinnerUSA ---- stonesSpinnerUSA.setModel(new SpinnerNumberModel(44, 44, 440, 1)); stonesSpinnerUSA.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { stonesSpinnerUSAStateChanged(e); } }); //---- stonesUSALabel ---- stonesUSALabel.setText("Stones"); stonesUSALabel.setFont(new Font("MoolBoran", Font.PLAIN, stonesUSALabel.getFont().getSize() + 10)); stonesUSALabel.setHorizontalAlignment(SwingConstants.RIGHT); //---- inchesSpinnerUSA ---- inchesSpinnerUSA.setModel(new SpinnerNumberModel(4, 0, 11, 1)); inchesSpinnerUSA.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { inchesSpinnerUSAStateChanged(e); } }); //---- feetSpinnerUSA ---- feetSpinnerUSA.setModel(new SpinnerNumberModel(4, 4, 6, 1)); feetSpinnerUSA.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { feetSpinnerUSAStateChanged(e); } }); //---- feetLableUSA ---- feetLableUSA.setText("Feet"); feetLableUSA.setFont(new Font("MoolBoran", Font.PLAIN, feetLableUSA.getFont().getSize() + 9)); feetLableUSA.setHorizontalAlignment(SwingConstants.RIGHT); //---- inchesLabelUSa ---- inchesLabelUSa.setText("Inches"); inchesLabelUSa.setFont(new Font("MoolBoran", Font.PLAIN, inchesLabelUSa.getFont().getSize() + 10)); inchesLabelUSa.setHorizontalAlignment(SwingConstants.RIGHT); GroupLayout usPanelLayout = new GroupLayout(usPanel); usPanel.setLayout(usPanelLayout); usPanelLayout.setHorizontalGroup( usPanelLayout.createParallelGroup() .addGroup(usPanelLayout.createSequentialGroup() .addContainerGap() .addGroup(usPanelLayout.createParallelGroup() .addGroup(GroupLayout.Alignment.TRAILING, usPanelLayout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(usaCalculateButton, GroupLayout.PREFERRED_SIZE, 367, GroupLayout.PREFERRED_SIZE)) .addGroup(GroupLayout.Alignment.TRAILING, usPanelLayout.createSequentialGroup() .addGroup(usPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING) .addGroup(usPanelLayout.createSequentialGroup() .addComponent(weightLabelUSA, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(stonesSpinnerUSA, GroupLayout.PREFERRED_SIZE, 104, GroupLayout.PREFERRED_SIZE)) .addGroup(GroupLayout.Alignment.LEADING, usPanelLayout.createSequentialGroup() .addComponent(heightLabelUSA, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE) .addGap(42, 42, 42) .addGroup(usPanelLayout.createParallelGroup() .addGroup(usPanelLayout.createSequentialGroup() .addComponent(feetLableUSA, GroupLayout.PREFERRED_SIZE, 60, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(inchesLabelUSa, GroupLayout.PREFERRED_SIZE, 60, GroupLayout.PREFERRED_SIZE)) .addGroup(usPanelLayout.createSequentialGroup() .addComponent(feetSpinnerUSA, GroupLayout.PREFERRED_SIZE, 66, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(inchesSpinnerUSA, GroupLayout.PREFERRED_SIZE, 66, GroupLayout.PREFERRED_SIZE))))) .addGap(3, 3, 3) .addComponent(stonesUSALabel, GroupLayout.PREFERRED_SIZE, 60, GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); usPanelLayout.setVerticalGroup( usPanelLayout.createParallelGroup() .addGroup(GroupLayout.Alignment.TRAILING, usPanelLayout.createSequentialGroup() .addGap(0, 41, Short.MAX_VALUE) .addGroup(usPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(weightLabelUSA, GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE) .addComponent(stonesUSALabel, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(stonesSpinnerUSA, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(usPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(feetLableUSA, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(inchesLabelUSa, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(usPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(heightLabelUSA, GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE) .addComponent(inchesSpinnerUSA, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE) .addComponent(feetSpinnerUSA, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(usaCalculateButton, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)) ); } tabbedPane1.addTab("USA", usPanel); } bmiCalculatorFrameContentPane.add(tabbedPane1); bmiCalculatorFrame.pack(); bmiCalculatorFrame.setLocationRelativeTo(bmiCalculatorFrame.getOwner()); } // //GEN-END:initComponents } // //GEN-BEGIN:variables // Generated using JFormDesigner Evaluation license - Micro B private JTabbedPane tabbedPane1; private JPanel imperialPanel; private JButton imperialCalculateButton; private JLabel weightLabelImperial; private JLabel heightLabelImperial; private JSpinner stonesSpinnerImperial; private JSpinner footSpinnerImperial; private JSpinner poundsSpinnerImperial; private JSpinner inchesSpinnerImperial; private JLabel poundsLabelImperial; private JLabel stonesLabelImperial; private JLabel feetLabelImperial; private JLabel inchesLabelImperial; private JPanel metricPanel; private JButton metricCalculateButton; private JLabel weightLabelMetric; private JLabel heightLabelMetric; private JSpinner weightSpinnerMetric; private JLabel kgLabelMetric; private JLabel metresLabelMetric; private JSpinner heightSpinnerMetric; private JPanel usPanel; private JButton usaCalculateButton; private JLabel heightLabelUSA; private JLabel weightLabelUSA; private JSpinner stonesSpinnerUSA; private JLabel stonesUSALabel; private JSpinner inchesSpinnerUSA; private JSpinner feetSpinnerUSA; private JLabel feetLableUSA; private JLabel inchesLabelUSa; private JPopupMenu ImperialCalculatePopUp; // JFormDesigner - End of variables declaration //GEN-END:variables }