Yes, I tried to get the size of the JTextField and assign it to the jdialog just before the d.setVisible(true); in this way d.setPreferredSize(this.getSize());
In fact if I look at the size of the jdialog (d.getSize()) the size has changed but nothing happens visually.
The jdialog size only changes when I call setPreferredSize when I start the program.
I need it to change and it's always the same size as the jtextfield.
Thanks for your response, I have already done what you asked for.
0
down vote
favorite
I'm using a "JSuggestField" which is a modification of JTextField that's capable of showing suggestions, the thing is it uses a JDialog to show those suggestions and I need it to be shown always as wide as the jTextField (so if jTextField becomes wider then JDialog should change with it)