Hi
I ve tried this,but still i' m not getting icon in joptionpane title bar.
JOptionPane jp = new JOptionPane("Session Expired - Please Re Login" , JOptionPane.INFORMATION_MESSAGE , JOptionPane.WARNING_MESSAGE, ("logosmall.gif"));
JDialog dialog = jp.createDialog(parent, "Session Expired - Please Re Login");
((Frame)dialog.getParent()).setIconImage(("logosmall.gif").getImage());
dialog.setVisible(true);
can anyone help me.....
hi.
My problem not yet solved.
I am getting the icon only in the message displaying region.
I need to get the icon in title bar of joptionpane.
even i added setresizable() too.
could anyone reply...... with proper solutions.
Remember i need to get the icon exactly in the title bar of joptionpane.
All,
I am building an applet using swings extensions and the applet runs well with applet viewer, but when i run it in IE, for the first time its visible but from second time onwards the icons in applet are not visible.
I am trying to load atleast 30 images
using
ImageIcon line2Available=new ImageIcon(getClass().getResource("/com/citi/cti/images/line_circles/04pch_up_line2_04blue.gif"));
kindly help me in this regard
is there anyway i can make sure the images loads always
hi!
try this out..
package com.ani;
import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import com.sun.java.swing.plaf.windows.WindowsIconFactory;
public class Sample_01
{
/**
* @param args
*/
public static void main(String[] args)
{
JFrame frm = new JFrame();
frm.setIconImage(new ImageIcon("C:\\Movies0.JPG").getImage());
frm.setBounds(100, 100, 100, 100);
frm.setVisible(true);
frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JOptionPane jp = new JOptionPane("Session Expired - Please Re Login" , JOptionPane.INFORMATION_MESSAGE , JOptionPane.WARNING_MESSAGE, WindowsIconFactory.getMenuArrowIcon());
JDialog dialog = jp.createDialog(frm, "Session Expired - Please Re Login");
dialog.setResizable(true);
dialog.setVisible(true);
}
}
change the image according to your specification.
regards
Aniruddha
Hi,
I am getting the icon in the frame that is present behind the joptionpane.
But i need to get the icon in the joptionpane's title bar not in the frame 's title bar.
http://java.sun.com/docs/books/tutorial/figures/uiswing/components/JOptionPaneMetal.png
http://java.sun.com/docs/books/tutorial/figures/uiswing/components/InformationalDialogMetal.png
I need to get the icon just before the title "Messasge".
Reply me.
hi,
http://java.sun.com/docs/books/tutorial/figures/uiswing/components/DialogIcon2Metal.png
Click this link.U ll get the image of joption pane.
Title of the joption pane is "Inane Warning".
I like to get the icon before this "inane warning."
can u send me the code.....
Did u got it ?
Kindly help me.......
Hi
public class Sample_01
{
/**
* @param args
*/
public static void main(String[] args)
{
JFrame frm = new JFrame();
frm.setIconImage(new ImageIcon("tree.wait.gif").getImage());
frm.setBounds(100, 100, 100, 100);
frm.setTitle("Hi");
frm.setVisible(true);
frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JOptionPane jp = new JOptionPane("Session Expired - Please Re Login" , JOptionPane.INFORMATION_MESSAGE , JOptionPane.WARNING_MESSAGE, WindowsIconFactory.getMenuArrowIcon());
JDialog dialog = jp.createDialog(frm, "Session Expired - Please Re Login");
dialog.setResizable(true);
dialog.setVisible(true);
}
}
This is the code i worked.
But its not working for me......
I am not even getting the icon in the frame itself....
I apologize that in my previous replies i said that i am getting the icon in the frame but not in joptionpane....
But there is no icon in frame itslef......
Hi,
Refer to the code...
public class Sample_01
{
/**
* @param args
*/
public static void main(String[] args)
{
JFrame frm = new JFrame();
//frm.setIconImage(new ImageIcon("tree.wait.gif").getImage());
frm.setIconImage(new ImageIcon("./img/securitymanager.gif").getImage());
System.out.println("Image>" + frm.getIconImage());
frm.setBounds(100, 100, 200, 300);
frm.setTitle("Hi");
frm.setVisible(true);
frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JOptionPane jp = new JOptionPane("Session Expired - Please Re Login" , JOptionPane.INFORMATION_MESSAGE , JOptionPane.WARNING_MESSAGE, WindowsIconFactory.getMenuArrowIcon());
//JDialog dialog = jp.createDialog(frm, "Session Expired - Please Re Login");
//dialog.setResizable(true);
//dialog.setVisible(true);
}
}
Even with this code i am not getting the icon in the frame.....
But when i use frm.getIconImage(), it prints -- Image>sun.awt.image.ToolkitImage@66848c,which is a non null value....
Kindly reple me
Hi,
I am working in Linux.
I ve set like this.
frm.setIconImage(new ImageIcon("/home/vidhya/workspace/Others/src/demos/img").getImage());
System.out.println("Image>" + frm.getIconImage());
But still am not getting the icon.
But it prints "Image>sun.awt.image.ToolkitImage@66848c",non- null value
wat to do....
Y i am not getting the icon?/