Animating under components

I have a simple animation routine that updates every few miliseconds (based on the individual object) that is being called by a seperate Thread. The animation only needs to occur in a specific JPanel but I'm having the specific problem of the animated images appear above other components that happen to be in front of the panel at the time - namely the parent JPanel's menus. Currently, the thread (within the panel) calls "animationMethod(this.getGraphics());".
This was not originally the problem, when I called repaint() and drew the simple animation in the paintComponent method. However, the updates were so frequent that the remaining components would not update until selected, so if the window was minimized or moved off screen, the components would vanish until intereacted with again.
Since solving either problem would help me through this, I'd appreciate a solution to either (or both, if you're feeling generous and/or wise). I hope I've given enough information. Thanks in advance!

This was not originally the problem, when I called repaint() and drew the simple animation in the paintComponent method. This would be the better approach.
so if the window was minimized or moved off screen, the components would vanish until intereacted with again.Well, you have a bug with your code. We have no idea what your code looks like. With your vague description of the problem I'm not sure how you expect us to help.
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.
I've posted some simple animation code that may help you out "timeranimation" and "timeranimation2". You can search the forum to find them.

Similar Messages

  • How to disable the animation under mouse pointer [KDE] ?

    The computer is an old one. Thus the animation of app icon under mouse in kde is sluggish and jumpy.
    Can I disable it?
    already found. it is in the appearance -> launch feedback
    Last edited by desper (2008-05-31 15:08:48)

    Suppose one wants to let an Applet user to enter a new item in a JComboBox
    and the permission is given whenever the blank item (which is one existing
    item in the JComboBox designed by the programmer) is selected. However,
    when one selects the blank item, the cursor does not blink at the beginning
    of the blank (similar to a JTextField, the cursor is not at the left end). So if the
    user does not left-shift the cursor, after entering an item, for example "cat",
    the item appears as " cat ", and NOT "cat " as desired. So the key is
    to set the cursor at the beginning so that users do not need to left-shift the
    cursor (save users some work) to get the desired "cat ".

  • Using animated text components

    Is there a way to figure out how many frames a text effect
    will need to complete it's cycle by looking at the component
    inspector.
    Or is it just a trial and error kind of thing. I downloaded
    the supreme4 effects and they are pretty cool.
    thank you
    kevin

    PS 3D text and AE 3D text at this point are two completely different, incompatible things. You cannot even import 3D PSDs because due to running out of time and resources to do it, it has been stripped from CS6, while it existed in CS5.5 down to CS4. So whatever you do, you will have to re-create it from scratch in AE. If you use native text layers, then yes, they will be able to use the text animators to allow animating letters separately as will creating each extrusion as a separate shape layer. many ways to skin the cat.
    Mylenium

  • Help with dispatching JTable event to underlying components in a cell.

    Hello..
    I have a JTable in which i show a panel with clickable labels.. I found that jTable by default doesnt dispatch or allow mouseevents to be caught by underlying elements..
    i need help with dispatching an event from jTable to a label on a panel in a jTable cell.. below is the code i have come up with after finding help with some websites. but i couldnt not get it right.. my dispatched event seems to go back to the jtable itself ..
    any help or suggestion is appreciated..
    Thanks
    'Harish.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.table.*;
    * @author  harish
    public class tableDemo extends javax.swing.JFrame {
        JTable jTable1;
        testpane dummyPane;
        /** Creates new form tableDemo */
        public tableDemo() {
            initComponents();
            //table settings
            String[] columnNames = {"Task", "Action"," "};
            Object[][] data = { };
            DefaultTableModel model = new DefaultTableModel(data, columnNames) {
              // This method returns the Class object of the first
              // cell in specified column in the table model.
            public Class getColumnClass(int mColIndex) {
                int rowIndex = 0;
                Object o = getValueAt(rowIndex, mColIndex);
                if (o == null)
                    return Object.class;
                } else
                    return o.getClass();
            jTable1 = new javax.swing.JTable(model);
            jTable1.addMouseListener(new MouseAdapter(){
              public void mouseClicked(MouseEvent e){
                  System.out.println("Clicked");
                  handleTableMouseEvents(e);
                 //invokeExternalApp("http://www.pixagogo.com");
              public void mouseEntered(MouseEvent e){
                  System.out.println("Entered");
                  //handleTableMouseEvents(e);
              public void mouseExited(MouseEvent e){
                  System.out.println("Exited");
                  //handleTableMouseEvents(e);
            jTable1.setRowHeight(100);
            jTable1.getTableHeader().setReorderingAllowed(false);
            jTable1.setBackground(new java.awt.Color(255, 255, 255));
            jTable1.setGridColor(new Color(250,250,250));
            jTable1.setShowGrid(true);
            jTable1.setShowVerticalLines(true);
            jTable1.setShowHorizontalLines(false);
            jTable1.setFont(new Font("Arial",0,11));
            jTable1.setMaximumSize(new java.awt.Dimension(32767, 32767));
            jTable1.setMinimumSize(new java.awt.Dimension(630, 255));
            jTable1.setPreferredSize(null);
            jTable1.setBackground(new Color(255,255,255));
            int vColIndex=0;
            TableColumn col = jTable1.getColumnModel().getColumn(vColIndex);
            int width = 100;
            col.setPreferredWidth(width);
            //add item to 2nd cell       
            Vector vec = new Vector();
            vec.addElement(null);
            dummyPane = new testpane();
            vec.addElement(dummyPane);
            ((DefaultTableModel)jTable1.getModel()).addRow(vec);
            jTable1.repaint();
            this.getContentPane().add(jTable1);
            jTable1.getColumn("Action").setCellRenderer(
              new MultiRenderer());
        protected void handleTableMouseEvents(MouseEvent e){
            TableColumnModel columnModel = jTable1.getColumnModel();
            int column = columnModel.getColumnIndexAtX(e.getX());
            int row    = e.getY() / jTable1.getRowHeight();
            testpane contentPane = (testpane)(jTable1.getModel().getValueAt(row, column));
            // get the mouse click point relative to the content pane
            Point containerPoint = SwingUtilities.convertPoint(jTable1, e.getPoint(),contentPane);
            if (column==1 && row==0)
            // so the user clicked on the cell that we are bothered about.         
            MouseEvent ev1 = (MouseEvent)SwingUtilities.convertMouseEvent(jTable1, e, contentPane);
            //once clicked on the cell.. we dispatch event to the object in that cell
         jTable1.dispatchEvent(ev1);
        private void initComponents() {
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
            setBounds((screenSize.width-528)/2, (screenSize.height-423)/2, 528, 423);
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {
            System.exit(0);
         * @param args the command line arguments
        public static void main(String args[]) {
            new tableDemo().show();
        // Variables declaration - do not modify
        // End of variables declaration
        class testpane extends JPanel{
            public testpane(){
            GridBagConstraints gridBagConstraints;
            JPanel testpane = new JPanel(new GridBagLayout());
            testpane.setBackground(Color.CYAN);
            JLabel lblTest = new JLabel("test");
            lblTest.addMouseListener(new MouseAdapter(){
              public void mouseClicked(MouseEvent e){
                  System.out.println("panelClicked");
              public void mouseEntered(MouseEvent e){
                  System.out.println("panelEntered");
              public void mouseExited(MouseEvent e){
                  System.out.println("panelExited");
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 0;
            gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
            testpane.add(lblTest,gridBagConstraints);
            this.add(testpane);
    class MultiRenderer extends DefaultTableCellRenderer {
      JCheckBox checkBox = new JCheckBox();
      public Component getTableCellRendererComponent(
                         JTable table, Object value,
                         boolean isSelected, boolean hasFocus,
                         int row, int column) {
        if (value instanceof Boolean) {                    // Boolean
          checkBox.setSelected(((Boolean)value).booleanValue());
          checkBox.setHorizontalAlignment(JLabel.CENTER);
          return checkBox;
        String str = (value == null) ? "" : value.toString();
        return super.getTableCellRendererComponent(
             table,str,isSelected,hasFocus,row,column);
        return (testpane)value;
    class MultiEditor implements TableCellEditor {
      public MultiEditor() {
      public boolean isCellEditable(EventObject anEvent) {return false;}
      public boolean stopCellEditing() {return true;}
      public Object getCellEditorValue() {return null;} 
      public void cancelCellEditing() {}
      public boolean shouldSelectCell(EventObject anEvent) {return false;}
      public Component getTableCellEditorComponent(JTable table, Object value,
                  boolean isSelected, int row, int column) {
        if (value instanceof testpane) {                       // ComboString
          System.out.println("yes instance");
        return null;
      public void addCellEditorListener(javax.swing.event.CellEditorListener l) {
      public void removeCellEditorListener(javax.swing.event.CellEditorListener l) {
    }

    any help on this.. anybody. ?

  • Lagging animations under yosemite - retina macbook pro

    Can somebody help me please that after the update to yosemite(RMBPRO), I have a lot of laggs with the animation such like when im opening the Launchpad ang getting in a folder. When this animations starts it lagging when the folders contain more than 2 applications.
    Please help me what can i do for.

    See my reply in this post, immediately return animations to pre-Yosemite butteryness:
    Re: Yosemite OS UI animation lag

  • No icons under Components

    Hi,
    I ma very new to Visual Composer. When i created a new model by navigating to Model -->New Model menu, i am not able to see the any icons such as iView icon under the Compose Model Window.
    Can anybody tell the reason behind it?
    Thanks,
    Prashant

    Prashant,
    Hoep you've installed adobe sgv and msxl parser. Check out any of the VC guides on sdn and you'll see the list of pre-requisites for working with vc.
    As for the error msg: "Failed to connect to backend system....",
    this is an authorization issue. get the portal team to check if they've mapped ur portal userid with an userID (with relevant authorizations) on the target backend systems.
    prachi

  • Help me,JSP is not recognizing the class which in in jar under root of ear

    <%@ page import="com.sample.components.HttpUtil"%>
    I am not able to get the HttpUtil class in my JSP.Above is my declaration .I am getting compilation error.
    The HttpUtil class is under components package,which was in components.jar.
    And it is kept under root of ear.And the classpath for web is having entry of that jar.
    Please help me

    I changed the <form> in the jsp to div and its working fine. I do not need to have comments in JavaScript funcion() anymore. I don't know why that made the difference though? According to:
    http://www.w3schools.com/tags/tag_form.asp
    The <form> tag is used to create an HTML form for user input.
    The <form> element can contain one or more of the following form elements:
    <input>
    <textarea>
    <button>
    <select>
    <option>
    <optgroup>
    <fieldset>
    <label>
    An HTML form is used to pass data to a server.
    I do have <button> and also send the data - the value of checkboxes - to server. So I think it should also work with <form>.
    Please let me know if you have any idea. Thanks.

  • Managing files in CQ components folder...

    Hi,
    I am a newbee in CQ development.
    I start to develope many components in "components" folder.
    Now, the folder has too many files inside and I realized that I need to sort related components and put them in a folder.
    If I create a folder under the  "components" and put some files under this folder, would the components still work?
    If not, what's the best practice manage many components files under "components" folder?

    The components still work even if you place them under a new folder.
    Answering the other question , please refer forms folder in /libs/components node .
    This might give you an insight on how to use the components and the best practices.

  • Where is the Anime section?

    It used to be in Animation under TV series...any ideas?
    Thanks

    Bill, try these links and notice the differences. You'll see what I mean
    http://forums.adobe.com/community/premiere/hardware_forum
    http://forums.adobe.com/community/premiere/hardware_forum?view=overview
    http://forums.adobe.com/community/premiere/hardware_forum?view=discussions

  • Photoshop crashes after using transform tool in animation window!

    My photoshop (CS5 on a mac) has been crashing anytime I use the free transform tool in the animation window. It works perfectly fine in regular photoshop, but the second I switch over to animation using the select tool then the free transform tool will crash photoshop and I'll lose what I was working on. I've tried a few things already, but my problem seems to be super specific and nobody else has had this happen to them.

    Hi Haylee,
    Sorry about Photoshop CS5 crashing when you're working in the animation timeline.
    Do you get a crash log that shows up?
    Could you provide the details in that crash log here in the Forum discussion?
    Have you tried creating a new user account, and tested working with this file and animation under that user to see if it crashes there?
    blogs.adobe.com/crawlspace/2012/07/photoshop-basic-troubleshooting-steps-to-fix-most-issue s.html#Permissions
    Is PS CS5 up to date? The latest version of CS5 is 12.0.4
    Which Mac OS Version are you working on? Is it up to date?
    What happens if you create a NEW file, and create an animation timeline on that one, do you still get the same crashing behavior? Is it just with this one file?
    Regards,
    Pete

  • Menubar horisontal and Flash animation

    Hi!
    The corsor change when mouse over on spru menubar horizontal
    when there is a flash animation under - wmode - transparent is on.
    Anyone that have a clue?
    //Stef

    Put your Canvas zoom to 100%, render the footage and see if it looks any better.

  • Player in Flash + Streaming

    Good day!!
    I have a very simple player based on the components of own
    Flash, in the case MediaController. So far ok, but I am using
    a
    A streaming server ex: "
    http://201.6.80.120:8000/"
    _global.Behaviors.Sound.TESTE.loadSound ( "
    Http://201.6.80.120:8000/",
    true);
    My doubt is:
    In SWF works perfectly when opening localhost in the html not
    working
    In IE and Firefox only the times ..???????
    Someone has a player that works well?
    Thanks,

    Hello,
    I have 1 single problem with Flash Player and Windows 7 : I can't install it !
    - from Internet Explorer 8 "additional module manager" (free translation as my version of Windows7 is a french one).  Internet Explorer 8 "additional module manager" proposes Adobe Flash as additional module but then I have to select an OS, as no Windows7 is proposed, I choose Vista/XP/2000 and click on "GO" button. Something must be displayed (because I can see a little frame with a red cross) but I can't see what it is, and nothing happens then.
    - if I download the Flash installer and install it, I still can't see any Flash animation under IE8.
    If you have a solution for me, it would be great.
    Thanks in advance.
    Regards
    DD

  • Problem with setOpaque() and transparency.

    Hi,
    I want to use the glass pane of my JFrame to indicate that my application is busy doing something. I want to make the JFrame go a "grey" color, have the busy cursor and be unresponsive to clicks until the task is finished.
    I have included test code to show what I am trying to do. If you click on the "Start Busy" button, you will see what I am trying to achieve.
    My problem is that when my glass pane is painting, I seem to get some underlying components painted in unusual positions. In this example, the "Start Busy" button gets drawn at the top left-hand corner of the JFrame when the glass pane is displayed.
    H:\>java -version
    java version "1.4.2_04"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04
    Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Cursor;
    import java.awt.GridBagLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.border.EtchedBorder;
    public class Test {
        public static void main(String args[]) {
            final JFrame test = new JFrame("Transparency Test");
            JPanel panel = new JPanel(new BorderLayout());
            panel.add(new JLabel("NORTH", JLabel.CENTER), BorderLayout.NORTH);
            panel.add(new JLabel("SOUTH", JLabel.CENTER), BorderLayout.SOUTH);
            panel.add(new JLabel("EAST", JLabel.CENTER), BorderLayout.EAST);
            panel.add(new JLabel("WEST", JLabel.CENTER), BorderLayout.WEST);
            JPanel glassPanel = new JPanel();
            glassPanel.setOpaque(true);
            glassPanel.setBackground(new Color(200, 200, 200, 100));
            glassPanel.setLayout(new GridBagLayout());
            glassPanel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
            JButton busyButton = new JButton("Start Busy");
            busyButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    Runnable busy = new Runnable() {
                        public void run() {
                            Component gp = test.getGlassPane();
                            gp.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                            gp.setVisible(true);
                            gp.requestFocus();
                            try {
                                Thread.sleep(5000);
                            } catch (Throwable t) {
                                // Ignore...
                            gp.setVisible(false);
                            gp.setCursor(null);
                    Thread t = new Thread(busy);
                    t.start();
            panel.add(busyButton, BorderLayout.CENTER);
            test.setGlassPane(glassPanel);
            test.getContentPane().add(panel);
            test.addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    System.exit(0);
            test.pack();
            test.show();
    }

    You need to make the glass pane non-opaque so it will repaint the components underneath it. But when you do this the background doesn't get painted, so you need to create a custom component and paint the background yourself:
            JComponent glassPane = new JComponent()
                public void paintComponent(Graphics g)
                    g.setColor( getBackground() );
                    g.fillRect(0, 0, getSize().width, getSize().height);
            glassPane.setOpaque( false );
            glassPane.setBackground( new Color(240, 220, 220, 100) );
            setGlassPane( glassPane );

  • Downgraded Win8.1 to Win7 and now need help to find drivers

    So I didn't like Windows 8.1 and downgraded to Windows 7 64-bit SP1, formatting all the drives in the process. Now I don't have some drivers and I'm not sure which ones to download since there are like 2 indentical types of drivers for everything on the page: http://support.hp.com/us-en/drivers/selfservice/hp-15-g000-notebook-pc-series/6545564/model/7234521
    In Device Manager there are 6 things with yellow !s
    Ethernet controller
    Network controller
    PCI Device
    PCI Encryption/Decryption Controller
    SM Bus controller
    Universal Serial Bus (USB) Controller
     I'm not sure if I'm meant to provide the Device ID or Hardware IDs so please tell me to provide whichever ones. 
    And also some additional things that I think are related to drivers
    Function buttons dont work so I can't change brightness while holding fn + f2/f3. Is that the HP System Event Utility Driver?
    "The current video card may supoprt Aero with a driver that is compliant with the Windows Display Driver Model (WDDM)". Do I just the Graphics drivers on the page I put above? And which one? Or doesn't matter?
    Also under System Information > Components > Display, is it meant to be generic llike 'Standard VGA Graphics Adapter" Is that what its meant to be or will they have the specific network adapters after I install some drivers? 
    Under Components > Modem, there is nothing there
    Under Components > Ports > Serial, there is nothing there
    Under Components > USB, it says 'Standard Enhanced PCI to USB Host Controller' rather than something more speciifc. 
                         I'm comparing these to my other laptop which has pretty specific things written under those sections so I'm assuming they're to do with the drivers right? I just threw these here in case theres more underlying issues. 
    Also how would I go about installing these drivers since the USB ports dont work? Putting the drivers on a CD? 
     I would really appreciate any help provided because without these, my laptop is basically unusable. Thank you so much. 
    This question was solved.
    View Solution.

    Hi:
    Yes, you can burn the files to a CD and use those to install the drivers you need.
    You need to install the AMD Chipset and USB 3 drivers which are not on your notebook's support page.
    http://h20565.www2.hp.com/hpsc/swd/public/detail?swItemId=cp_117181_1
    Download and install both of these drivers for the usb...
    http://h20564.www2.hp.com/hpsc/swd/public/detail?s​p4ts.oid=6943835&swItemId=ob_139250_1&swEnvOid=40...
    http://h20564.www2.hp.com/hpsc/swd/public/detail?s​p4ts.oid=6943835&swItemId=ob_133037_1&swEnvOid=40...
    Reboot after each installation.
    PCI E/D Controller:  Not on your notebook's support page.
    Run this file and then manually install the driver.
    http://h20565.www2.hp.com/hpsc/swd/public/detail?swItemId=vc_133833_1
    To manually install the driver, go to the device manager and click on the PCI E/D Controller needing the driver.
    Click on the driver tab, click on update driver.  Select the Browse my computer for driver software option and browse to the driver folder that was created when you ran the file.
    That folder will be located in C:\SWSetup\sp66974.   Make sure the Include Subfolders box is checked and the driver should install.  Then reboot.
    Ethernet Controller:
    Realtek Local Area Network (LAN) Driver
    File name: sp69625.exe
    PCI Device:
    Realtek Card Reader Driver
    File name: sp69619.exe
    I don't know what model wireless card your model uses, so if you still need the wireless card driver (Network Controller), please do the following steps so I can figure that out and then I will post the link to the wireless card driver you need...
    To find the hardware ID, go to the device manager and click on the device labeled Network Controller.
    Then click on the Details tab at the top of the Network Controller window.
    Now you see a Property drop down list and it is defaulted to Device Description.
    Drop down on that list and select the second item (Hardware ID's).
    Post the top string of characters you see in the window.

  • CS5.5 AS3 FLVPlayback issue adding to stage or library

    I am unable to add the Action Script 3 FLVPlayback component to my stage or library in Flash CS5.5 when working with an action script 3 document.
    Under components in the video folder i click and drag anyone of the FLVPlayback components (FLVPlayback, FLVPlayback 2.5 or FLVPlaybackCaptioning) to the stage and nothing happens. I am unable to add it to my library as well. All the other actionscript 3 components under the Video folder work. (BackButton, BufferingBar, CaptionButton, etc...)
    If I create an actionscript 2 document the FLVPlayback component drags to the stage and adds to the library just fine. So this appears to be an actionscript 3 issue only.
    I have 2 other employees in my office using the same product and none of them have this issue. Only me.
    I have tried to uninstall the product and reinstall but nothing helps.
    I have Flash CS3 installed on my PC and the product has the same symptoms as the Flash CS5.5 trial version that I am running.
    I did not try this with Flash CS3 before I installed the CS5 trial. So I do not know if it worked prior to my CS5 evaluation.

    Microsoft Windows XP
    Professional
    Service Pack 3
    Video component
    Date Created: 3/17/2011
    Date Modified: 3/17/2011
    User folder
    Not sure what you are asking for here.
    Thanks for your assistance,
    Message was edited by: jimder

Maybe you are looking for