Hey everybody, after learning most of the basic stuff in java(Strings, Variables, Classes etc...) I really wanted to make a program that would have user input and was also useful. So I made a program that would allow the user to enter a username-password combination and if both entries were correct, it would open up a web page to something really cool, in this case, a picture of bacon. So I would really appreciate if you looked at my code and gave me some tips for future reference.
Here is the code, is there any easier way I could have done this/anything that I missed?
import java.io.IOException; import javax.swing.JOptionPane; public class Chuck { public static void main(String[] args){ String username = JOptionPane.showInputDialog("Enter Username"); String password = JOptionPane.showInputDialog("Enter Password"); String user = "bacon123"; String pass = "ilovebacon"; String url = "https://www.google.com/search?hl=en&site=imghp&tbm=isch&source=hp&biw=1024&bih=677&q=bacon&oq=bacon&gs_l=img.3..0l10.4039.4699.0.6159.5.5.0.0.0.0.121.506.2j3.5.0.cpsugrpqhmsignedin%2Chmss2%3Dfalse...0.0..1.1.20.img.ilIvv5MwsRs"; {try { if (username.equals(user) && password.equals(pass))java.awt.Desktop.getDesktop().browse(java.net.URI.create(url)); else {JOptionPane.showMessageDialog(null, "Access Denied!", "Error", JOptionPane.ERROR_MESSAGE);} } catch (IOException e) { } } } }