
Signature
monique
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
>>> hello,
>>>
[quoted text clipped - 25 lines]
>
> Have you tried calling repaint() on the JDialog instead of paint()?
actually i think i was using repaint() even though I said i was using
paint() and I had removed the line b/c it didn't make a difference but I
put repaint() in just now and it didn't make a difference still ( had
to resize the window a pixel before the new field showed up).
>>> hello,
>>>
[quoted text clipped - 25 lines]
>
> Have you tried calling repaint() on the JDialog instead of paint()?
revalidate() was what I needed to do and then a repaint() so that fixes
the window resizing that was needed to make the new textfields appear.
The only problem I have left now is that when I add a new textfield so
another value can be added to an attribute I don't get the results I
want if the total # of values is equal to the index of the attribute in
my array. If I add any textfields for new values to any attribute past
the one at index 2 (the 3rd one) then the new textfield is placed at
what seems to be the gridy=1 value of my panel (panel contains all
textfields and attribute name for 1 attribute). And if I keep adding
textfields to that same attribute then the textfield with gridy value
equal to the index value of the attributename ends up going over top of
the original textfield and then the next one gets placed after the
original text field(which is where I want *all* new textfields to be
placed).
one whole panel
-----------------------
|attribute1name|value1|
----------------------
| |value2|
----------------------|
| |newval| <-this is where I want new ones to be placed
-----------------------
one whole panel
-----------------------|
| |newval1| <-- this is where they get put instead
-----------------------| If attrib2 index in my array is 3
| |newval2| then newval3 would end up going on top of
-----------------------| the existing value1 textfield with
|attribute2name|value1 | subsequent textfields actually going
-----------------------| after value2 where I wanted them in the
| |value2 | first place.
-----------------------|
any ideas? My constraints.gridy values are correct but they just don't
seem to be getting obeyed when I add the textfields to the Jpanel
Brandon McCombs - 29 Jan 2006 09:55 GMT
>>>> hello,
>>>>
[quoted text clipped - 64 lines]
> any ideas? My constraints.gridy values are correct but they just don't
> seem to be getting obeyed when I add the textfields to the Jpanel
I finally fixed this by removing all components from the specific JPanel
I was working with and then re-adding them everytime a new textfield was
added, and right before repainting i would actually add the new
textfield. That took care of the misplacement of the new one.