hello guys i have made a morse code decoder project and i have designed the gui and there is a text file containing the morse code of the alphabets there is a translate button.i want that when the user clicks the translate button the morse key from the text file will be readed and output will be shown in other text box.the user will enter a character or a string i am new to java please help.
here is my code that i have made
import javax.swing.*;
import java.io.*;
import java.awt.*;
public class MorseConverter
{
JFrame f;
JPanel cPanel,bPanel;
JTextArea textArea1,textArea2;
JButton btnTranslate,btnExit;
public MorseConverter()
{
f = new JFrame("MOrseConverter");
f.setLayout(new BorderLayout());
cPanel = new JPanel();
cPanel.setLayout(new GridLayout(0,2));
bPanel = new JPanel();
textArea1 = new JTextArea();
textArea1.setColumns(40);
textArea1.setRows(20);
GroupLayout layout = new GroupLayout(getContentPane());
getContentPane().setLayout(layout);
textArea2 = new JTextArea();
textArea1.setColumns(40);
textArea1.setRows(20);
GroupLayout layout = new GroupLayout(getContentPane());
getContentPane().setLayout(layout);
btnTranslate = new JButton("TRANSLATE");
btnExit = new JButton("EXIT");
bPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
f.getContentPane().add(cPanel,BorderLayout.CENTER) ;
f.getContentPane().add(bPanel,FlowLayout.CENTER);
cPanel.add();
bPanel.add(btnTranslate);
bPanel.add(btnExit);
f.setSize(900,500);
f.setVisible(true);
}
public static void main(String args[])
{
new MorseConverter();
}
}

