
Animate Transitions Between Tabs #8
Chapter 1, Basic JComponents
|
37
HACK
Another Example
Because TransitionTabbedPane makes it so easy to build new animations, I
thought I’d add another one. This is the old venetian blinds effect, where
vertical bars cover the old screen and uncover the new one; Example 1-19
puts it together.
JTabbedPane tab = new InOutPane( );
tab.addTab("t1",new JButton("Test Button 1"));
tab.addTab("t2",new JButton("Test Button 2"));
frame.getContentPane( ).add(tab);
frame.pack( );
frame.show( );
}
}
Figure 1-23. Two tabs, before transition effect begins
Figure 1-24. Tab transition at mid-point
Example 1-18. Testing out tabbed animation transitions (continued)