Image.getScaledInstance(int, int, int);

解决方案 »

  1.   

    jLabel1.setBounds(x, y, w, h);
    Image im = Toolkit.getDefaultToolkit().createImage(IMAGE);
    jLabel1.setIcon(new ImageIcon(im.getScaledInstance(w, h, 0)));
      

  2.   

    jLabel1.setBounds(x, y, w, h);
        jLabel1.setIcon(new ImageIcon(im.getScaledInstance(w, h, 0)));
        jB1.setBounds(10, 0, 100, 10);
        jB1.setText("+");
        jB2.setBounds(110, 0, 100, 10);
        jB2.setText("-");
        jB1.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            w *= 1.05;
            h *= 1.05;
            jLabel1.setBounds(x, y, w, h);
            jLabel1.setIcon(new ImageIcon(im.getScaledInstance(w, h, 0)));
          }
        });
        jB2.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            w *= 0.95;
            h *= 0.95;
            jLabel1.setBounds(x, y, w, h);
            jLabel1.setIcon(new ImageIcon(im.getScaledInstance(w, h, 0)));
          }
        });
      

  3.   

    http://www.delfan.com/language/java/applet/fractal.html
      

  4.   

    okok  谢谢 给分!!!!
      

  5.   

    http://www.chinajavaworld.net/forum/leoboard.cgi