Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JTabbedPane when smooth transition target tab pops up for an instant

2 views
Skip to first unread message

Stefan Rybacki

unread,
Jul 23, 2008, 5:32:34 AM7/23/08
to
Hi there,

I try to implement a JTabbedPane version that provides a smooth
transition when changing tabs.
This is done by overriding setSelectedIndex. There the current content
is stored in a BufferedImage and then super.setSelectedIndex is called.
In the paint method the bufferedImage is used to draw above content
painted by super.paint using an AlphaComposite with alpha values from 0
to 1.
This works as expected as long as there are no JTextFields in the target
tab. In that case the text fields pop up for an instant on tab change
(just the text fields no other component like JButton, JCheckBox etc.)
After that the transition goes smoothly.
Also weird is that this happens only the first time that tab is
displayed, afterwards changing to that tab works as expected.
The effect only occurs again, when the tabbed pane changes its bounds.

Any ideas on where to look to solve this issue?

Thanks in advance
Stefan

John B. Matthews

unread,
Jul 23, 2008, 2:13:32 PM7/23/08
to
In article <4886fab2$1...@news.uni-rostock.de>,
Stefan Rybacki <noe...@noemail.foobar> wrote:

If the image is not completely opaque, might this be the problem:

<http://java.sun.com/javase/6/docs/api/javax/swing/JComponent.html#paintC
omponent(java.awt.Graphics)>

--
John B. Matthews
trashgod at gmail dot com
home dot woh dot rr dot com slash jbmatthews

0 new messages