Package javax.swing

Examples of javax.swing.JPanel.repaint()


                    } else {
                        searchField.setText("");
                        table.requestFocus();
                    }
                    filterPane.revalidate();
                    filterPane.repaint();
                }
            });
            searchField.addKeyListener(new KeyAdapter() {
                @Override
                public void keyPressed(KeyEvent e) {
View Full Code Here


    arrow.setArrowLocation(startX, startY, endX, endY);
    arrow.setBounds(0, 0, Math.max(startX, endX) + 30, Math.max(startY, endY) + 30); // 30 is offset for arrow heads (being cut otherwise)
    //System.out.println("  Adding arrow (startX=" + startX + ", startY=" + startY +", endX=" + endX + ", endY=" + endY + ")");
    p.add(arrow);
    p.revalidate();
    p.repaint();
  }
 
  /**
   * Removes all arrows from the screen.
   */
 
View Full Code Here

  public static void removeAllArrows() {
    JPanel p = getArrowsPanel();
    if (p.getComponentCount() > 0) {
      p.removeAll();
      p.revalidate();
      p.repaint();
    }
  }

}
View Full Code Here

      @Override
      public void mouseDragged(MouseEvent event) {
        point.x = event.getX();
        point.y = event.getY();
       
        formPaint.repaint(); // force the paint panel to be redrawn
       
      }
    });
   
    // add parent container to our JFrame
View Full Code Here

        int colorIndex = shift.getShiftType().getIndex() % TangoColorFactory.SEQUENCE_1.length;
        shiftAssignmentButton.setBackground(TangoColorFactory.SEQUENCE_1[colorIndex]);
        shiftAssignmentButton.setToolTipText(shift.getLabel() + " @ "
                        + (employee == null ? "unassigned" : employee.getLabel()));
        shiftPanel.add(shiftAssignmentButton);
        shiftPanel.repaint();
        shiftAssignmentButtonMap.put(shiftAssignment, shiftAssignmentButton);
    }

    public void removeShiftAssignment(ShiftAssignment shiftAssignment) {
        JPanel shiftPanel = shiftPanelMap.get(shiftAssignment.getShift());
View Full Code Here

    public void removeShiftAssignment(ShiftAssignment shiftAssignment) {
        JPanel shiftPanel = shiftPanelMap.get(shiftAssignment.getShift());
        JButton shiftAssignmentButton = shiftAssignmentButtonMap.remove(shiftAssignment);
        shiftPanel.remove(shiftAssignmentButton);
        shiftPanel.repaint();
    }

    public void clearShiftAssignments() {
        for (JPanel shiftPanel : shiftPanelMap.values()) {
            shiftPanel.removeAll();
View Full Code Here

      label.setHorizontalTextPosition(JLabel.CENTER);
      label.setForeground(Color.red);
      rightPanel.add(label);
      add(rightPanel, BorderLayout.CENTER);
      setBackground(SystemColor.control);
      rightPanel.repaint();
     
    }

  public static JLabel getLabel() {
    return label;
View Full Code Here

        g2.fillRect( 100, 100, 100, 100 );
        g2.dispose();
        final JPanel panel = ( JPanel ) frame[ 0 ].getContentPane().getComponent( 0 );
        panel.invalidate();
        panel.validate();
        panel.repaint();
      }
    } );

    // Wait for all sorts of asynchronous events
    Thread.sleep( 2000 );
View Full Code Here

       };

       Observer observer;
       this.addObserver(observer = new Observer() {
         public void update(Observable obs, Object obj) {
           panel.repaint();
         }
       });

       // Saving observer reference for releaseInterfaceVisualizer
       panel.putClientProperty("intf_obs", observer);
View Full Code Here

    };

    Observer observer;
    this.addObserver(observer = new Observer() {
      public void update(Observable obs, Object obj) {
        panel.repaint();
      }
    });

    // Saving observer reference for releaseInterfaceVisualizer
    panel.putClientProperty("intf_obs", observer);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.