{
rdbtnFtoC = new JRadioButton();
getContentPane().add(rdbtnFtoC);
rdbtnFtoC.setText("Fahrenheit to Celsius");
rdbtnFtoC.setBounds(51, 144, 140, 18);
btnGTemp.add(rdbtnFtoC);
}
{
rdbtnCtoF = new JRadioButton();
getContentPane().add(rdbtnCtoF);
rdbtnCtoF.setText("Celsius to Fahrenheit");
rdbtnCtoF.setBounds(51, 168, 140, 18);
btnGTemp.add(rdbtnCtoF);
}
{
btnConvert = new JButton();
getContentPane().add(btnConvert);
btnConvert.setText("Convert!");
btnConvert.setBounds(401, 153, 121, 38);
btnConvert.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
System.out.println("btnConvert.actionPerformed, event="+evt);
//TODO add your code for btnConvert.actionPerformed
int val = txtInsert.getInt();
[B]if(rdbtnFtoC){[/B]
// Create a command that uses the radio button selection and converts the number in the box using the conversion formula.
}
}
});
}
pack();
this.setSize(602, 403);
} catch (Exception e) {
e.printStackTrace();
}
}
}