• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Alerts or prompt box or dialogbox

 
Ranch Hand
Posts: 158
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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();
}
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic