Re: Can JOptionPane use a MaskFormatter for data input
- From: "dcMan" <gregkeesey@xxxxxxxxxx>
- Date: 27 Sep 2006 10:51:13 -0700
Michael Rauscher wrote:
You may use a JFormattedTextField (using a MaskFormatter) and you may
further use this text field as message parameter to call any of the
JOptionPane.showXXXDialog methods.
for the labe text you want displayed to the operator, such as: "PleaseFrom what I understand about JOptionPane, the message parameter is only
enter the IP Address:".
I don't think the message parameter is for the data entry TextField.
The data entry text field is where I want the formatting to take place.
I tried a quick and dirty version from what I understood you were
suggesting. But the text that was affected by the message parameter was
the Label text for the Dialog box.
try
{
JFormattedTextField ft = new JFormattedTextField();
MaskFormatter formatter = new
MaskFormatter("###.###.###.###");
formatter.install(ft);
JOptionPane.showInputDialog(null ,formatter);
} catch (Exception e)
{
}
If I'm wrong in how you ment to use the message parameter could you
please clarify. Thanks
.
- Follow-Ups:
- Re: Can JOptionPane use a MaskFormatter for data input
- From: Michael Rauscher
- Re: Can JOptionPane use a MaskFormatter for data input
- References:
- Can JOptionPane use a MaskFormatter for data input
- From: dcMan
- Re: Can JOptionPane use a MaskFormatter for data input
- From: Deniz Dogan
- Re: Can JOptionPane use a MaskFormatter for data input
- From: Michael Rauscher
- Can JOptionPane use a MaskFormatter for data input
- Prev by Date: Re: Can JOptionPane use a MaskFormatter for data input
- Next by Date: Return values from an ActionListener?
- Previous by thread: Re: Can JOptionPane use a MaskFormatter for data input
- Next by thread: Re: Can JOptionPane use a MaskFormatter for data input
- Index(es):