|
| ||||||||||
| Tags: class, imageicon, imageicon class, imageicon class concept, java, java class, java classes, java imageicon class |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| ||||
| ||||
| ImageIcon class of java
I am IT student and currently studying java programming. In which I want to be aware about the ImageIcon class of java. I have to use this class in my java project. But unfortunately I don't have enough knowledge about ImageIcon class. So please help me to know about the ImageIcon class of java. If possible then give suitable example for ImageIcon class. I would greatly appreciate your any help. |
|
#2
| |||
| |||
| Re: ImageIcon class of java
A ImageIcon class used for an implementation of the Icon interface that paints Icons fromImages. Images that are created from a URL or filename are preloaded using MediaTracker to monitor the loaded state of the image. The ThumbnailAction class, an inner class in IconDemoApp.java, is a descendant of AbstractAction that manages our full size image icon, a thumbnail version, and its description. When the actionPerformed method is called the full size image is loaded into the main display area. |
|
#3
| ||||
| ||||
| Re: ImageIcon class of java
Hi friend, I suggest you to go through the following example of 'ImageIcon class' Code: import javax.swing.ImageIcon;
public class ImageIconDM {
public static void main(String[] ank) {
JFrame clW = new JFrame();
clW.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ImageIcon icon = new ImageIcon("yourFile.gif");
Image normalImage1 = icon.getImage();
Image grayImage1 = GrayFilter.createDisabledImage(normalImage1);
Icon warningIcon1 = new ImageIcon(grayImage1);
JLabel warningLabel1 = new JLabel(warningIcon1);
JLabel label03 = new JLabel("Warning", icon, JLabel.CENTER);
clW.add(warningLabel1,"Center");
clW.add(label03,"South");
clW.setSize(400, 200);
clW.setVisible(true);
} |
|
#4
| ||||
| ||||
| Re: ImageIcon class of java
Please study following Constructors of ImageIcon class:
|
|
#5
| ||||
| ||||
| Re: ImageIcon class of java
Example of ImageIcon class: Code: import javax.swing.ImageIcon;
import javax.swing.border.Border;
public class ImageIconMain {
public static void main(String args[]) {
JFrame f05 = new JFrame("Label Demo");
f05.setLayout(new FlowLayout());
f05.setSize(300, 360);
f05.setDef05aultCloseOperation(JFrame.EXIT_ON_CLOSE);
ImageIcon myIcon = new ImageIcon("myIcon.gif05");
JLabel label01= new JLabel("A def05ault label", myIcon, JLabel.LEFT);
Border border1 = BorderFactory.createLineBorder(Color.BLACK);
label.setBorder(border1);
f05.add(label01);
f05.setVisible(true);
}
} |
|
#6
| ||||
| ||||
| Re: ImageIcon class of java
Hi, Bwlow I have given some important methods of ImageIcon class:
|
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "ImageIcon class of java" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Converting java class to java bean class | Ucchal | Software Development | 6 | 09-08-2010 10:24 AM |
| How to use Image class in java? | Gajananvihari | Software Development | 4 | 27-02-2010 09:11 AM |
| AbstractButton class of java | Owen Fernandes | Software Development | 5 | 22-02-2010 07:17 AM |
| JTree class of java | Owen Fernandes | Software Development | 5 | 13-02-2010 07:23 AM |
| Java Programming Language Basics: Reflection Basics and Class Class | mayuri_gunjan | Guides & Tutorials | 6 | 29-08-2005 12:04 AM |