*
The moose likes Java in General and the fly likes Alerts or prompt box or dialogbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Alerts or prompt box or dialogbox" Watch "Alerts or prompt box or dialogbox" New topic
Author

Alerts or prompt box or dialogbox

Anand Karia
Ranch Hand

Joined: Sep 25, 2004
Posts: 156

Dear All

I m using following java default code for alter and prompt box. But this is not working. Can any one tell me where i am wrong. Or can any one tell me how to make default dialogbox having different icons of warning and informations etc.

public String mesgBox(String str) {
alerts myalert = new alerts();
alerts myalert = new alerts(str);

myalert.dispose();
myalert.show();
String x ;
x = myalert.getSelected() ;
return(x);
}


public void promptBox(String str) {
prompt myprompt = new prompt(str);
myprompt.dispose();
myprompt.show();
}


Love is GOD and GOD is Love.
Anand Karia
IT Concretor.......
M/s. Anand Karia Concreting IT
Ashish Vegaraju
Ranch Hand

Joined: Aug 19, 2004
Posts: 47
hi Anand,

the best way to pop up a dialog box is by using JOptionPane. u can show various alert messages with diff icons..if u want any more help...log on to:

http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html

Ashish.
Ashish Vegaraju
Ranch Hand

Joined: Aug 19, 2004
Posts: 47
hi Anand,

the best way to pop up a dialog box is by using JOptionPane. u can show various alert messages with diff icons..if u want any more help...log on to:

http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html

Ashish.
 
 
subject: Alerts or prompt box or dialogbox
 
Similar Threads
Alerts and textbox losing focus
Can we redeclare a class
Difference between String variable and String Object ???
explain the output - constructors
how to get ascii value