tags:

views:

14

answers:

1

I have an AWT Label inside a Panel with FlowLayout. I want to dynamically change the Labels text and resize it to the required width.

I have only found answers to the Swing version of this problem (setPrototypeDisplayValue()), but I have to stick with AWT since this is a homework.

A: 

You should be able to call invalidate(), which will then tell the parent container (your Panel) to redraw itself.

http://download.oracle.com/javase/1.4.2/docs/api/java/awt/Container.html#invalidate()

Codemwnci
That didn't do anything, but looking trough that docpage I've found doLayout() which does exactly what I wanted. Thanks!
sekmet64