-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I want to validate a jtextfield as user inputs a price of some item.
I have a perfectly working code which beeps and discard if user inputs some character that doesnt match the regular expression.(for regular expression "[0-9]+" it accepts any number of digits and beeps if a letter is given as input)
But…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
doesn't .getKeyCode( ) return the key's int value? Because i have set my jtextfield to listen to keylistener, and in the keytyped method, i check what key has been pressed. Here's a snippet of my code:
JTextField jtf = new JTextField( );
jtf.addKeyListener( this );
.
.
.
public void keyTyped( KeyEvent…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have a tabbed pane with a couple of uneditable JTextFields which I want to fill in with information from a database. However, when I set the text in the text fields to anything, it doesn't show up when I run the program. When I get the text and print it out, it does show. What could be the problem…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I am trying to have several JTextFields on a single row, but I don't want them to have the same width. How can I control the width and make some of them wider than others? I want that they together take up 100% of the total width, so it would be good if I could use some kind of weigthing.
I have…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have a JTextField that represents a day, such as "Sunday", when I left mouse click on it, it changes background color, when I right mouse click on it, a pop up menu comes up, after I click on a menu item, such as "1st of month", it gets the value, closes the menu and then change the bgcolor, my…
>>> More