Link to home
Start Free TrialLog in
Avatar of youneverknoweverything
youneverknoweverything

asked on

Swing JTabbedPane/Jpanel Repaint Problem

I Have a swing application that works fine in my faster pc but behaves unexpectedly in the clients slower pc. I have verified that the jre used is same on both the machines.

My application has a topMain , centreMain and bottomMain JPanel which are inside a mainPanel which uses border layout.

topMain panel  has three other JPanels in it with labels and buttons all have layouts attached.

centreMain has a JTabbedPane which has two tabs each havinh a Jpanel which has a TableModel.

bottomMain has two buttons.

THe problem is that in the clients machine when the application is resized or moved or a native window is opened on top of the application the topPanel and bottomPanel do not repaint properly.
That is the buttons are invisible the colour of the top panel is not refreshed and I cannot see any content of the top and bottom panels either. The tabbed pane is visible though.

If I hover mouse over the bottom buttons they appear again. INterestingly as soon as I click on one of the tabs of the JtabbedPane the whole application refreshes and I can again view everything.

What can be the problem? I am not calling repaint in my code anywhere. THis code has worked for years in the same client machine and the problem has started only after I added a JTabbedPane recently. Also it works perfectly in my machine.

Any ideas on the possible cause will be appreciated. I can not paste the code unfortunately.

Thanks

The Centre Panel
Avatar of Mick Barry
Mick Barry
Flag of Australia image

any custom painting?
Avatar of youneverknoweverything
youneverknoweverything

ASKER

No there is no custom painting, there are two cell rendereres thought that render the cells of the two tabnles inside the JTabbedPain. I doubt that this is causing the problem though.
easy way to check would be to comment out the renderers and see if the problem remains
well the problem is I am unable to replicate the problem in my machine and can not bother the client all the time to test this issue. FUrther the renderers have been there since teh starting.
bit hard to help you without more details
Wow, a very difficult to diagnose problem indeed.

If it only occurred when the client resized the window, you might consider disabling that ability,
but that has the potential of introducing some "customer annoyance" issues, not that these
don't exist already.

You indicate that you have checked the jre version on both machines.

What version is being used?
ASKER CERTIFIED SOLUTION
Avatar of youneverknoweverything
youneverknoweverything

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you shouldn't be setting the height of column in your renderer (your renderer shouldn't manipulate the table at all)
@Objects Where should I be setting the height of my table row then? My Table has a Super Type row that I want to have 30 px height because it has combobox, below the super type row there are subtype rows whoose height I want to set as 20px.
you should be setting the row height when you setup the table
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.