Question

this is a newbie question. I am experimenting a little with Java, and I stumbled across a method which is supposed to call an empty dialog.

The method, however, has a Dialog parameter in the signature which I have no idea how to use. It looks like this:

public TestDialog(GraphicsConfiguration gc,
                     int x, int y,
                     Dialog dialog)
{
    super(dialog, getMsg("dialog.title"), true, gc);
    initDialog(x, y);
}

I see from the javadocs that it's supposed to represent the parent window, but how would I call this method exactly and what do I need to pass as the Dialog parameter? I have googled, but couldn't find much; please be patient, i'm just starting out with this language :)

Edit

I should point out that I understand what the Dialog parameter does, it allows the method to retrieve information from the calling dialog (in this example, it's supposed to retrieve a text string); I just have no idea how to call this.

Was it helpful?

Solution

A dialog must have either a frame or another dialog defined as its owner when it's constructed. So at some point, you'll have a dialog with a frame as it's parent.

The Dialog class has both constructors, with Dialog or Frame as parents.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top