aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JFrame re-sizing, what methods are called? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFrame re-sizing, what methods are called?" Watch "JFrame re-sizing, what methods are called?" New topic
Author

JFrame re-sizing, what methods are called?

Harold Lime
Ranch Hand

Joined: Jul 20, 2009
Posts: 38
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
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4658
    
    5

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.


luck, db
There are no new questions, but there may be new answers.
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2215
    
    7
Works fine for me. I used code like the following:



For more help you should create a SSCCE, that demonstrates the incorrect behaviour.
Harold Lime
Ranch Hand

Joined: Jul 20, 2009
Posts: 38
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JFrame re-sizing, what methods are called?