Hello Community, looking to see if anyone can help me finish my code. I am making a program that turns upper case to lower case and lower case to upper case at the push of the button. I have everything set up 2 text fields, 1 button. i am stuck and have no clue how to make it do what i want. i have tried a few things but nothing seems to work. Can anyone get me going in the right direction. Thanks
Here is my code so far:
import java.awt.*; import javax.swing.*; import java.awt.event.*; import javax.swing.event.*; import java.util.*; import java.io.*; public class Ulcase { JLabel l1,l2; JTextField tf1,tf2; JButton b1; public static void main(String[] args) { new Ulcase(); } public Ulcase() { JFrame frame1 = new JFrame(); frame1.setTitle("Converting Cases"); frame1.setSize(700,75); JLabel l1 = new JLabel("Word to Convert"); JLabel l2 = new JLabel("Converted Word"); JTextField tf1 = new JTextField(10); JTextField tf2 = new JTextField(5); JButton b1 = new JButton("Press To Convert"); b1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { } }); tf2.setEditable(false); Container pane = frame1.getContentPane(); pane.setLayout(new GridLayout(1,3) ); pane.add(l1); pane.add(tf1); pane.add(l2); pane.add(tf2); pane.add(b1); frame1.setLocationRelativeTo(null); frame1.setDefaultCloseOperation(frame1.EXIT_ON_CLOSE); frame1.setVisible(true); } }