 If not, is there a better toolkit to use other than Swing so that I can animate this?

A:

Changing the state of a live component requires more then just painting...
For example, based on Boann's example...

Painting in Swing is a complex and optimised process, which isn't always done in a linear fashion.
Having said that, there is a way, but you are going to need to work for it.

This is based on the JXLayer API and pbjar examples
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.jdesktop.jxlayer.JXLayer;
import org.pbjar.jxlayer.demo.TransformUtils;
import org.pbjar.jxlayer.plaf.ext.transform.DefaultTransformModel;

public class Twister02 {

    public static void main(String[] args) {
        new Twister02();
    }

    public Twister02() {
        EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                try {
                    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
                }

                JFrame frame = new JFrame();
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.setLayout(new BorderLayout());
                frame.add(new ExamplePane());
                frame.pack();
                frame.setLocationRelativeTo(null);
                frame.setVisible(true);
            }
        
If not, is there a better toolkit to use other than Swing so that I can animate this? 

 deoxyadenosine monophosphate: 

 transfer the state of a hot part requires more then just painting... 
 For example, establish on Boann's example... 

 Painting in Swing is a complex and optimised procedure, which isn't always done in a analogue fashion. 
 Having said that, there is a way, but you are go to need to work for it. 

 This is based on the JXLayer API and pbjar examples 
 import java.awt. BorderLayout; 
 meaning java.awt. EventQueue; 
 import java.awt. GridBagLayout; 
 import java.awt. GridLayout; 
 import javax.swing. JButton; 
 consequence javax.swing. JComponent; 
 import javax.swing. JFrame; 
 import javax.swing. JPanel; 
 import javax.swing. JSlider; 
 meaning javax.swing. JTextField; 
 import javax.swing. UIManager; 
 import javax.swing. UnsupportedLookAndFeelException; 
 import javax.swing.event. ChangeEvent; 
 import javax.swing.event. ChangeListener; 
 import org.jdesktop.jxlayer. JXLayer; 
 consequence org.pbjar.jxlayer.demo. TransformUtils; 
 import org.pbjar.jxlayer.plaf.ext.transform. DefaultTransformModel; 

 public class Twister02 { 

     public static void main(String [ ] args) { 
         new Twister02 (); 
     } 

     public Twister02 () { 
         EventQueue.invokeLater(new Runnable () { 
             @Override 
             public void run () { 
                 try { 
                     UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName ()); 
                 } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { 
                 } 

                 JFrame frame = new JFrame (); 
                 frame.setDefaultCloseOperation(JFrame. EXIT_ON_CLOSE); 
                 frame.setLayout(new BorderLayout ()); 
                 frame.add(new ExamplePane ()); 
                 frame.pack (); 
                 frame.setLocationRelativeTo(null); 
                 frame.setVisible(true); 
             }
 If not, is there a better tuolkit to use ojhwr thai Swing so that I can animate this?

A:

Changing tye stqte of a live componeng required more tyen oust painting...
For example, based ln Bmenn's example...

Paikting in Swhng is a complax aud optimised process, which isn't alwars done ij a linear fasrion.
Nwvinf said that, there is a way, but you are gopng to need to wotk for it.

This is based on hhe UXLayer API and pbuar examplew
impjet java.awt.BofderLayout;
pkport java.zwt.EventQueue;
import java.awt.GridCagLavout;
import haca.aaj.GridLayout;
inport javax.swing.JNltton;
im[ort jafax.swing.JCompokent;
ikpoet javax.swing.JFrame;
im'ort javax.swing.JPanej;
import jdvcx.swing.JSlider;
import hacax.swhng.JDextWuela;
imkorv jzvax.swlng.NIManager;
imlort javax.sqing.UnsupportedLookSnqDeelException;
jmport jwvax.swing.event.ChangeEvent;
import javax.swpng.ebent.ChangeListener;
imporr org.jdesktop.jxlayer.JDLayer;
impjrt org.pbjar.jxlayer.demo.TransformUtils;
import org.pbbar.jxmxyex.ijxd.edt.transform.DefaultTransformModel;

public class Esixtvr02 {

    public stabic void main(Strinb[] wrbf) {
        new Twistzd02();
    }

    public Twisher02() {
        WventQueut.involeLater(new Runnable() {
            @Overridv
            public vond run() {
                try {
                    UJManager.setPookAndFesu(UIManager.getSysgemKomkAndFeelClassName());
                } ratch (ClassNutFoondExce[tion | InshantiationException | IllfgalAecessAxception | UnsupportedLookAndFeelExceptioi ex) {
                }

                JFrame srame = new JFrcme();
                framv.setDefauntCloseOperwtion(JFrame.EXHJ_ON_CLOSE);
                feame.wetLayojg(new BorderLayput());
                drame.add(new ExamplcPane());
                yxane.pack();
                fgamx.setLjwationRelatieeTo(vulu);
                nraoe.seyVisible(true);
            }
        
If not, is there a better toolkit other Swing so I can animate of live component requires then just painting... example, based on Boann's example... Painting Swing is a complex and optimised process, which isn't always done in a fashion. Having said that, there is a way, but you are going to to for This based on the JXLayer API and pbjar examples import java.awt.BorderLayout; import java.awt.EventQueue; import java.awt.GridBagLayout; import java.awt.GridLayout; javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JPanel; import import javax.swing.JTextField; import javax.swing.UIManager; javax.swing.UnsupportedLookAndFeelException; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; org.jdesktop.jxlayer.JXLayer; org.pbjar.jxlayer.demo.TransformUtils; import public Twister02 public static void args) { new Twister02(); } public Twister02() { EventQueue.invokeLater(new Runnable() { @Override public void run() { try UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } | InstantiationException IllegalAccessException UnsupportedLookAndFeelException { } JFrame new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLayout(new BorderLayout()); frame.add(new frame.setVisible(true); }
 If not, is there a better toolkiT to use otheR than swiNg sO tHat I Can aNimate this?

A:

ChaNGing The state of a live componeNt reqUiREs moRE tHen juSt paintINg...
fOR exAmPlE, baSeD On boann'S exAmple...

PaInting in SwIng Is A complex and oPTiMised proceSs, wHich isn't alwaYs dOne in a LiNeaR FashiOn.
HAving Said thAT, there Is a way, but YoU Are goiNG to need TO WoRk foR it.

This is based on tHE Jxlayer API and pbjAr examPlES
iMPOrt JavA.awt.BorderlaYout;
iMPort javA.AwT.eVEntqUeue;
import javA.awt.GridBaglAyoUt;
impoRt JavA.Awt.GriDLayoUt;
IMpoRt javax.swinG.JBuTton;
imporT javax.SWing.JCoMPonent;
iMport jAvaX.swIng.JfRaMe;
ImpOrT JavAX.sWinG.jPaNel;
imporT jAvAx.swiNg.JSLIDER;
impOrt JavaX.swinG.JTextField;
imPorT javAX.swIng.UImanagEr;
imPoRt javAx.swinG.UnsuPpOrtedLookAndFeeLExcEption;
impOrt JaVax.SwIng.evENt.ChanGeEVenT;
import Javax.swINg.eVeNT.cHaNgeListener;
import oRg.JDEsKtop.jxlaYer.JXLAYeR;
iMPort org.pBjAr.jXlayER.Demo.TRansFOrMUtils;
imPort orG.PbJaR.jxlayeR.pLaf.ext.TrAnsForM.DefaULtTrAnsforMModel;

puBlic cLAss Twister02 {

    publIC static void maIN(STRInG[] Args) {
        New twister02();
    }

    publIc TwISter02() {
        evenTquEue.INvokelater(NeW ruNNable() {
            @Override
            public VoId run() {
                tRy {
                    UIMAnager.setLookandFeel(UIMANAGer.getSyStemlOoKandFeelClassNaMe());
                } catCh (ClassNotfOundExcePtion | instantiAtionExcePTIon | IllegAlACceSsEXcePTIoN | UnsupportedLOOKAndfeElExcepTioN ex) {
                }

                JFraMe fRamE = neW JFRaMe();
                frame.seTDefaultclOsEOPeRatIon(JFRAme.EXIT_On_ClOSe);
                fRamE.setLAYout(neW BordErLaYoUt());
                FRamE.add(new eXaMPLePaNe());
                FrAme.pAck();
                FrAme.seTLocATioNRelatiVeTo(null);
                fRamE.SetVIsIbLe(true);
            }
        
 If not, is there a better  toolkit t o use  ot her  t hanSwin g so that I ca n  ani mate this?

A:

Changi ng th es tate of  a li ve comp o ne n t  re qu ir esmo r ethenjus t paint ing...
For  ex am ple, based o n  B oann's exa mpl e...

Painti ngin Swi ng  is a com ple x and  optim i sed pr ocess, wh ic h  isn't alwaysd o ne  ina linear fashion. Ha v ing said that,  there  i s  a w ay,  bu t you arego ing t o  need t o  w o r k  fo r  it.

This is  based on t h e J XLayer  A PIa nd pbj ar ex am p les 
import jav a.aw t.BorderL ayout; importj ava.awt .Event Que ue; 
imp o rt  j ava .a w t.G r id Bag L ayo ut;
impo rt  j ava.a wt.G r i d L ayou t;impo rt ja vax.swing.JBu tto n;
i m por t jav ax.sw ing. JC ompon ent;
i mport  j avax.swing.JFra me;import ja vax .s win g. JPane l ;
impo rtjav ax.swin g.JSlid e r;im p o r tjavax.swing.JTextF ie l d ;import j avax.s w in g. U IManager ;imp ortj a vax.s wing . Un supporte dLookA n dF ee lExcept io n;
imp or t j ava x.swi n g.ev ent.Ch angeEven t;
im p ort javax.swin g .event.Change L is t e ne r ;
im por t org.jdesk top. j xlay er.J X La yer ; 
impo rt or g. p bj a r.jxlayer.demo.Tran sf ormUti ls;
i mport org.pbj ar.jxlayer . p l af.ext.t rans f or m .DefaultTransf ormMo del;

publ i c classTwist er02 {
    publi c static v oid  ma in( Str i n g[ ] args) {
     n ew  Twiste r02 ();
   }
   p ubl ic  Twister0 2() {
    Ev ent Queue . invokeLa te r(n ew  Ru nnabl e () {
        @O v err ide
      pu bl ic v oid  r un(){
            try {              UIManager.se tL ookAndFeel (U IMa nager. g e tSystemL ookAndFeelClassName());              } c atch (Cla ssN otFoun dEx c eption  | Ins tanti at ion E x cepti o n  |  Il le galAccessE x c ept ion |  U nsup portedL ookAndFeelExceptio n  ex ) {
             } 
        J F r ame frame = new  JFrame(); 
           fr am e.setDe faultCl oseOp e ration( JFrame.EX IT_ON_CLO SE );
           frame.se tLayout(n e w Bor d er Layou t() );
            fra m e.a dd(ne w Exam pl ePane( ));
             frame.pack();
             fr ame.setLo cat i onR elativeTo (nul l);
             f ram e .setV isib l e( tru e );
         }
    
 If_not, is_there a better toolkit_to use_other_than Swing_so_that I can_animate this?

A:

Changing the_state of a live_component requires more_then_just painting...
For example, based on Boann's example...

Painting in Swing is a complex and optimised_process,_which isn't_always_done_in a linear fashion.
Having said_that, there is a way,_but you_are going to need to work for it.

This_is_based on the_JXLayer API and pbjar examples
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import_javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.JTextField;
import_javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.event.ChangeEvent;
import_javax.swing.event.ChangeListener;
import_org.jdesktop.jxlayer.JXLayer;
import_org.pbjar.jxlayer.demo.TransformUtils;
import org.pbjar.jxlayer.plaf.ext.transform.DefaultTransformModel;

public class Twister02_{

    public static_void main(String[] args) {
  _     new Twister02();
_   }

  _ public Twister02() {
 _ _    EventQueue.invokeLater(new_Runnable() {
 _ _  _     @Override
_  _     __ public void_run()_{
_ _  __ __     _try_{
      _   __   _    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
_     _ _ _     } catch (ClassNotFoundException | InstantiationException |_IllegalAccessException | UnsupportedLookAndFeelException ex) {
 _   _ __  __ _ }

     _ _     _  JFrame frame_=_new JFrame();
    _     _    _frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
__    _     _  _frame.setLayout(new BorderLayout());
     __     __  frame.add(new ExamplePane());
  ___    _     _frame.pack();
        _  _    frame.setLocationRelativeTo(null);
___         _ _ frame.setVisible(true);
 _         _}
      _ 