Panel Refresh

hi all,
i need a trick to avoid the flicker in my Panel when i update the information of their labels. somebody tell me something about double buffering, what's that?
thanks

Hi
To explain double buffering , consider u are displaying some labels using Graphics.drawString() method .
As the first label displays on the screen ,immediately the second label displays on the screen, and immediately the third one .
This creates flickering on the screen.
In Double buffering , all the content to be shown on screen is renderered on an off screen image, and then
this offscreen image is painted on the screen , making the rendering appear smooth.

Similar Messages

  • Modal panel refreshing the parent

    Hi ,
    I am facing a strange issue.
    I have a parent page and a modal panel opening from the parent. The modal panel displays a data table with pagination.
    When a move to each page(by clicking the page number) of the data table, the parent page getting refreshed and the it gets more darker and darker!!!!(I believe because of the modal nature of the child panel).
    I have included the modal panel as a jsp include
    <jsp:include flush="true" page="/jsf/accountGroupLov.jsp"/>
    Inside accountGroupLov.jsp , i have a dialog panel, where i render the data table.
    <p:dialog  header="#{finmsg.accountGroup_search}" modal="true" width="400px" rendered="#{accountGrpLovHandlerBean.lovVisible}"
         Where I am using primefaces dialog component.
    I dont want the parent page to be refreshed each time I navigate to different pages of the data table in the modal panel.
    Can anybody give a clue?
    Thanks in advance.
    Shaiju

    Hi,
    I have a similar scenario where I want to insert the data to a table and then close the popup window on a 'Apply & Return' button.
    On the button I have set target as URL and URL Target as javascript:passBack2();
    passBack2() is the call to java script I am using from Denes Kubicek application.
    <script language="JavaScript">
       function passBack2()
          doSubmit();window.opener.doSubmit();window.close();
    </script>I have PL/SQL process(After Submit) which triggers on this button to insert the data into the table.
    But when I invoke the popup and enter the data and click on 'Apply & Return', it navigates back to the calling page and refreshes it without executing the PL/SQL process.
    Any thoughts on this please.
    Thanks,
    Raj.

  • Catalyst+awesome35 panel refresh problem

    Hello,
    met anyone problems with this combination and panel update problem?
    I tried catalyst stable and beta from arch wiki, and awesome 3.5.1 and 3.5.2 ... And I have problem that, when I switch to any nonempty tag, then my upper panel(tasklist,taglist) will not be refreshed(re-render,update ....). There are still old applications visible. I must take some action, for example focus window, or when CPU widget refresh, then it will be fine and right tag/task list appears.
    I tried:
    catalyst 13.4   13.11
    awesome 3.5.1   3.5.2
    X 1.13   1.14
    In all combinations I have this problem.
    I tried
    awesome 3.4, with this version all is OK, but I dont want learn deprecated configuration.
    I tried
    open source vga drivers, with this driver all is OK. But it consumes much more power.
    Thanks for help.
    Last edited by kubco2 (2013-10-14 09:19:51)

    Not sure if it could help but I had a problem in awesome 3.5.1 (and wasn't present in 3.4). And I think the problem you describe is the same I had.
    In /etc/X11/xorg.conf put this
    Section "Extensions"
    Option "Composite" "Disable"
    EndSection

  • CSS Styles Panel - Refreshing

    I've recently started using Dreamweaver, and am learning
    using the Tutorials on-line.
    I was successfully following the CSS design tutorials,
    However now, whenever I edit a document (or create a new
    one), the CSS Styles panel "
    unloads" and tells me that I have made changes to the code,
    and "must click Refresh or press F5"
    This did not happen before / yesterday.
    Is there a setting somewhere which has been switched off?
    This is annoying since it means that I cannot use the
    predictive text features of Dreamweaver
    like typing "<div " and seeing the options.
    manually editing the CSS file still provides the auto-text.
    Thanks,
    Rem

    Adendum;
    It's also happens to the Tag panel, and Properties.
    This even happens if no style sheet is linked
    ??????

  • Panel refresh during resize

    Hello, everyone!
    I have a trouble working with resizing a components placed on the panel group layout.
    When i resize a panel an appropriate actions are invoked and panel resizes but the content of a panel doesnt refresh, it is still old.
    How can i make a refresh a panel during resize?
    Thanks.

    Hi.
    This is a runtime problem.
    The first way I resize a panel - is programmatically call a procedure like this:
    function collapseVertSplitter(arg) {                   
    comp = AdfPage.PAGE.findComponent('psVertical');
    comp.setProperty("collapsed", arg);
    There are two methods which are invoked during resize:
    onMapWidthResize = function (event) {
    var tElem = document.getElementById('mapPanel');
    var tWidth = tElem.offsetWidth;
    var newWidth = (tWidth - 20);
    document.getElementById('distCanvas').style.width = newWidth + 'px';
    document.getElementById('mover').style.width = newWidth + 'px';
    document.getElementById('maptable').style.width = newWidth + 'px';
    document.getElementById('maptable').style.clip = 'rect(0px 600px ' + newWidth + 'px ' + '0px)';
    document.getElementById('mvMap').style['width'] = newWidth + 'px';
    var source = event.getSource();
    AdfCustomEvent.queue(source, "MapWidthSizeListener", {width : newWidth}, true);
    event.cancel();
    and the second one:
    onMapHeightResize = function (event) {
    var tElem = document.getElementById('mapPanel');
    var tHeight = tElem.offsetHeight;
    var newHeight = (tHeight - 70);
    document.getElementById('distCanvas').style.height = newHeight + 'px';
    document.getElementById('mover').style.height = newHeight + 'px';
    document.getElementById('maptable').style.height = newHeight + 'px';
    document.getElementById('maptable').style.clip = 'rect(0px ' + newHeight + 'px ' + tElem.offsetWidth + 'px' + ' 0px)';
    document.getElementById('mvMap').style['height'] = newHeight + 'px';
    var source = event.getSource();
    AdfCustomEvent.queue(source, "MapHeightSizeListener", {height : newHeight}, true);
    event.cancel();
    This methods are called from the client listener:
    <af:clientListener method="enforcePreventUserInput"
    type="propertyChange"/>
    <af:clientListener type="propertyChange"
    method="onMapWidthResize"/>
    <af:serverListener type="MapWidthSizeListener"
    method="#{MViewer.mapWidthSizeChange}"/>
    <af:clientListener method="enforcePreventUserInput"
    type="propertyChange"/>
    <af:clientListener type="propertyChange"
    method="onMapHeightResize"/>
    <af:serverListener type="MapHeightSizeListener"
    method="#{MViewer.mapHeightSizeChange}"/>
    The second way to resize a panel - is manually drag a mouse pointer.
    So, when I manually resize a panel - everything is okey, but if a call a method collapseVertSplitter() - a panel resizes but the content of a panel doesnt refresh.
    Can it be a problem that when an action is invoked the panel by this moment has not resized yet? Maybe i need something like "after resize" event handler?
    The version of JDeveloper is 11.1.1.3.0.
    Thanks.
    Edited by: user8019201 on Feb 2, 2011 2:15 AM

  • Xfce4.8 down panel refreshes and is annoying

    Hello. I have Xfce4.8 installed and i have that panel down there, for launching apps. The problem is, when i play some videos in SMPlayer, or doing anything, surfing the Internet, it refreshes (nearly all icons on it disappear, and reappear after 2 seconds), while the video hangs for that time (e.g. panel is refreshing 2 seconds and the video is hanging that much) and the sound is going. It happens very often, and it is really annoying. It wasn't happening earlier, how do i fix this ? If needed, i can post xorg.0.log
    Thanks in advance

    Thanks for pointing that out. I deleted the contents of that folder, logged out and in again, but it's still happening. The interesting thing is, i have a thumbnail image, big 5 KB and it shows an image from the blank desktop, without any open programs. I have running - dropbox client, screenlets, sylpheed client, wicd, workrave. I don't remember about updating anything and making problems

  • Navigation Panel Refresh

    Hi,
    I use Web templates in 2004s, in result display, i can drag and drop caracteristics. But the navigation panel doesn't refresh when drag and drop. I have to click on the navigation pan to refresh it !
    Is there any oss note to correct this, or any parameter i don't know ?
    Thanks

    Hi Damien,
    I tried to find the solution in SAP service market place apart from SDN forums as i also have the same problem. It will be great if you can raise an OSS note for this issue to SAP and they will get back to you.
    Hope it helps. If you find it helpful please assign some points
    Regards
    Vishwanath

  • Services panel Refresh command fails

    I'm unable to make the Refresh command work. I'm attempting to ue it withj BlazeDS, and is currently using version 4 of Blaze. I've used it both with Blaze direclty, as well as running Blaze under Spring. Same problem. I am able to establish the server from scratch, but the Refresh command always fails updating the service. I want to use Refresh after making server side changes (eg, changed the types of some DAOs being passed back from the server, or added some new server methods).
    Here's what I get in the error log:
    Description Resource Path Location Type
    The destination "fooService" used by service "FooService" was not found in the services configuration file. Update the config file and refresh the service in the Data/Services view.
    But clearly there's nothing wrong with the "services configuration file", since it works perfectly if I remove the service and then immediately add it back in. So it seems to be something in he FB end that's getting confused.
    Any suggestions are most welcome. Re-creating the service (and re-establishing all data management and paging stuff) for every server side change is getting a bit tedious.
    -JM

    >
    > since re-creating the service works every time, it seems to indtcate  that it is the Refresh command thatäs broken,
    > not the server side RDS  mechanism as such.
    >
    Good point here.
    Please try to send a small sample. and the series of stes to reproduce the problem because on my sample all seems to work fine. And if possible file a defect with the sample and steps. You can file the defect @ http://bugs.adobe.com/jira
    Do mention the following:
    1. Versions of Webserver, BlazeDS
    2. Attach a sample app which shows the current problem
    3. Steps to be followed
    Anand Gaurav | Flex Builder Team | Adobe Systems

  • Panel refreshing and double buffering

    Hi all swing experts
    Could any one solve the problem.I have an application,which is having a JSplit pane.
    On the left of the JSplit pane , there is a tree. When u click a node from the tree
    that will be selected and you can place that node into the right side panel.
    And the same way you can click an another node (redirection or sink) and drop into the
    panel.you can draw a line by clicking the source and the sink / or redirection.
    The line is getting drawn dynamically by getting the x,y coordinates of the node.
    once the line is drawn am storing the line into vector, since this is getting drawn
    dynamically once if i minimize and maxmize it will disappear.
    For avoiding this am trying to redraw the old line from the vector when the window
    is getting activated, here the problem starts it draws the line but the line
    is getting disappeared immly.
    HOW DO I SOLVE THIS?
    is it possible to solve this problem with double buffering tech? if so how?
    PL HELP.
    Software - Visual Tool
    Last Modified -7/23/01
    sami
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.border.TitledBorder;
    import javax.swing.event.TreeSelectionEvent;
    import javax.swing.event.TreeSelectionListener;
    import javax.swing.plaf.FontUIResource;
    import javax.swing.tree.*;
    import java.lang.System;
    import java.net.*;
    import java.awt.image.*;
    import javax.swing.event.*;
    public class CompTree extends JFrame implements TreeSelectionListener,WindowListener{      
    // Swing components declarations     
         public JSplitPane jSplitPane1,jSplitPaneTop;
         public JScrollPane treeScrollPane,splitScrollPane;     
    public JTree mainTree,jtree ;
    public static DefaultMutableTreeNode topchildnode1, topchildnode2, topchildnode3,toptreenode;
    DrawPanel dp = new DrawPanel();
         public int i=0;
         public int j=0;
         public int flag = 1 ;
         public String var,S,R,D;
    Frame fr = new Frame("GUI TOOL");
    public CompTree()
         File nFile = null ;     
         mainTree = DrawTree(nFile,"N") ;
         mainTree.updateUI();
         mainTree.setBackground(new Color(105,205,159));     
              // Tree is getting added into scroll pane
         treeScrollPane = new JScrollPane(mainTree);
              treeScrollPane.setVerticalScrollBarPolicy(javax.swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    treeScrollPane.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
              splitScrollPane = new JScrollPane();
              splitScrollPane.setViewportView(dp.panel1);          
              splitScrollPane.setVerticalScrollBarPolicy(javax.swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    splitScrollPane.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    jSplitPane1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,treeScrollPane,splitScrollPane);          
         jSplitPane1.setOneTouchExpandable(true);
         jSplitPane1.setContinuousLayout(true);
    jSplitPane1.addComponentListener(new ComponentAdapter(){
              public void componentResized(ComponentEvent e) {      
                   System.out.println("Componenet resized");
              flag = 1;
              paint(dp.panel1.getGraphics());          
    //Provide minimum sizes for the two components in the split pane
    Dimension minimumSize = new Dimension(150,75);
              splitScrollPane.setMinimumSize(minimumSize);
    //Provide a preferred size for the split pane
    jSplitPane1.setPreferredSize(new Dimension(700, 500));
              //setContentPane(jSplitPane1);
              fr.add(jSplitPane1);
              fr.setSize(700,500);
              fr.setVisible(true);          
              fr.addWindowListener(this);     
    public void windowActivated(WindowEvent we){
         System.out.println("activated");
         dp.draw();
    public void windowClosed(WindowEvent we){System.out.println("closed");}
    public void windowIconified(WindowEvent we){System.out.println("iconified");}
    public void windowDeiconified(WindowEvent we){
         dp.draw();
         System.out.println("deiconified");
    public void windowDeactivated(WindowEvent we){System.out.println("deactivated");}
    public void windowOpened(WindowEvent we){
         dp.repaint();
         System.out.println("opened");
    public void windowClosing(WindowEvent we){
         System.exit(0);
         System.out.println("closing");
         public void valueChanged(TreeSelectionEvent e) {
              DefaultMutableTreeNode node = (DefaultMutableTreeNode)
              mainTree.getLastSelectedPathComponent();     
              String strRootNode = "" ;
              try{
                   Object rootNode = node.getRoot();          
                   strRootNode = rootNode.toString() ;
              catch(Exception eRoot)
                   System.out.println("Error in geting Root Node");
              if (node == null) return;
              Object nodeInfo = node.getUserObject();          
              TreeNode ParentNode = node.getParent();               
              final String strParentName = node.toString() ;
                   if (strParentName.equals("Source"))
              System.out.println("Before source");     
              var = "S";
              System.out.println("This is source");
              else if (strParentName.equals("Redirection"))
    var ="R";
              else if (strParentName.equals("Sink") )
                   var ="D";
              else
                   if ( strRootNode != strParentName){
         public JTree DrawTree( File file, String strIsValid)
                   jtree = new JTree();
                   toptreenode = new DefaultMutableTreeNode("Start");
                   topchildnode1 = new DefaultMutableTreeNode("Source");
                   topchildnode2 = new DefaultMutableTreeNode("Sink");
                   topchildnode3 = new DefaultMutableTreeNode("Redirection");
                   toptreenode.add(topchildnode1);
                   toptreenode.add(topchildnode2);
                   toptreenode.add(topchildnode3);
                   jtree.putClientProperty("JTree.lineStyle", "Angled");
                   DefaultTreeModel defaulttreemodel = new DefaultTreeModel(toptreenode);
                   jtree.setModel(defaulttreemodel);
                   DefaultTreeSelectionModel defaulttreeselectionmodel = new DefaultTreeSelectionModel();
                   defaulttreeselectionmodel.setSelectionMode(1);
                   jtree.setSelectionModel(defaulttreeselectionmodel);
                   jtree.addTreeSelectionListener(this);
                   jtree.setEditable(true);
                   return jtree;      
    public static void main(String args[]){
         CompTree ct = new CompTree();
         * This class contains all the component related to panel 1
         * this can be used for .....
    public class DrawPanel extends JPanel implements ActionListener,
         ComponentListener,MouseListener,KeyListener{
         public JRadioButton uniRadio,multiRadio,show;
         public JButton sBut,rBut,dBut;
         public int flag = 1 ;
         public int Radio = 1;
         public boolean sIndicator = true;
         public boolean rIndicator = true;
         public boolean isDestSelected = false;
         public boolean isDestFirstTime = true;
    public int x1 = 0 ;
         public int y1 = 0 ;
         public int x2 = 0 ;
         public int y2 = 0;
         public int x3 = 0;
         public int y3 = 0;
         public int k=0;
         public int l = 40;
    public int b = 40;     
         public String connection1,connection2,connection3,destination1,destination2;
         public int locX;
         public int locY;
    public JPanel panel1 = new JPanel ();      
    public JPanel panel2 = new JPanel ();     
         Vector lines = new Vector();
         Vector colors = new Vector();
         Vector obj = new Vector();
    Vector source = new Vector();
         Vector loc = new Vector();
         BasicStroke stroke = new BasicStroke(2.0f);
    Icon compImage = new ImageIcon("network1.gif"); //new
    Icon workImage = new ImageIcon("tconnect02.gif");
    Icon lapImage = new ImageIcon("server02.gif");
         public DrawPanel(){
         am adding radio button for checking the mode unicast and broad cast mode -- new
    uniRadio = new JRadioButton("Unicast Mode");
    uniRadio.setMnemonic(KeyEvent.VK_B);
    uniRadio.setSelected(true);
    multiRadio = new JRadioButton("Broadcast Mode");
    multiRadio.setMnemonic(KeyEvent.VK_C);
    show = new JRadioButton("show Panel");
    show.setMnemonic(KeyEvent.VK_C);
         ButtonGroup group = new ButtonGroup();
    group.add(uniRadio);
    group.add(multiRadio);
              group.add(show);
         /*     Border border = ButtonGroup.getBorder();
              Border margin = new EmptyBorder(10,10,10,10);
              ButtonGroup.setBorder(new CompoundBorder(border,margin)); */
              uniRadio.addActionListener(this);
         multiRadio.addActionListener(this);
              show.addActionListener(this);
    panel1.add(uniRadio);
              panel1.add(multiRadio);
              panel1.add(show);
              uniRadio.setBounds(150,15,100,40);
              multiRadio.setBounds(260,15,120,40);
              show.setBounds(390,15,100,40);
              uniRadio.setBackground(new Color(105,200,205));
              multiRadio.setBackground(new Color(105,200,205));
              show.setBackground(new Color(105,200,205));
              /*****************PANEL 1*********************/
              panel1.setLayout(null);
    panel1.setBounds(new Rectangle(0,0,400,400));
              panel1.setBackground(new Color(105,100,205));
              panel1.addComponentListener(this);
              panel1.addMouseListener(this);      
         public void sourceObject(String name)
    sBut = new JButton(compImage);
         panel1.add(sBut);     
         sBut.setMnemonic(KeyEvent.VK_F);
         sBut.setBounds(new Rectangle(locX,locY,l,b));     
         sBut.addActionListener(this);
         sBut.addMouseListener(this);
         sBut.addKeyListener(this);
    System.out.println("am inside the source object") ;
         sBut.setBackground(new Color(105,100,205));
         System.out.println("key number" +sBut.getMnemonic());
         System.out.println("MY LOCATION : SBUT : "+ sBut.getLocation());
         public void redirectionObject(String name)
         rBut = new JButton(workImage);
         panel1.add(rBut);
         rBut.setBounds(new Rectangle(locX,locY,l,b));     
    rBut.addActionListener(this);
         rBut.addMouseListener(this);
         rBut.addKeyListener(this);
         rBut.setBackground(new Color(105,100,205));
    System.out.println("am inside the redirection :" + j) ;
    System.out.println("MY LOCATION : RBUT : "+ rBut.getLocation());          
    public void destinationObject(String name){     
         dBut = new JButton(lapImage);
         panel1.add(dBut);     
         dBut.setBackground(new Color(105,100,205));
    System.out.println("am inside the destination object") ;     
    dBut.setBounds(new Rectangle(locX,locY,l,b));                    
         System.out.println("am inside the destination:" + j) ;
         dBut.addActionListener(this);
         dBut.addMouseListener(this);
         dBut.addKeyListener(this);
         System.out.println("MY LOCATION : DBUT : "+ dBut.getLocation());           
    public void paintComponent(Graphics g){
    super.paintComponent(g);
         System.out.println("inside paint");
         Graphics2D g2 = (Graphics2D) g;
    g2.setStroke(stroke);
    if(flag == 1){
         /* this is for drawing current line, this will be drawn when component event happens */
              g.setColor(getForeground());
    System.out.println("inside flag");
    int np = lines.size();
                        System.out.println("Total number of lines present the buffer to draw :" + np);
                             for (int I=0; I < np; I++) {                       
         Rectangle p = (Rectangle)lines.elementAt(I);
                        g2.setColor((Color)colors.elementAt(I));
                             System.out.println("width" + p.width);
                             g2.setColor(Color.red);
                        //     g2.setPaint(p.x,p.y,p.width,p.height);
                             g2.drawLine(p.x,p.y,p.width,p.height);                         
                             System.out.println("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$");
                             System.out.println(obj.elementAt(I));
                             System.out.println("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$");
                             System.out.println(p.x +"," +","+ p.y + ","+ ","+ p.width+ "," + ","+ p.height);
    flag = -1;
    }else if(flag == -1){
         if(x1 != 0 && y1 != 0 && x2 != 0 && y2 != 0 ){
    connection1 = "source to redirection";
    g2.setColor(Color.red);
         g2.drawLine(x1,y1,x2,y2);          
         lines.addElement(new Rectangle(x1,y1,x2,y2));
         colors.addElement(getForeground());
         obj.addElement(connection1);
         x1 = 0 ;y1 = 0 ;
         x2 = 0 ;y2 = 0 ;
    else if (x2 != 0 && y2 != 0 && x3 != 0 && y3 != 0 )
              connection2 = "Redirection to Destination";
              g2.setColor(Color.green);
                   g2.drawLine(x2,y2,x3,y3);                    
    colors.addElement(getForeground());
                   lines.addElement(new Rectangle(x2,y2,x3,y3));               
                   obj.addElement(connection2);
                   x2 = 0; y2 = 0 ;
                   x3 = 0 ; y3 = 0 ;                    
    else if (x1 != 0 && y1 != 0 && x3 != 0 && y3 != 0)
                   connection3 = "Source to Destination";
                   g2.setColor(Color.red);
                   g2.drawLine(x1,y1,x3,y3);                    
    colors.addElement(getForeground());
                   lines.addElement(new Rectangle(x1,y1,x3,y3));                              
                   obj.addElement(connection3);
                        x1 = 0; y1 = 0 ;
                        x3 = 0 ; y3 = 0 ;                    
                        /*     Image offscreen = panel1.createImage(400,400);
              Graphics og = offscreen.getGraphics();
         og.drawLine(200,200,500,500);
              g.drawImage(offscreen,0,0,null); */
    // Component Listener's method
    public void componentHidden(ComponentEvent e) { 
    if(e.getSource().equals(panel1)){System.out.println("Componenet Hidden");}
              System.out.println("Componenet Hidden");
    public void componentMoved(ComponentEvent e) {
              System.out.println("Componenet moved");
              draw();
    public void componentResized(ComponentEvent e) {      
              System.out.println("Componenet resized");
              flag = 1;
              paintComponent(panel1.getGraphics());
    public void componentShown(ComponentEvent e) {     
              System.out.println("Componenet Shown");
    // Mouse Listerner's Method
         public void mouseClicked(MouseEvent me){
    if (me.getSource().equals(panel1))
              System.out.println("inside mouse clicked");
                        if(var == "S"){
    the boolean sIndicator will allow the usage of source object only once
         This is the case for both unicast and multi cast.It has been restricted
         to single use.
                             if (sIndicator){
                             System.out.println("inside mouse clicked");
                        System.out.println("locX" + locX);
                        locX = me.getX();
    locY = me.getY();
                   sourceObject("Source");
                             sIndicator = false;
                        }else{}
              }else if (var == "R")
    if(rIndicator){
    if(!isDestSelected){
    System.out.println("redirection" + locX);
    locX = me.getX();
    locY = me.getY();
                   redirectionObject("Redirection");
                   rIndicator = false;
                   }else{}
    } else{}
              }else if(var == "D"){
              if(Radio == 1 && isDestSelected == false){
              System.out.println("Destination -- uni cast mode" + locX);
    locX = me.getX();
    locY = me.getY();
                   destinationObject("Sink");
              isDestSelected = true;
              } else if (Radio == 2)
                                  System.out.println("Destination -- Multicast mode" + locX);
                                  locX = me.getX();
                                  locY = me.getY();
                                  destinationObject("Sink");
                                  isDestSelected = true;                    
         public void mousePressed(MouseEvent me){System.out.println("am inside mouse pressed"); }
         public void mouseReleased(MouseEvent me){
              System.out.println("am inside mouse released");
              paintComponent(panel1.getGraphics());
         public void mouseEntered(MouseEvent me){}
         public void mouseExited(MouseEvent me){}
    // key Listener
    public void keyReleased(KeyEvent e) {        
                        Component compo =(JButton)e.getSource();                               
                             if (e.getKeyChar() == e.VK_DELETE){                         
                             remove(compo);
              public void keyTyped(KeyEvent e) {}
              public void keyPressed(KeyEvent e){}
    public void remove(Component comp){          
    System.out.println("inside delete key" );                         
         panel1.remove(comp);
         panel1.repaint();     
         public void draw(){
              super.paint(panel1.getGraphics());
              System.out.println("inside draw");
              flag = 1;
              paintComponent(panel1.getGraphics());     
         public void actionPerformed(ActionEvent e)
                             if(e.getSource().equals(sBut)){
                                  System.out.println("am s button");                
                                  x1 = sBut.getX() + l;
                                  y1 = sBut.getY() + (b/2);
                             else if(e.getSource().equals(rBut)){
                                  System.out.println("am r button");               
                                  x2 = rBut.getX() ;
                                  y2 = rBut.getY()+ b/2;
                                  System.out.println("x2 : " + x2 + "y2 :" +y2 );
                             else if(e.getSource().equals(dBut)){
                                  System.out.println("am d button");                
                                  x3 = dBut.getX();
                                  y3 = dBut.getY()+ b/2;
                             else if (e.getSource().equals(uniRadio)){
                                  System.out.println("uni radio");
                                  Radio = 1 ;
                             } else if (e.getSource().equals(multiRadio)){
                                       System.out.println("multi radio");
                                       Radio = 2;
                             } else if (e.getSource().equals(show)){            
                                  System.out.println("inside show");
    *********************************************

    ok
    i don't take a long time tracing your code, but i think u have to overwrite the repaint methode so it 's call the methode which will paint the line each time.
    hope this will help!

  • Slow gui redraws in timeline panel

    Dual Xeon 2620v2 12 Cores 24 threads
    Radeon 290X 4GB / Quadro 5000
    SSD Raid 0
    64GB RAM
    win7 64
    ae cc 12.2.1.5
    Hi everyone,
    After Effects is an absolute pleasure working with and it is one of the most used Softwares in our Animation Studio.
    As compositing lead I'd like to ask a performance related question, that would greatly improve our speed.
    We work on Workstations, that apart from single core performance are quite fast as I would think. (see above)
    Working in the timeline panel with dozents (hundrets) of layers though is quite slow and laggs when the left part (with all the text, blendmodes etc) has to be redrawn.
    Interestingly it is not the amount of layers that is crucial: Havin 50 Layers is as slow as having 200 Layers. The amount that is shown slows the redraw down.
    Turning off columns eg layer colors, blendmodes, etc speeds up the redraw considerably, but is not an option since its slows or workflow. Decreasing the size of the panel speeds it up considerably, but we need the overview.
    Now I would think the graphics cards we have are quite top tier and suspect opengl performance would be the crucial factor here. Though I also read somewhere these redraws are  dependent on cpu single-core performance.
    My question now is quite simple: I would think redrawing gui or parts of it even if there are lots of texts and buttons on it would be feasable and fast on such systems. Is there something we can do to improve the performance? Loosing parts of seconds and seconds everytime we scroll or click on layers adds up to a lot of time (and ultimately frustration ;-) )
    Looking forward to your replies!
    Thanks,
    Alex

    Hi Szalam,
    We dont have the cards in the same workstation. I meant we have both type of cards on different systems. Both have the lags.
    I am talking about split second lags .. when i scroll up and down for example, it updates the panel every half second or so.
    When there are only few layers in the timeline panel it updates it instantaneously and probably dozents of times per second. (selecting, expanding, etc)
    Timeline panels refreshing every half second doesnt seem like much of a lag, but makes working on large comps quite unprecise in our experience ;-)
    Actually this thread I found states our problem exactly (though no solution):
    http://forums.adobe.com/message/5300130
    One thing I noticed is that one cpu-core goes up to a hundred percent when scrolling the timeline on large (simple!) comps. Is this the problem, that the updates cant be calculated fast enough by the cpu? We also have workstations with single-core speeds of 3,6ghz, they have the same problem... mh
    Thank you!

  • Problem with JFrame, JInternalFrame and JDialog

    problem solved..sorry

    I have just found this post:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=302473
    And the first way seems to be the only way to solve the problem... :(
    Now the question is, does it exist a way to refresh a JFrame after that I have uset setVisible(true)?
    If it does exist I could have something like this:
    setVisible(true)
    new panel(getInsets(););
    contpan.add(panel);
    REFRESH();

  • Problem with JFrame, JPanel and getInsets()...

    hi, this is my problem:
    I have a JFrame and I want add a JPanel to its ContentPan, I need to know the JFrame's getInsets values to set (with setBounds()) the right dimensions of the JPanel, but if I call getInsets() before of setVisible(true) I obtain all 0 values, if I call setVisible(true) before of add() I obtain the right values, but the JPanel is not showed.
    By now I have solved with this sequence:
    new panel();
    contpan.add(panel);
    getInsets();
    panel.setBounds();but I would pass the bounds values to my panel constructor, something like this:
    new panel(getInsets(););
    contpan.add(panel);Could someone help me?

    I have just found this post:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=302473
    And the first way seems to be the only way to solve the problem... :(
    Now the question is, does it exist a way to refresh a JFrame after that I have uset setVisible(true)?
    If it does exist I could have something like this:
    setVisible(true)
    new panel(getInsets(););
    contpan.add(panel);
    REFRESH();

  • Reusing code within the same VI (when a sub-VI won't do)

    My last question here got awarded a kudos point "for being a great question", which is pretty embarrassing, because at my present skill level it's hard to envisage the time when I'll ever be anything other than a "taker" from this forum !  So here goes with a "dumb" question to try to put the record straight.
    My front panel has 17 groups of one button + three numeric indicators, that's quite a lot of front panel items and 8 of the groups have an enum indicator as well.  All of these items are also contolled by property nodes for visibility and/or "disabled".
    My program gathers all the data for these items into a Functional Global Variable array, and at end of the main loop it refreshes the properties and the values of all of these front panel items.  It could look unruly, but because of the similarity between the 17 groups the refresh of the front panel items all happens within a neat FOR loop (albeit with a 17-way CASE structure inside it) so at least these controls aren't sprawled out all over my block diagram.
    The only problem I have is that my program takes quite a few seconds to initialise and get the loop running, during which period the front panel shows garbage (well, maybe not garbage, maybe data related to the last time the program ran, which may have been a different context, so much better if not visible).
    But if I also ran the same "front panel refresh code" right after initialising (wiping) the data in my Functional Global, the result would be that all of these controls would be invisible or disabled, which is a much better place to start from.
    But do I have to put a completely separate copy of the loop onto my block diagram to get this effect ?
    Making a sub-VI is out of the question, because it's this VI's front panel I am working on.
    The word that describes (to me) what I want to do is "subroutine", but in LabVIEW "subroutine" seems to have a very specific meaning, a "stripped for speed" VI that won't touch any front panel anyway.
    Is this just a problem of my mindset ?  It's true that in my life by far the most code I wrote was assembler for 8-bit embedded micros, those applications were always strapped for memory.  At this stage of my career the balance won't be tipped however much high-level code I write (yes, I'm a dinosaur).  So I tend to fret about how big my compiled code will be.  Should I just put another copy of the loop (actually it's only the 76 "visible" property nodes I need) onto my block diagram and stop worrying about it ?
    Solved!
    Go to Solution.

    A number of comments.
    1) The title of Dinosaur is still up fro grabs with many of us in the running ( I as well used to play the game of "ICan write that charceter in X lines...")
    2) When you are doing a lot with the GUI, "Defer FP Updates (its a property of the FP to shut down screen updates, serach for that) may spped things up.
    3) I use a GUI controller very often in my apps. I posted about it here.
    4) If you chase down my tags I have a collection related to GUI performance.
    I'd put the code in a VI called from my GUI controler (that called your FG to get the info).
    Regarding memory
    When we used to depend on someone with a crochete hook and beads to make our memory, it was justified. Today, memory is cheap and using to save yourself time is just fine. When you worry about memory is when you find the code does not fit into 2 G anymore.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Problem with window repaint and scrollbars in edit mode (LabVIEW 8.0.1)

    I am running LabVIEW 8.0.1 in Windows XP SP3.  For my main VI, I ran into a strange problem about 5 months ago.  The front panel window - in both edit mode and run mode - stopped repainting itself on the right side which is most visible when you scroll up and down, but also visible with overlapping windows.  Coincident with the repaint problem, both scrollbars look disabled with greyed-out arrows and no boxes in the bars that you can click and drag to scroll the window.  The scrollbars still partially work if you hover the mouse over them and roll the mouse wheel but clicking and dragging doesn't work. 
    The front panel has lots of controls and indicators including tab-control containers and is larger in the horizontal and vertical directions so both scrollbars should be active.  But I deleted all elements on the front panel and everything in the block diagram and the problem persists.  So the problem is not directly related to some control/indicator display.
    I saved the simple VI with this problem (using a wide text line and a tall rounded box to test), then created a new VI and copied the two elements to the new VI.  This new VI does not have the repaint and scrollbar problem.  The two VIs differ slightly in memory usage and in revision number (the bad one is revision 1785 and the good one is revision 3), but otherwise the two VIs are identical.  I attached both VIs to this posting.  When you first open the bad VI, you'll see the disabled scrollbars whereas the good VI has active scrollbars.  To replicate the repaint problem, scroll the window up and down with your mouse wheel.  If it's fine when you first open the VI, click on another window, then click back on the VI window and try the mouse wheel again.  This clicking-away-and-back always causes the repaint problem for me.  I tried the VIs on two different computers both running Windows XP SP3 and LabVIEW 8.0.1 with identical results.
    Here's what I discovered from troubleshooting with the simple VIs:
    * scrollbars always disabled
    * repaint problem in main window for window widths larger then 680 pixels
    * repaint problem in main window menu toolbar for widths larger than 646 pixels
    * entire window becomes disabled for window widths larger than 1348 pixels
    * can repaint window by minimizing and restoring, but only repaints that one time
    * scrollbar boxes sometimes flicker into view but then disappear
    * scroll left and right by hovering mouse over horizontal scrollbar and using mouse wheel
    I found something similar on this forum (thread: Problem with front panel refresh) - it might be related to the CAR about the panel being offset internally.  I don't have access to LabVIEW 8.5 or later and don't plan to upgrade - I haven't tried the trial version as that user did.  I could try to copy and paste my entire block diagram to a new VI but the VI is so large I'm afraid something would break, plus I don't want this to happen again in a few months.  The problem seemed to occur after a certain number of saves (or revision number).  I save backup copies often and when the problem first happened, I was able to go back to a previous version, make the missing changes and save it with no problems, but this only delayed the problem and it came up later.  So maybe it's the revision number.  It didn't seem related to a particular addition or modification in the front panel or diagram.
    The image attached shows the repaint and scrollbar problems in the bad VI.
    This brings up a question I have - if this problem is a bug and was fixed in 8.5 and later, is there a way to apply bug fixes to earlier versions?  Or do I have to pay for an upgrade to fix such bugs?
    Solved!
    Go to Solution.
    Attachments:
    RepaintTest_Bad.gif ‏27 KB
    Test Repaint - From Bad VI, scrollbar and repaint problems.vi ‏7 KB
    Test Repaint - From Blank VI, no problems.vi ‏5 KB

    Seems something got corrupted with this VI. Copy things over to a fresh VI and things should be OK.
    See also this recent report of a similar issue.
    LabVIEW Champion . Do more with less code and in less time .

  • Dreamweaver wont open any files in Mac OS 10.6.3

    I just reinstalled CS4 on my Mac becasue every time I try to open any file, the window panels all blink (refresh) and then nothing happens. The reinstall did not help...nothing has helped.
    Even when I go to the "Info" panel for any file and try to do a "Open With" and change it to be CS4...it switches back to Firefox.
    Creating a new file in Dreamweaver is fine...I can edit it all day long. However, once I save it and try and reopen...nothing...just those dang panel refreshes.
    Has anyone come into this issue and if so, has any idea how to fix this...or even where the issue is? Is it in Dreamweaver, Firefox, Mac OS?
    Any help would be great.
    Thanks!

    I have not heard of this problem before.  Have you tried a system permissions repair, and then de-activate your software (Help->Deactivate) and then run the Adobe - Adobe CS4 Clean Script before re-installing?

Maybe you are looking for