Thank you
The problem here is that there may be two or three people have the same name
in the database, not only one. That is why I have to use "showInputDialog".
The user then can select one of those people.
Regards
S.Hoa
"Arnaud Berger" <> wrote in message
news:d61vhc$m0l$...
> Hi,
>
> showInputDialog doesn't have a version accepting an "optionype" int.
> The JOptionPane.OK_CANCEL_OPTION (value 2 ) you pass doesn't affect at all
> the buttons, because you pass this value to the "messagetype" parameter
> expecting INFORMATION_MESSAGE
> WARNING_MESSAGE <-- value 2 ...)
> So in showInputDialog , you have no way to tell which buttons should
appear.
>
> By the way, what is the point in displaying a list of name when you
already
> know what person
> you will want to display ?
>
> So I'd rather go with showConfirmDialog, just displaying the name of the
> user already existing with the same name.
> The text would be ""The following person already has this name in
database
> \n Do you want to get this person details ? \n\n"+person.
>
> Regards,
>
> Arnaud
>
>
>
> "shoa" <> a écrit dans le message news:
> 1115978879.62092@ftpsrv1...
> > If I use showConfirmDialog, I cannot get the Object o
> >
> > "Arnaud Berger" <> wrote in message
> > news:d61hgq$9co$...
> > > Hi,
> > >
> > > Give a try to showConfirmDialog with
JOptionPane.YES_NO_CANCEL_OPTION...
> > >
> > > Regards,
> > >
> > > Arnaud
> > >
> > > "shoa" <> a écrit dans le message news:
> > > 1115952053.440531@ftpsrv1...
> > > > Hello
> > > > I have a JOptionPane that allow me select an object (inside a vector
> > > > "allPeople"). After selecting an object in this JOptionPane, I want
to
> > > have
> > > > an another JOptionPane to confirm that sellection with three
choices;
> > YES,
> > > > NO, CANCEL
> > > >
> > > > The code below explains this:
> > > >
> > > > file://after click a button
> > > >
> > > > Object o = JOptionPane.showInputDialog(this, "There is a person with
> > this
> > > > name in database \n Do you want to get this person details",
> > > > "Select Person",
> > > > JOptionPane.OK_CANCEL_OPTION, null, allPeople.toArray(), "Person");
> > > > if (o != null) {...
> > > > .....
> > > > }
> > > >
> > > > It can be seen that here I used "JOptionPane.OK_CANCEL_OPTION" for
the
> > > > confirmation. I tried to use other options such as
> > > > JOptionPane.YES_OPTION.... but I cannot find out a JOptionPane that
> > > provides
> > > > three choices Yes, No, Cancel as what I want (I can get only the
> option
> > OK
> > > > and CANCEL). Is there a solution to overcome this.?
> > > >
> > > > Many thanks
> > > > S.Hoa
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|