[Java] Convert String to Base64 04-02-2018, 08:09 AM
#1
In The Name Of Allah
Al-Salam Alekum
Hey guys, Converting text(String) to Base64 in Java:
![[Image: p_822j27rj1.png]](https://f.top4top.net/p_822j27rj1.png)
Code:
JTextField text = new JTextField();
JFrame Converter = new JFrame("String to Base64");
String love = "Sinister.ly";
String s = Base64.getEncoder().encodeToString(love.getBytes("utf-8"));
Converter.add(text);
text.setText(s);
Converter.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Converter.show();
Converter.setSize(300, 100);
![[Image: p_822j27rj1.png]](https://f.top4top.net/p_822j27rj1.png)
Wa Salam Alekum
Die But Don't Lie
“Oh Abu Dharr! Don’t look at the smallness of the sin but look at the one you disobeyed.” Prophet Muhammad (pbuh)
![[Image: p_237m2jx1.png]](http://c.top4top.net/p_237m2jx1.png)
Click for Free VPN
“Oh Abu Dharr! Don’t look at the smallness of the sin but look at the one you disobeyed.” Prophet Muhammad (pbuh)
![[Image: p_237m2jx1.png]](http://c.top4top.net/p_237m2jx1.png)
Click for Free VPN