Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String decode(String a,String b){
- CharSequence[] text={"a","b","c","d","e","f","g","h","i","j","k","l","m","n"
- ,"o","p","q","r","s","t","u","v","w","x","y","z"};
- String[] morze={".-","_...","_._.","_..",".",".._.","__.","...."
- ,"..",".___","_._","._..","__","_.","___",".__.","__._","._."
- ,"...","-",".._","..._",".__","_.._","_.__","__.."};
- for(int i=0;i<text.length;i++){
- if(a.contains(text[i])){
- b+=morze[i];
- }
- }
- System.out.println(":"+b);
- return b;
- }
- }
- public void actionPerformed(ActionEvent e) {
- String a=textText.getText();
- String b1="";
- d.decode(a, b1);
- System.out.println(b1);
- morzeText.setText(b1);
- s.play();
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement