Scaled Image - Online Code


Display a Scaled Image within a given label. The size of the image will be the size of the label. Larger images are compressed and smaller images are expanded.

Source Code

import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

public class ScaledImage extends JFrame implements ActionListener


  JButton jb;

  String file="C:\\photo\\Untitled.jpg";

... (login or register to view full code)

To view full code, you must Login or Register, its FREE.

Hey, registering yourself just takes less than a minute and opens up a whole new GetGyan experience.


No comment yet. Be the first to post a comment.