Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #3810 > unrolled thread

JTabbedPane when smooth t

Started by"Stefan Rybacki" <stefan.rybacki@THRWHITE.remove-dii-this>
First post2011-04-27 15:47 +0000
Last post2011-04-27 15:47 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.lang.java.gui


Contents

  JTabbedPane when smooth t "Stefan Rybacki" <stefan.rybacki@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000
    Re: JTabbedPane when smoo "John B. Matthews" <john.b..matthews@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000

#3810 — JTabbedPane when smooth t

From"Stefan Rybacki" <stefan.rybacki@THRWHITE.remove-dii-this>
Date2011-04-27 15:47 +0000
SubjectJTabbedPane when smooth t
Message-ID<4886fab2$1@news.uni-rostock.de>
  To: comp.lang.java.gui
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

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [next] | [standalone]


#3812 — Re: JTabbedPane when smoo

From"John B. Matthews" <john.b..matthews@THRWHITE.remove-dii-this>
Date2011-04-27 15:47 +0000
SubjectRe: JTabbedPane when smoo
Message-ID<nospam-BA1B41.14133223072008@aioe.org>
In reply to#3810
  To: comp.lang.java.gui
In article <4886fab2$1@news.uni-rostock.de>,
 Stefan Rybacki <noemail@noemail.foobar> wrote:

> 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?

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

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.gui


csiph-web