iframe

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oll3i
    Contributor
    • Mar 2007
    • 679

    iframe

    how to add a text to a frame i want that text to update when a user adds some product to a cart so it displayes a total price of products added
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by oll3i
    how to add a text to a frame i want that text to update when a user adds some product to a cart so it displayes a total price of products added
    Use a label and reset it's text everytime you call the method that adds a product to the cart.

    Comment

    • oll3i
      Contributor
      • Mar 2007
      • 679

      #3
      but how to reset it

      Comment

      • oll3i
        Contributor
        • Mar 2007
        • 679

        #4
        Code:
        JFrame frame = new JFrame("Wozek");
        frame.add(new JLabel(new ImageIcon("cart.jpg")));
        final JLabel stan_koszyka = new JLabel("Koszyk jest pusty");
        frame.add(stan_koszyka);
        int width = 300;
        int height = 300;
        frame.setSize(width, height);
        frame.setVisible(true);

        but it only takes the second label doesnt display the image

        Comment

        Working...