• Post Reply Bookmark Topic Watch Topic
  • New Topic

Confirmation screen

 
Kiran Baratam
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All
I have a input screen where user enters some values.I need to show a confirmation screen with all these values and with 2 options like ok and cancel.If he presses ok then i should submit otherwise i should go back to my parent screen.
Can you please suggest me how do i do this??
If i use showConfirmDialog i can not display the input values.
do i need to have another freame and show or how should i do???

Regards
Kiran
 
VIJAY Yadlapati
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In inputFrame, declare a boolean variable (say valuesHashMap) to hold all the data that is to be displayed in the confirmationDialog, and setter, getter methods for it.
The getValuesHashMap() will be used by the confirmationDialog to display the input details, and setValuesHashMap() will be used by the confirmationDialog to return the details to the inputFrame.
Class InputFrame
****************
Assume showValues() is the method in inputFrame to display confirmationDialog.
private void showDilaog()
{
....
....
confirmationDialog.setVisible(true);
if(valuesHashMap != null)
{
// submit the input values
}
}
Class ConfirmationDialog
************************
public void actionPerformed(ActionEvent ae)
{
InputFrame inputFrame = (InputFrame) getOwner();

if(ae.getSource() == okButton)
{
dispose();
}
else if(ae.getSource() == cancelButton)
{
inputFrame.setValuesHashMap(null);
dispose();
}
}
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!