Forums Register Login

JFrame re-sizing, what methods are called?

+Pie Number of slices to send: Send
I've got a bit of a problem, I'm using a transparent JTable, when I change the data on it I can still see the old value that was in the cell before.

The only way I can get rid of it (so far) is to resize the frame, so what methods are called when a frame resizes?

I've tried invalidate(), validate() and doLayout() on the contentPane but none of them are helping.

For now I'm stuck using:
frame.setSize(frame.getWidth(), frame.getHeight() + 1);
frame.setSize(frame.getWidth(), frame.getHeight() - 1);

There's got to be a better way.

Any help greatly appreciated.

Thanks

Harry
+Pie Number of slices to send: Send
You could try a repaint() on the JTable's parent (note: that isn't the JFrame).

How/why did you implement transparency for the table?

Lastly, to get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable, Example Program) that clearly demonstrates the problem.
+Pie Number of slices to send: Send
Works fine for me. I used code like the following:



For more help you should create a SSCCE, that demonstrates the incorrect behaviour.
+Pie Number of slices to send: Send
Sorted.

I had set the background of the one of JPanels involved to new Color(0,0,0,0) rather than setOpaque(false).

Thanks for the help.

Harry
Destiny's powerful hand has made the bed of my future. And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1112 times.
Similar Threads
Centering Window
KeyListener woes
Drawing Problems with JPanel /Jframe need optimize solution.
Animation
Too many ActionEvents after button press.
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 09:33:13.