Re: JOptionPane
- From: Ian Shef <invalid@xxxxxxxxxxxxx>
- Date: Thu, 22 May 2008 18:35:10 GMT
mamta81 <roy.mamta@xxxxxxxxx> wrote in news:535415ec-86bb-4d57-85f6-
5c604fb5c88a@xxxxxxxxxxxxxxxxxxxxxxxxxxx:
HI friends,
i have a problem. Suppose i have a JButton . When it is
clicked a JOptionPane will appear.The number of times button will be
clicked that number of times the JOption Pane appears.So i have to
click on the OK button of that JOption Pane that number of times. Is
there any solution so that no matter how many times the button iis
clicked the JOption Pane will appear only once.
Please help
One option would be to disable the JButton after it has been clicked, and
enable it again after the JOptionPane has been dismissed. This will prevent
the JButton from calling up the JOptionPane more than once at any time.
Alternatively, you could keep track of whther you are currently displaying
the JOptionPane and skip creating another one if one is currently displayed.
.
- References:
- JOptionPane
- From: mamta81
- JOptionPane
- Prev by Date: Re: JScrollPane content sizing
- Next by Date: Re: JOptionPane
- Previous by thread: Re: JOptionPane
- Next by thread: Re: JOptionPane
- Index(es):