Jessica Dancel

Greenhorn
+ Follow
since Dec 07, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jessica Dancel

I was wondering how to add that as a constraint to a textfield, so that the user can only enter those characters.
14 years ago
Thank you! That worked. It feels a little kludgey, but it'll do . . .

Thanks again.

Jessica
15 years ago
I'm trying to take the input of several JTextField's that contain integers and concatenate them into a formatted String (for both display and to be saved). I'm having trouble getting leading zeros into my string. For example, if the first field contains the number '1', I want it to appear as '001' in my String.

I've tried a few things, including the following:



The problem is, of course, that JTextField.getText() returns a String, not an int.

Does anyone know another way to do it?

Thanks,
Jessica
15 years ago
Thanks, guys. This gave me what I needed.
15 years ago
Okay, here's my code:



Anyone have a thought as to how to get myDialog centered over the instance of PanelClass? Thanks.

Jessica Dancel
[ January 03, 2007: Message edited by: Jessica Dancel ]
15 years ago
I have a modal JDialog that I pop up from a parent window. Right now it's appearing in the upper left corner of the screen. I'd like it to pop up centered over the parent window, but I can't find any methods to do this. Anyone know how?
Thanks in advance.
15 years ago
Bhanu,
I was told the same thing by my manager. He said if you don't remove the listeners it can cause a memory leak. Must be some truth to it. Could be that the garbage collector takes a long time to find those references.
15 years ago
Can you show your declaration of new_name, as well as what specifically "doesn't work" (error message, null value returned, etc.)?
15 years ago
Thank you very much for your answer. That answers my question!
15 years ago
Is there any reason not to attach one listener to multiple GUI components?

For example, I'm working on a form with a Modify button in it. I have an action listener that will trigger when a component is changed. Can I attach this listener to every component in the GUI? Or do I need to use separate ones for each one? All the example code I have uses separate ones, and I'm not sure if this is a style issue or a language construct.

Thanks in advance!
15 years ago