maskformatter

    15熱度

    1回答

    我想用maskFormatter來使用jxdatepicker。我試圖 MaskFormatter maskFormatter = new MaskFormatter ("##/##/####"); JFormattedTextField field=new JFormattedTextField (maskFormatter); jXDatePicker.setEditor (field);

    2熱度

    1回答

    我用MaskFormatter之外爲我的JTextField。 它就像一個魅力,但問題是,我不能刪除JTextField的數量。 f = new MaskFormatter("#"); f.setValidCharacters("123456789"); 如何包含空格字符以便我可以接受1-9的空格和數字?

    0熱度

    1回答

    我正在使用掩碼來接受具有以下格式的CUIL(阿根廷)代碼## - ######## - #。但有一個可能性,中間數字有7個數字而不是8個,所以我想要做的是,當用戶按「 - 」或右箭頭在中間數字開頭自動填充0。 例子: 用戶類型 20-1523245 然後用戶按 - 其結果是 20-01523245- 而且是很重要的光標停留在最後的位置編寫最後一個號碼。 20-01523245-2 我試過用KeyL

    0熱度

    1回答

    我寫了一個IP地址爲(Ex. 172.16.10.0)的程序。我正在使用Maskformatter,但不知道如何從Maskformatter獲取值。 try { MaskFormatter mf = new MaskFormatter(mask); JFormattedTextField txtIP = new JFormattedTextField(mf); pan