JTextField Help!!
I'm new to coding all together, so please be patient & hopefully I don't ask any stupid questions. I'm writing a program that has two JTextFields that represents degress in temperature, 1) Celsius & 2) Fahrenheit. The goal is to have the user input into either field and the opposite field automatically update itself. Before I ask my questions here is my code so far:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class converter extends JFrame
{
public static void main( String[] args )
{
JFrame window = new converter( );
window.show( );
}
private JTextField celsiusField;
private JTextField fahrenheitField;
public converter( )
{
setTitle( "Converter" );
setSize( 150, 80 );
setLocation( 500, 340 );
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE );
Container contentPane = getContentPane( );
contentPane.setLayout( new GridLayout( 2, 2, 4, 4 ) );
celsiusField = new JTextField( );
contentPane.add( new JLabel( "Celsius" ));
contentPane.add( celsiusField );
fahrenheitField = new JTextField( );
contentPane.add( new JLabel( "Fahrenheit" ));
contentPane.add( fahrenheitField );
}
}
My line of thinking is telling me to create two Listeners and point them at the opposite JTextField. So when input is being entered, the data would be processed and outputted according to the formula's have for both celsius and fahrenheit. However, I have no clue as to what the code woudl even begin to look like. Any help woudl be much appreciated!!

