• Post Reply Bookmark Topic Watch Topic
  • New Topic

Generic Ok / Cancel Screen --- Alert doesn't do

 
joe smyth
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I make a generic Ok/Cancel Screen that I can reuse again and again.

example:

A user has just pressed a button to delete a file.
This file has names of other files in it that must also be deleted.
I want to do the following:
if (GenericOkCancel("The Following Sub Files must be deleted Too")){
//They pressed 'Ok' so delete everything
}

--- An Alert will (perhaps by blocking) return to the same place in my code as it was called from (or so i believe)... is there a way that i can extend an alert functionally to have it make use of Ok/Cancel and tell me what ppl pressed? If not then how else can I immplement such a screen? There are countless examples of when i would like to get a users response to a question and have it return to the same position in execution with a response.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch!

Perhaps you want to make use of JOptionPane.

I'm moving this to the Swing / AWT / SWT / JFace forum...
 
Anand Karia
Ranch Hand
Posts: 156
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hope this would help you out

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!