Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Alerts or prompt box or dialogbox

 
Anand Karia
Ranch Hand
Posts: 156
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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();
}
 
Ashish Vegaraju
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic