Re: using JOptionPane's error icon
- From: Thomas Weidenfeller <nobody@xxxxxxxxxxxxxxxx>
- Date: Wed, 27 Apr 2005 11:56:41 +0200
Mikael Flensborg wrote:
Think the question is misunderstood... He wants to use the ICON used in JOptionPane in other contexts, and NOT the JOptionPane itself... I have been looking for a way to do it too.. So far with no success.
AFAIK there is no official way, the icons are not part of the public API. You have a number of alternatives:
- Sun's icon repository contains some of them (but not all). If your icon is there, you could bundle the icon GIF and use that instead.
- You could look through the UI defaults. Sun's VMs uses some properties to point to the icons. However, this is an implementation detail, and other VM vendors might do it completely different.
- You could subclass BasicOptionPaneUI to get access to its getIcon...() method (I forgot the exact name). That method should be capable of delivering instances of the icons. However, BasicOptionPaneUI has for sure side-effects when one creates an instance of it. You have to check if they affect you.
/Thomas
-- The comp.lang.java.gui FAQ: ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq .
- References:
- using JOptionPane's error icon
- From: hkongogo@xxxxxxxxx
- Re: using JOptionPane's error icon
- From: Aki \"Sus\" Laukkanen
- Re: using JOptionPane's error icon
- From: Mikael Flensborg
- using JOptionPane's error icon
- Prev by Date: Re: using JOptionPane's error icon
- Next by Date: How to scroll to a cell in a JTable
- Previous by thread: Re: using JOptionPane's error icon
- Next by thread: Re: using JOptionPane's error icon
- Index(es):
Relevant Pages
|