• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error Display WIndow : How

 
Aruneesh Salhotra
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I creating a error infrastructure, where on few errors, like critical I would display like a error Jframe, showing user-level reason, and admin-level reason in a multi-tabbed format.

I also have a OK button to be pressed after which the code would proceed.

I am having an issue. I am waiting for a flag to get set to true in a lock object.

Obj j = new Obj();
DisplayError error = new DisplayError(j,"Server throwed Error","RMI Server throwed exception\n" + e.toString());
error.waitForOk(j);


where
DisplayError ....
{
public void waitForOk(Obj j)
{
this.setVisible(true);
synchronized (j)
{
while (!j.flag)
{
Thread.yield();
}
}
}
}
 
B Chen
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe all you will need is JOptionPane.showMessageDialog()
 
Aruneesh Salhotra
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Earlier I started off using the same, the only drawback is the fact that the messageDialog, doesnt wait, and it is displayed, and the code continues, ahead of the thread. It returns a void.

Moreover I was going to implement reason and a detailedReason for an error.
 
Aruneesh Salhotra
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think Modal Dialog must do the job. It blocks input to any other window.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic