forked from AlphaWallet/alpha-wallet-android
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
346 additions
and
890 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
desktop/src/main/java/io/stormbird/token/management/CustomComponents/JTextFieldLimit.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.stormbird.token.management.CustomComponents; | ||
|
||
import javax.swing.text.AttributeSet; | ||
import javax.swing.text.BadLocationException; | ||
import javax.swing.text.PlainDocument; | ||
|
||
public class JTextFieldLimit extends PlainDocument { | ||
private int limit; | ||
public JTextFieldLimit(int limit){ | ||
super(); | ||
this.limit = limit; | ||
} | ||
JTextFieldLimit(int limit, boolean upper){ | ||
super(); | ||
this.limit = limit; | ||
} | ||
|
||
public void insertString(int offset, String str, AttributeSet attr) throws BadLocationException{ | ||
if(str == null) | ||
return; | ||
if((getLength() + str.length()) <= limit){ | ||
super.insertString(offset, str, attr); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters