How to set my own icon for java frame ??

I create a java class it extends JFrame. I want to change default icon on the left_top corner and using my own icon. It is a --.gif file. How to do it. When I try to modify it using setIconImage( Image image), I met problem. I cann't new Image("--.gif"). I don't know how to create a Image object using a string(file name). I try to use ImageIcon , but it is not image obj. Thanks. Gary

According to the documentation setIconImage does the following: Sets the image to be displayed in the minimized icon for this frame. Not all platforms support the concept of minimizing a window.
So,
1) It does not change the icon in the top-left corner
2) It does not work on all platforms.

Similar Messages

  • How to set default audio device for java apps on Linux?

    I would like to find a way to choose a particular (ALSA) audio device for java applications. How can this be done without reprogramming the application or changing the default ALSA device? I came across "sound.properties", but could not find any information how to use this file on an ALSA system.
    Thanks for any help, Mark

    Eugenia wrote:Well, it's still not good enough.
    We can't satisfy everyone. What you want is a corner case. For most people ALSA and dmix works appropriately, and that is what esd uses by default. We cannot document and automate every configuration possible. That's up to the users.
    However, if you don't want to restart gnome, try the below... I make a few assumptions, but even if they're wrong, they're hardly difficult to work around.
    Just copy the /etc/esd.conf to ~/.esd.conf, make your change, then do killall esd. Presumably gnome will restart esd, and it ought to read your local config. If it doesnt, start it yourself.
    Feel free to write a script that automates this, or document it on the wiki.
    I have to restart Gnome to get this thing working. Other OSes *automatically* can use an alternative device. But if I change ESD, I will have to restart Gnome, no?
    Well, if you try my suggestion above, no. You can restart esd yourself. And that's what all the other distros do, except with some fancy GUI.
    James

  • Slider.verticalThumIcon ? How to set a custom icon for JSlider

    Hi Guys,
    Can anyone please tell me where I am going wrong in the code below.
    I am trying to change the thum icon for JSlider to a custom one, but for some reason the new thum icon is not getting displayed.....
    UIDefaults defaults = UIManager.getDefaults();
    defaults.put("Slider.verticalThumbIcon", new ImageIcon(Slider.class.getResource("./cursor.jpg")));
    defaults.put("Slider.background", Color.BLUE);
    final JSlider slider = new JSlider();
    slider.setPreferredSize(new Dimension(250,20));
    getContentPane().add(slider, BorderLayout.NORTH);
    I can see the blue background, BUT I still see the default thumb icon.
    I also tried using
    defaults.put("Slider.verticalThumbIcon", new ImageIcon("./cursor.jpg"));
    Thanks a ton...

    this works OK
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.plaf.basic.BasicSliderUI;
    import java.net.URL;
    import javax.imageio.ImageIO;
    class Testing extends JFrame
      public Testing()
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setLocation(200,100);
        JSlider slider = new JSlider(0,100,0);
        slider.setUI(new MyBasicSliderUI(slider));
        slider.setMajorTickSpacing(10);
        slider.setMinorTickSpacing(5);
        slider.setPaintTicks(true);
        slider.setPaintLabels(true);
        JPanel jp = new JPanel();
        jp.add(slider);
        getContentPane().add(slider);
        pack();
      class MyBasicSliderUI extends BasicSliderUI
        Image im;
        public MyBasicSliderUI(JSlider js)
          super(js);
        public void paintThumb(Graphics g)
          try
            URL url = new URL(getClass().getResource("Save.gif"), "Save.gif");
            im = ImageIO.read(url);
          catch(Exception e){e.printStackTrace();}
          Rectangle thumb = thumbRect;
          g.drawImage(im,thumb.x,thumb.y,null);
      public static void main(String[] args){new Testing().setVisible(true);}
    }

  • How to set a particular icon for a directory in the file system?

    Hello
    I'd like to know if it is possible, when creating a directory using file.mkdir(), to define a particular icon instead of the default system icon?
    If yes how to proceed?
    Thanks for your answer.
    David

    For XP you are going to have to dummy up one of these files:
    Desktop.ini
    I have no idea what some of the entries mean, but placing the file in the directory seems to do the trick
    [.ShellClassInfo]
    IconFile=%SystemDrive%\Downloads\IconSets\00946_tux\Tux Folder\Tux.ico
    IconIndex=0
    [{BE098140-A513-11D0-A3A4-00C04FD706EC}]
    Attributes=1
    IconArea_Image=%SystemDrive%\Pictures\cassie_0069.jpgThe file should be easy to write using Java , but what exact entries you need... try searching microsift ..........

  • How to set the Heap size for JAVA

    I am facing the memory out of space problem:
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Could anyone suggest me a solution to solve the problem ?
    increase the heap size ?
    anyway to increase the heap size in the program by default without additional setup?
    Thank you.

    How to determine the program must handled with increase heap size ?
    could I know any method to know whether the program is memory leaking or need large memory heap size?

  • "I would like to know how to set the default view for the columns. Somewhere I read it could be done in by music icon under Library.  Can't find it.  Thanks

    "I would like to know how to set the default view for the columns that are shown in iTunes. Every time I open it, I have to either go to the options, or right-click to get the pop-up options, and delete "rating" and add "composer." I'd really like to just do it once and be done with it."  Somewhere I read you could do this by clicking on the Music icon under LIBRARY then arramge the columns.  Trouble is, I can't find a Musi Folder or icon in my user library.
    Any help would be appreiated.  OSX 10.9.2  iTunes version 11.1.5  Thanks!!! CW!

    From the iTunes menu bar try View>Show View Options.  Make sure what you want to see is checked and what you don't is unchecked.  You can do this (may need to do this) for any playlists, your main Library, etc.
    Good luck
    srb

  • Sun ONE Studio 4 aka Forte: How to set the output path for classes ?

    Help !
    Beginner's question:
    Sun ONE Studio 4 aka Forte:
    How to set the output path for classes ?
    As default, the class files are created in the same directory as the
    sources.
    In opposite, both JBuilder and Together support that there is a tree
    with the sources and another tree with the classes.
    The first answer I got was "not possible with Forte, but just if you write your own "ANT Build script" !
    a) Please point me to a ready-to-use ANT script for this purpose, if such is available
    b) Is using ANT instead of the MAKE as comfortable ? Besides the separation of sourcecode and classes, I would like to keep everything else to be the same, i.e. I don�t want to edit the ANT file if I enlarge the project by directories or files.
    Tia
    Sincerely
    Rolf

    You can set S1S's options to place newly created .class files in a specific location.
    Identify the compiler that is being used - Open the S1S's Tools/Options window, expand Editing and select Java Sources. Note the Default Compiler value. (If it's one if the Ant options, you use Ant to specify this option, not S1S.)
    Open the S1S's Tools/Options window, expand Building/Compiler Types and select the appropriate compiler.
    The Properties tab of the compiler has the property Target, which sets the filesystem where the compiler output is directed. If you choose <not set>, the .class files are written to their source directory.
    When you set the Target, your change affects all classes that use this compiler.
    Very few options can't be set in S1S; the challenge is finding out where they're set!

  • How to set up Airport Extreme for 11ac and 11n?

    I have just purchased the new Airport Extreme (August 2014) because Apple's website states
    Simultaneous dual-band support.
    AirPort Extreme features simultaneous dual-band 802.11ac Wi‑Fi. That means it transmits at both the 2.4GHz and 5GHz frequencies at the same time. So no matter which band your wireless devices use, they’ll automatically connect to the best available band for the fastest possible performance.
    I have number of Macs in my home from a new MacBook Pro with Mavericks to a Macbook Air with Snow Leopard (due to required software) and iPads.
    So after setting up the new Extreme my new MacBook only accesses 11n as does my older Macs. I checked by holding down the option key while clicking the WiFi icon at the top of my Mac. Well, not so automatic then as I was expecting 11ac and 3 times faster access (as stated by Apple).
    I then looked for some documentation for setting up but cannot find anything.
    Hence my question here.
    How to set up Airport Extreme for 11ac and 11n simultaneously?
    At present the new Extreme is no better than my previous 2 year old one.
    Thank you.
    Michael

    How to set up Airport Extreme for 11ac and 11n simultaneously?
    Assuming that it is operating correctly, 802.11ac and 802.11b/g/n are broadcast simultaneously by default.
    Simultaneous dual-band support.
    AirPort Extreme features simultaneous dual-band 802.11ac Wi‑Fi. That means it transmits at both the 2.4GHz and 5GHz frequencies at the same time. So no matter which band your wireless devices use, they’ll automatically connect to the best available band for the fastest possible performance.
    That is advertising. The real information is usually found in the small and hard to read footnotes:
    Based on theoretical peak speeds. Actual speeds will be lower.
    AirPort Extreme is based on an IEEE 802.11ac draft specification. Performance based on comparison with Apple’s 802.11n products. Comparison assumes AirPort Extreme network with 802.11ac-enabled computer. Speed and range will be less if an 802.11a/b/g product joins the network. Accessing the wireless network requires a Wi‑Fi-enabled device. Actual speed will vary based on range, connection rate, site conditions, size of network, and other factors. Range will vary with site conditions.
    Since the 802.11ac signal is being broadcast only using the 5 GHz band, some users report that they have had better results by using the option to assign a different name to the 5 GHz band, and then pointing their Mac to that specific signal or network. You may want to try that option.
    But first as a test, please locate the MacBook Pro about 10-15 feet or 3-4 meters from the AirPort Extreme with clear line-of-sight between the two devices. Restart both the AirPort Extreme and the Macbook Pro and then check to see if the Mac is connected to an 802.11ac signal.
    If not, please power off your other wireless devices...computers, mobile devices, etc. temporarily, and try the same test again.
    Please report on your results.

  • HOW TO  SET A DEAFULT  VALUE  FOR A FIELD?

    hi friends
      i have doubt..how to  set a default  value for a field..say  like in  local printer field i always want  lp01 to  be displayed defaultly..when i  click  F1  in that  field i  get the parameter id ..i  know there is something  dealt with that  parameter id..how can i  set that  default value ..in the case of the default  printer value i made in  own data settings as lp01 but  how to  do it  normally  for other  field which has parameter id ??????
    thanks and regards
    prince

    Hi Prince,
    u can set the default value in abap as given below
    SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS : S_BUKRS TYPE BSID-BUKRS OBLIGATORY DEFAULT '1000'.
    PARAMETERS : S_BELNR TYPE BELNR_D OBLIGATORY DEFAULT '1600000070'.
    PARAMETERS : S_GJAHR TYPE GJAHR OBLIGATORY DEFAULT '2008'.
    PARAMETERS : ASON TYPE BUDAT OBLIGATORY DEFAULT SY-DATUM.
    PARAMETERS : S_KUNNR TYPE KUNNR MODIF ID GP1.
    PARAMETERS : S_LIFNR TYPE LIFNR MODIF ID GP2.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN : END OF BLOCK B1.
    or
    u can give the default value in INITIALIZATION also.
    vlue = '1000'.

  • How to set custom master page for social/sites.aspx in sharepoint 2013

    How to set custom master page for social/sites.aspx in sharepoint 2013.?
    File path is
    C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\FEATURES\SocialDataStore\SocialDataStoreList\sites.aspx
    Thanks in advance

    Hi,
    You could open the sites.aspx in Notepad or SharePoint designer, and set the master page to your own master page directly via editing:
    <%@ Page language="C#" MasterPageFile="~masterurl/custom.master"      Inherits="Microsoft.SharePoint.Portal.WebControls.FollowedContentWebPartPage,Microsoft.SharePoint.Portal,Version=15.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c"
    %>
    Regards,
    Rebecca Tu
    TechNet Community Support

  • How to set my own gui status when i use selection-screen

    how to set my own gui status when i use selection-screen command
    and
    how to set the names in the application tool bar when function keys are created

    Make sure that you do this in event "AT SELECTION-SCREEN OUTPUT".
    Run Txn ABAPDOCU and check 'DEMO_SEL_SCREEN_STATUS' for sample.
    Also check out following discussion -
    Selection Screen PF-STATUS
    Cheers,
    Sanjeev

  • How to set my own Ranges in Charts

    Hi-
    I've just started playing with making charts in Numbers.
    When I select some cells and then ask Numbers to produce a chart it does so and sets it's own values for the Y-Axis.
    How can I set MY OWN values for the upper and lower limits (ie. 0 at the bottom, and, say, 1000 at the top, and not the 200 at the bottom and 800 at the top that it is has put in automatically.)
    Thanks!

    Hi Andrew,
    Here is a Scatter Plot. Data must be in Body Cells, not Header Columns or Header Rows.
    Click on the graph and Format Panel > Axis > Value (Y)
    Set Max and Min to what you want. You can also change the number of steps if you don't like the default.
    The procedure is slightly different for a Category Chart (all the other types except Bubble Chart).
    Good ideas in New From Template Chooser > Charting Basics.
    Regards,
    Ian.

  • How to get File type icon for files store on Amazons3

    Hi,
    i want to know about how to get file type icons for files that we store on Amazons3.i am a devloper ,i want to make gui for accessing amazons3.
    so ,i want to know about how to get file type icons for files that we store on Amazons3.
    thanx in advance.

    hi,
    have u heard amazon simple storage service,that provides storage space for
    storing files, i am a devloper,i want to know the files that we store on amazon,how we can get file type icon for that files.
    i want to sample code in java for this.
    thanx in advance.

  • Setting my own ringtone for calls

    Can someone please tell me how I set my own ringtones and message tones as I have gone over it so many times its doing my head in now. Many thanks in advance

    You cannot set additional ringtones for messaging, but you can for ringtones.
    There are many ways to make ringtones. Several are explained here:
    http://www.iphoneatlas.com/2008/01/02/guide-the-many-methods-for-using-custom-ip hone-ringtones

  • SRM 4.0- How to set the default values for product type (01) only for SC

    The radio button “Service” should not be visible.
    Also for search help (e.g. search for internal products) where a search should only be possible for product type 01 (goods). The system should not display the product type and internally always search for goods only.
    How to set the default values for product type (01) only for SC
    We needs to use Search help BBPH_PRODUCT which having parameter PRODUCT_TYPE
    Here we can set defalut value 01 but it is not correct one since same search help is using several places.
    We need to limit the search help results only for SC.
    Kindly help out me ASAP.

    The easiest way to set defautl values is to edit the batch class.
    Goto the characteiristic and go to update values.
    In here you probably have something like 0 - 100 as a spec range.
    On the next line enter the default value within this range.  At the end of the line, click in the box in the column labelled "D".  This indicates the defautl value for the characteristic.
    If you need to you can do this in the material classification view as well.
    Just to be clear, these values will only show up in the batch record.  You can not have defautl values in resutls recording screens.
    FF

Maybe you are looking for

  • Black and white printing using Gutenprint

    My HP printer has no drivers in SL, but I can print using Gutenprint. The Gutenprint FAQ says For most users, the work-around is to set the Color Model setting to Grayscale. This is not the same as printing in black and white only, but it may give yo

  • How do I prevent tabs in the task bar from opening everytime I open a new Firefox tabs from the Start Menu?

    I have four tabs in my task bar at the bottom of my computer screen. If I go to Start and open a new Firefox window then all four tabs open automatically. How do I prevent all the tabs from opening?

  • Create Callback VI for IMAQdx Event - Broken Wire

    My application is using IMAQdx to communicate with a Basler camera. When my camera is triggered with a digital trigger, it sends out an event when exposre finishes. I can use this event to know when to grab an image. I have a working VI that uses an

  • Master Collection for Windows can be install on Mac?

    Hello Every One, I'm new to Mac and I have Adobe Creative Suite 5.5 Master Collection Student and Teacher Edition for Windows and I'd use it on Windows 7 until I decided switch to Mac Pro. I was able to download on my Mac Pro laptop but I can run the

  • Connect a webservice in a php page

    Hello to all forum, I have a big problem, I need to finish a project and missing a detail that I am not able to do is the following. In the address www.arandupropaganda.com.br/hbrasil is a site of an estate of meadows - São Paulo - Brazil, the link p