Setting Icon Image in a JWindow

Hi Javaheads,
Is there a way to replace the coffeecup icon in the JWindow with a custom image? I searched the forums, did not find anything! I'm using jdk1.3 btw.
Kamran

But anyway, if you are creating a JWindow instance,
then how are you getting any icon at all? You
shouldn't get any title bar, window controls, etc.
with a JWindow. With a JWindow, all of the drawing of
the window is up to you.LOL ... I have been looking at the wrong class! I was trying to set the icon in my SplashWindow (JWindow), while looking at the HelpWindow (JInternalFrame).
Thanks!
Kamran :-)

Similar Messages

  • How to Set icon/image programatically in ADF before page loads

    This is my UI:
    Depends on the condition i want to set icon/image programatically in my java code.Before page load im calling this method.
    So i couldnt take binding value also,it throws null pointer exception.Then i tried setting icon/image programatically.
    <af:commandImageLink text="settings" icon="#{bean.iconsettings}" binding="#{bean.bind}"> </af:commandImageLink>
    My bean:
    private RichIcon iconsettings;(its getters and setters)
    private void method(){                         // method
    if(cond){
    this.iconsettings="/images/20.jpg";   //trying to set icon in a string.but it throws me error that cannot set RichIcon to string.
    else
    this.iconsettings="/images/19.jpg";
    Could any one tell me how can i set icon/image in java code.Before page loads im performing all above said tasks.Please help.

    Well, you set the icon property to a bean method, which you have done. The bean method however need to have the signature
    public String getIconsetting()
    // your code returning hte path to the icon
    if(cond){
         return ="/images/20.jpg";   //trying to set icon in a string.but it throws me error that cannot set RichIcon to string.
    else {
         return ="/images/19.jpg";
    The bindproperty is not needed, remove it and remove the RichIcon Iconsettings too´as it's not needed to and is the wrong type anyway.
    Timo

  • Set Background image of the Jwindow

    Can any one of u explain how to set the background image of the Jwindow..

    can you search in this forum? this question have been replied many times.

  • Setting Icon Image in JDialog

    The following code sets the top-left icon of a JDialog box.But when I uncomment the line
    'setResizable(false)' the Icon is not seen.
    So how do run the code if I want the JDialog box not Resizable ?
    Code is as follows...................................
    import javax.swing.event.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.*;
    public class Main extends JFrame {
    private AboutBox about;
    public Main() {
    super("Main test");
    setSize(450, 350);
    ImageIcon icon = new ImageIcon("no.gif");
    setIconImage(icon.getImage());
    JButton button = new JButton("Open dialog");
    getContentPane().setLayout(new FlowLayout());
    getContentPane().add(button);
    button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    about = new AboutBox(new JFrame());
    about.setVisible(true);
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent we) {
    System.exit(0);
    public static void main(String []args) {
    Main main = new Main();
    main.setVisible(true);
    class AboutBox extends JDialog {
    public AboutBox(JFrame owner) {
    super(owner, "About Swing Menu", true);
    ImageIcon icon = new ImageIcon("no1.gif");
    owner.setIconImage(icon.getImage());
    JButton button = new JButton("Close");
    getContentPane().setLayout(new FlowLayout());
    getContentPane().add(button);
    button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    dispose();
    setSize(250, 150);
    // setModal(true);
    // setResizable(false);

    add a component listerner and override the componentResized.
    jframe.addComponentListener(new ComponentAdapter() {
              public void componentResized(ComponentEvent e) {
                        //code to reset back to the original window size
    User can still do the "resizing", but once user releases the mouse, it will reset back to the original size

  • How to set icon image in jstudio for my application

    Dear friends,
    I developed one application in jstudio.And need to set an special icon for my application.While i download my application in to mobile. The icon should be displayed in the mobile.To show my application as unique from other applications.But i dont know how to set an icon for my application. If any one find answer please reply as soon as possible.
    Thank you

    Java Studio Enterprise per se does not support creating applications for mobile devices. I gues you used NetBeans Mobility Pack for that. Therefore, please refer to http://mobility.netbeans.org/ for more information. Thanks.
    Here is a FAQ entry, which, as far as I understand answers your question: http://www.netbeans.org/kb/faqs/j2me-mobility.html#FaqJ2MESpecifyMidletIcon

  • Setting icon for MII version 12.1.x custom action

    Hi,
    i tryed to set icon image for custom action for MII version 12.1.x but i did not achieve.
    How can it be done?
    Thanks.

    Hello,
    I have done it in 11.5. This is how I did it in 11.5. (I am hoping that it has not changed in 12.1)
    //funciton for specifying icon
    public String GetIconPath() {
            return "com/path/to/icons/imagename.png";
    Store your image file in the following way
    com/path/to/icons and name that as imagename.png
    There is also a blog on it
    /people/rupesh.bajaj/blog/2007/12/04/beginners-guide-to-create-custom-action-block
    I hope it helps.
    Regards,
    Musarrat
    Edited by: Musarrat Husain on May 17, 2011 12:18 PM

  • How to set folder icon image in OS X Lion?

    I set my folder's icon image in OS X Leopard before, but I don't know how to do that in Lion.  In Leopard you simply copy the icon image from an Info window of a file, and paste that into the folder's icon image in the top left corner of its Info window.  In Lion I don't see the icon of the file in its Info window as a preview, but rather I see only a generic JPG file icon.  Any ideas?

    Can you explain why there was no thumbnail for that file?
    The OS does not create or add thumbnails, previews, nor custom icons to images or other files. Although it displays files with what appears to be a custom icon, it is not part of the file itself; it is created on the fly, just for display. Since it is not part of the file, it does not appear in the Get Info window.
    Back in OS 9 days when you downloaded an image file from the web, either via drag and drop or via the download mechanism, the image file would typically be placed on the drive as a QuickTime image with both a custom icon and a preview image added to it.
    I skipped earlier versions of OS X, and started with Snow Leopard, so don't know about earlier versions of OS X. Apparently the auto creation and addition of a custom icon and preview have been dropped in later versions in favor of using Preview to generate a temporary (for display only) custom icon on the fly. One result of this is that image file sizes are kept reasonably small - adding a suite of custom icons and a preview image to the file itself increases the file size a lot; it's not unusual for those additions to double the file size, or more.

  • How to make an icon image using Photoshop

    I found out how to do this recently so I decided that I wanted to make a tut for those who don't know how to make an icon image. This icon image is for the libraries tab on your computer. Under the libararies tab there is Music, Pictures, Documents, and Photos
    First you will need the ICO (Icon image format) Format extension for photoshop which can be downloaded here:
    http://www.telegraphics.com.au/svn/icoformat/trunk/dist/README.html
    The download link and tutorial on how to install it is all in the link above.
    Once you have that all set you can now launch photoshop to create your icon image. Once you have launched it, create a new document with the size as in the image below.
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/256x256_zpsbf3dcf8e.png~original[/IMG]
    Create the image you want. I used a simple one by using the custom shape tool by pressing "U" on your keyboard and with the
    basic blending options.
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/IconImage_zpsd788c709.png~original[/IMG]
    The reason why the image is pixelated is because it is an icon image. Since the image is only 256x256 pixels when you zoom in on it that will get you the pixely result. The reason why I zoomed  in is so you can see it. But don't worry this is no the end result. Just continue reading and you will see.
    So once you have created the icon go ahead and press
    file>save as>(under format choose the ICO)>and choose the name that you want to name it. And save it in your C: drive. You will see why to save it in your C: drive in a sec.
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/SampleicoPic_zpsd252bfba.png~original[/IMG]
    So now that you have created the icon and saved it now you can create the new library.
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/NewLibrary_zps8ca703b2.png~original[/IMG]
    Name the library whatever you want I named it "Sample" for tutorial purposes. Notice how it gives you a default boring icon image for your library.
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/Sample1_zpsb5472840.png~original[/IMG]
    So now once you have created and named your library now it is time to get the icon image into place.
    Go to computer/c: Drive/users/YOU/ And now once you have reached this area you will need to access a hidden folder named "appdata" to do so press "Alt" then a menu bar will show. Click
    tools>folder options>and view. Find the option to view hidden folders then press apply then ok. Now we shall continue so AppData>Roaming>Microsoft>Windows>Libraries
    Now you should see all the libraries including the one you just created.
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/showhiddenfolder_zpsad4a3c94.png~orig inal[/IMG]
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/Libraries_zpsf6243bc0.png~original[/IMG]
    Once you have reached your destination then open a new text document with notepad and drag the library you just created in notepad. The result should look like this:
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/Notepad_zps251a86f0.png~original[/IMG]
    once you have reached this point click at the end of the second to last line down then press enter and enter in this information
    <iconReference>c:\"NAME OF ICO FILE YOU CREATED IN PS".ico</iconReference>
    Example:
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/iconreference_zps1c1a3eca.png~origina l[/IMG]
    Once you have entered that information go to file>save and the icon image should appear on the library you created.
    [IMG]http://i1297.photobucket.com/albums/ag25/dusty951512/Finished_zps267f893a.png~original[/IMG]
    Now you are officially finished. Go and spread the news and joy. Bye for now
    -Dusty951512

    It is Windows only because all those screen shots are exclusively Windows, the file structure and paths do not resemble those of the Mac in the least.  As a Mac user, there's nothing I could take from your tutorial.  Sorry, 
    No drives named with letters like C: on the Mac, for instance.  No backward slashes either, ever.  No such paths either.  No "Notepad" on the Mac, we use TextEdit; but such a text editor is not remotely needed on the Mac to make and/or edit icons.  Etc.
    Those folders are not even called "Libraries" on the Mac…  Nothing resembling your tutorial at all.
    The icons in the Finder's Sidebar are not customizable at all in recent version of OS X.
    =  =  =
    You can edit any post of yours only until someone replies to it.  At this time your post is not editable by you any longer.

  • Why are there 2-sets of IMAGE UNITS in Motion 5?

    I seem to have 2-sets of Image Units in my Motion 5 library:
    The first set has an icon exactly like the Filters icon; the second set has an icon exactly like the Generators icon. 
    I have read elsewhere online that it appears not everyone has the first set of Image Units, that perhaps it has something to do with running OS 10.7 Lion, but this has not been confirmed.  I am currently running Lion, and I do have these Image Units, but they do not seem to do anything when I put them in the Timeline. 
    Some examples of these Image Units are: 1) Glass Distortion, 2) Glass Lozenge, 3) Copy Machine (transition)... there are 123 of these in the Image Units folder, and it looks like they might do some really cool things if I could get them to work.  If I cannot get them to work then I'd like to remove them from the Motion library, if only I could figure out how to do that as well. 
    If I right-click on the Motion application icon and choose "Show Package Contents" these Image Units do not appear anywhere, and a Spotlight search for "Image Units" does not reveal anything significant either. 
    Please help me figure out 1) What is this second set of Image Units?
                                          2) If not everyone has them, how did I get mine?
                                          3) How do I get them to work?
                                          4) If they do not work, how do I remove them?
    Thanks so much!

    1) the 2nd set of Image Units are actually Generators, which means, when applied to the canvas, you will get a Generator Pane in the inspector. You cannot add a generator Image Unit to another object and affect it's appearance as you can with a Filter Image Unit.
    You can Apply Filter Image Units to Generator Image Units... LOL but not vice versa.
    ***STAY AWAY FROM RANDOM GENERATOR*** it does NOT belong to Motion -- it belongs to Core Image and is accessible in Quartz Composer (there are others too, in the filter image units... they will appear to do "nothing" [all of the Area XXXX filters are such])  Clicking on Random Generator has been known (and does for me as well) to crash Motion.  If you want or need a random number, use the Numbers generator and click the Random checkbox. For everything else, use the wriggle behavior.
    2) Everybody is supposed to have them. If they don't, something screwed up in the installation.
    3) Filter Image Units will have parameters under the Filter Tab of the selected object under the heading of the Filter Name or the name you give it in the Layers palette. [Generator Image Units answered in #1]
    4) You can't, and you don't want to: they belong to the System (Core Image); but for the ones that do nothing or can crash Motion, you will just have to learn to avoid them.

  • Custom Icon Images for Folders in KM

    Hello Everyody,
                   I have to display folders such as Pesonal Documents, Public documents, Recently used, Favourites etc which are there in the entry point repository in KM. Right now all these folders are being displayed with the default icon image specified. I want to replace these default images with custom images but couldnt see any property where i can change the image path for these folders. I checked the details of all these folders and even went through the properties but there it shows only the default image name speciefied for that folder and no active settings where i can change the image path for custom icon. Kindly suggest how to implement custom image for KM folder icons.
    Thanking you all in advance,
    Regards,
    Sarabjeet.

    Hi,
    If I understood, you have a KM navigation iview, where some folders apperar. You want to change the icon for each of them differently.
    For this do the following:
    First have a look into the KM.navigation iview and get the layout set property. Go to System config->KM->Content management->User interface->Settings->LayoutSet and find the layout set you are using. Go to appropriate resource renderer and check the "<b>Icon setting</b>". Change it to: <b>iconreplace</b>.
    Now get the KM details for your folders and change the <b>IconSource</b> property to your image Example:
    /etc/public/mimes/images/add.gif
    Voila...the icons for these folders are changed!
    Hope this is your case.
    Romano

  • How can we set icon to a tree table

    Hi ADF Experts,
    The below is regarding skinning of af:tree table component.
    How can we set icon to a tree table
    Below is the af:tree component. When I run the application I see all the parent and child nodes as folder icon. My question is how can set a file icon to the elements present inside a parent node.
      <af:treeTable value="#{pageFlowScope.MerchandizeTreeModel.productTreeModel}"
                                      id="tt1" var="row"
                                      rowSelection="multiple"
                                      horizontalGridVisible="false"
                                      verticalGridVisible="false">
                          <f:facet name="nodeStamp">
                            <af:column sortable="false" headerText=""
                                       rowHeader="true" id="c11" width="200">
                     <af:panelGroupLayout id="pgl0">
       <af:image source="/images/folder.png" shortDesc="foldericon"
                                id="i1"/>
                      <af:outputText value="#{row.groceryItems}" id="ot11"/>
    </af:panelGroupLayout>
                            </af:column>
                          </f:facet>
                        </af:treeTable>
    Thanks in advance,
    Animesh

    Hi Experts,
    I am having a tree table component in adf. I have set a folder image for the parent node. How can we set a document image for contents inside a parent node.
    Thanks,
    Biswa

  • Setting Icon for MenuItem

    I wanted to set an icon image along with a label in MenuItem(AWT). I am not using swing component (JMenuItem). Could any one advice me how to do this.
    Thanks in advance.

    As far as I know you can't set an icon in a MenuItem object. MenuItem extends MenuComponent, which extends Object. None of which have a paint or paintComponent method which you can modify. Maybe you can extend MenuItem and create a class with a paintComponent method?
    Sorry

  • Setting icon in JDialog

    Hi all
    I have a problem setting an icon in a JDialog. Now I know that JDialog's icon image will be the same as the icon image of its parent frame. Hence, setting the icon image of the parent frame which launches the JDialog will set the icon for the JDialog. But the problem lies here. It does not work the way it should. The JDialog is not getting the icon from the parent frame. Can somebody help me out with this problem? Is there any other way to set the icon for the JDialog explicitly - say something like a setIcon().
    Help will be really appreciated.
    Thanks.

    Hi,
    there is no setIcon(). There are some problems when your JDialog is not resizable and modal. Try some combinations with resizable and modal to find out whether thats the reason.
    Phil

  • Icon image formats question

    "Icon image formats used for iconic buttons can be .ico files at design time, but must be GIF or JPEG format at runtime. There is no other restriction of this related to deployment."
    Read the above statement in an STS test paper and was wondering this is true. How does it work is it that the .ico are automatically converted at runtime or do the other extensions need to exist at runtime.
    Incidentially does anyone know if there is a good source for forms icon files hiding out on Oracle.com
    Thanks

    WebForms usually do not show the icons at design time, but with little configuration we can display them, and since webforms will only show only GIF and PNG files (no JPEG) the design time icons are a bit fuzzy, so you can use .ico files for design time and .gif or .png for runtime.
    You must have two sets of icons if you want to view the icons at design time.
    You might also want to read [url http://www.oracle.com/technology/products/forms/pdf/webicons.pdf]Deploying icons in WebForms
    Tony

  • Table or list for icon images and their explanation?

    Hello,
    In our user manuals we have descriptions of icons next to the respective icon image. Until now I've always used a table, but the predefined table elements in DITA don't allow for a narrow first column and wider second column. I appreciate any suggestions how I can do this in structured FM.

    Hi ABJB,
    I don't know enough about DITA to say whether it should or should not be possible to set custom table widths. I do remember working with the spec in the past and there was something about a lack of attributes in which to store table widths, so I had to borrow some other attribute and do some fancy XSLT work to jam the data into another attribute. Anyway, the relevant point is that someone either needs to tell you how it can be done, or, if it cannot be done, then you can either:
    - Modify the DITA structured application to make it store table widths, so the data is preserved when it goes to XML and back
    - Use your own custom structure definition
    By the way, I'd like to clarify something about "structured FM"... Structured FM is the same old FrameMaker you've always known, except that structural markup is applied to your content and gives you lots of help with the automation of format. So, you can make column widths whatever size you want, tables look however you want, etc., and when you save to binary *.fm format, all the layout is naturally preserved. In your case, though, you are attempting to use structured FM to edit XML files, which is somewhat of a different story. The structured interface is very good for this and when everything is properly configured, XML files open up looking like normal FM structured documents (like the DITA XML files). However, for lots of formatting properties such as table widths, there must be some kind of instruction behind the scenes that tells how to write that data into the markup, otherwise it is simply lost. It is possible that the DITA structured app (and the DITA spec) lacks that ability and hence the column width data is lost when the content goes to XML.
    So anyway, that's a long windy explanation to emphasize that nearly anything that is possible in unstructured FM is possible in structured FM. It's when you start saving in XML format that you have to account for formatting artifacts.
    By the way... do you need XML for anything? Lots of people find that structured FM alone serves their needs.
    Russ

Maybe you are looking for

  • Rotating multiple .pdfs at once

    I've got about 2000 pdf files which need to be rotated. As I would really rather not sit at my desk and do each one individually I'm looking for a way to do them all at once. The only stipulation is that the pdf files MUST have the same file name and

  • How do I link contacts on the MACBook Pro?

    Is contact linking not available on the MACbook Pro? I'm using OSX 10.9.2, Contacts 8.0? I can only find how to merge contacts on the MAC but not link them as I can on my iPhone. Am I missing something?

  • ISSUE - Automatic Payment Program

    Hi Gurus, I am using Tcode F110 to do a APP for my vendor. After i have maintained the parameters, printer details etc and when i schedule the proposal to 'start immediately' i get the status as "Proposal has been released 19.08.10 13:20:48" other th

  • Order acknowledgment as inbound delivery

    Hi, I'm trying to find out if there is a possibility to create Vendor order acknowledgment (AB type) with internal category '1' as inbound delivery? We have both '1' (AB) and '2' (LA) types in confirmation control key setup, however when generating i

  • Is there any way to to have the "Home" icon open a new tab instead of replacing the current page with the home page?

    I would prefer that the "Home" icon on the Navigation Toolbar open a new tab instead of replacing the current tab with the home page. Is there any way to accomplish this? Thank you.