Showing message box in java

Posted by Jopito under C# on 5/2/2013 | Points: 10 | Views : 1338 | Status : [Member] | Replies : 4
I need to my code to show an error message to the user once he enters wrong username,how is it done in java.below is my code
String Username=jTexfield1.text;
String Password=jPasswordField1.text;
if((username.equals("admin")&&Password.equals("123")
new MenuF().setVisible(true);
now,how can i display else statement showing error message for wrong password?...

Mark as answer if satisfied


Responses

Posted by: Niladri.Biswas on: 5/2/2013 [Member] Platinum | Points: 25

Up
0
Down
Try this one

public static void Popup(String msg, String pos)

{
JOptionPane.showMessageDialog(null, msg, "PopupBox: " + pos, JOptionPane.INFORMATION_MESSAGE);
}



Invoke it as

Popup("INFORMATION", "TITLE BAR MESSAGE");


Best Regards,
Niladri Biswas

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Learningtorise on: 5/3/2013 [Member] Starter | Points: 25

Up
0
Down
Use ClientScript.RegisterStartUpScript function to show alert from CodeBehind file

http://hashtagakash.wordpress.com/

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Niladri.Biswas on: 5/3/2013 [Member] Platinum | Points: 25

Up
0
Down
@Learningtorise , the question has been asked in Java (Console Application) and not in asp.net in which case ClientScript.RegisterStartUpScript would have worked (:

Best Regards,
Niladri Biswas

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Learningtorise on: 5/3/2013 [Member] Starter | Points: 25

Up
0
Down
@Niladri.Biswas: hmm.... Since the question was posted in C# category of forum... i failed to notice 'java' in his query....

My Bad ;)


http://hashtagakash.wordpress.com/

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response