How can I set path to icon

I am using NetBeans 5.5.
Some part of my JavaSE application I made with help of GUIBuilder + I've worte my own code for GUI.
The problem is:
My buttons use icons.
When I launch my app in NetBeans - everything is O.K.
But
When I try to lauch my jar file "myproject/dist/myproject.jar"
I get an error
"myButtonIcon.jpg is not found"
Through GUIBuilder I have several ways to set icon to button:
1.File. It makes HARD link to file, like:
jButton3report.setIcon(new javax.swing.ImageIcon("D:\\source\\Dfree\\resource\\menuoldico\\report.jpg"));That is awful variant! But jar file launches - no errors
2.Classpath. It lokks like this way:
jButton1workdoc.setIcon(new javax.swing.ImageIcon(getClass().getResource("/menuoldico_/adddocument.jpg")));Seems that's ok.
I've added folder resourse as[b] library to project.
folder menuoldico lies there.
I put my lib with icon folder near jar file.
Ni result!
It doesnt' work
Where is mistake?
P.S.
JDBC connector lies in the same forlder, and jar file can find it and use
but jar file doesn't see folder with icons
Help me please.

Hm...seems like this is another good variant.
But there is a way to put icons into jar!
1. Just create folder (for example "MyIconsSet") in folder "MyProject/src"
2. Put there all icons or images you want to use.
3. NetBeans recognizes created folder "MyIconSet" as package
4. Just write path to icon as:
jButton1workdoc.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/adddocument.jpg")));NetBeans will include this "package" into jar. The easiest and convinient way
And you will not have any problems!!!
I didn't read manual properly.
It's written there!
Problem is solved.
kynamar, thanks for your code.
Message was edited by:
Holod

Similar Messages

  • How can I set PATH environment variables when there is no ~/.profile?

    Hi,
    I have a MacBook Air and just installed MySQL.
    I read the doc which I downloaded and should be able to run "mysql" from terminal as descibed below:
    Suppose that your MySQL programs are installed in /usr/local/mysql/bin and that you want to make it easy to invoke these programs. To do this, set the value of the PATH environment variable to include that directory. For example, if your shell is bash, add the following line to your .bashrc file:
               PATH=${PATH}:/usr/local/mysql/bin
    I checked on my terminal with ls -al, but no ~/.bashrc also no ~/.profile files.  Echo $SHELL shows me that I am using /bin/bash as shell.
    When I run export PATH=$PATH:/usr/local/mysql/bin  then it works and I just have to type "mysql" to get the mysql command line but as soon as I kill my terminal and open a new terminal this setting is lost.
    Any idea how I can accomplish this?
    Thanks,
    MacNewby

    Hi,
    Never mind, I found it :-)
    I just created a file  .bash_profile in my home folder and added "export PATH=$PATH:/usr/local/mysql/bin" and restarted my terninal. Now it works.
    MacNewby

  • How can i set a path for my deployment files in weblogic server 10.3

    Hi
    How can i set the path for my WAR ,JAR files while deploying.i am using the wls10.3 version.
    is there any scripts for this ,please provide me.
    my Application is ADF 11g application.

    By "path", I assume you mean "classpath".
    The simplest way is simply to include the jars you need inside the web application or web module's WEB-INF/lib directory, EJB module's META-INF/lib directory, or EAR lib directory.
    If that's not practical, if you use NodeManager to start your servers, you can go to the "Server Start" tab in the server definition in the WebLogic console and edit the "Classpath" field, which defaults to no value. You can specify a classpath value there. Note that if you specify a value there, it REPLACES the default classpath for the server, it doesn't add to it. If you need to just add to it (a much more likely scenario), if the value references the value "$CLASSPATH" in it, that will reference the original classpath value that the server would have had.
    So, for instance, if you wanted to include the MQ jars in the server classpath, you could set a value like this:
    /usr/java/mq/lib/mq.jar:/usr/java/mq/lib/mqstuff.jar:$CLASSPATH

  • How can i set class path in ubuntu JAVA_HOME ?

    how can i set class path in ubuntu <JAVA_HOME>?

    Note that on *nix
    environment variable names are case sensitive.
    Also, you are again being vague; is it [this it|http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html] or [that it|http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/java.html]

  • 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

  • How can I set icons bigger?

    WHAT AN * YOU ARE!!!
    What you were thinking when you made Firefox 4???
    Can't you understand that people have different kinds of eyes.
    THE ICONS ARE TOO SMALL!!!
    I mean bookmarks, history etc. in the right upper corner.
    How can I set those icons bigger. I think I can't. Am I right?
    Did you make Firefox 4 just for your self or the other people???!!! WHAT?
    GOODBYE FIREFOX! AND WELCOME INTERNET EXPLORER 9.
    ''Edited for language - TonyE''

    What is the setting for the icon size in the customize window?
    Open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout"
    If you need to increase or decrease the size of fonts and other elements in the user interface and web pages then you can do this:
    Increase the String pref layout.css.devPixelsPerPx from 1.0 to 2.0 in 0.1 steps to see what works best.
    In current Firefox versions this pref is a String value parsed to a float and allows to fine tune the dimensions of all elements (user interface and web pages) more precisely.
    See:
    * http://kb.mozillazine.org/about%3Aconfig

  • How can I set BPEL server enviorment and create BPEL domain?

    Without use the http console, how can I set BPEL server enviorment and create BPEL domain?
    When I try to use API like below
    import com.oracle.bpel.client.Server;
    Server s = new Server(ServerAuthFactory.authenticate("oracle","localhost"));
    But I always got four exceptions and one warning like below:
    java.io.FileNotFoundException: C:\Workspace\WOSEDISystem\BPEL_Domain_Creation\config\security.properties (The system cannot find the path specified)
    java.io.FileNotFoundException: C:\Workspace\WOSEDISystem\BPEL_Domain_Creation\config\ejb.properties (The system cannot find the path specified)
    Warning: unable to read transaction.interoperability config property
    java.io.FileNotFoundException: C:\Workspace\WOSEDISystem\BPEL_Domain_Creation\config\security.properties (The system cannot find the path specified)
    java.lang.Exception: Failed to create "ejb/collaxa/system/ServerBean" bean; exception reported is: "javax.naming.CommunicationException: Can't find SerialContextProvider
    Is it right to use com.oracle.bpel.client.Server like this, please help me.
    Best regards,
    Vita

    Anyone can help me? Because I need deploy BPEL process on production server, so I need the Java funtion to create domain. Thank you very much if you can tell me the correct method of using com.oracle.bpel.client.Server API.

  • How can I set up an email signature in the Nokia 822

    How can I set up an email signature in the Nokia 822?

        Great question, Robobenn! Here is how to add the signature:
    From the Start screen, tap the Mail tile.
    Tap the More icon.
    Tap settings.
    To enable, tap the Signature on/off switch.
    Scroll to, then tap the Signature field.
    Enter the desired signature, then tap the Checked icon.
    For additional support, go to: vzw.com/support
    Thank you,
    LenaA_VZW
    Follow us on Twitter @VZWSupport

  • E-mail synch, read/unread, how can I set this up?

    I'd like to refer to an older question I found which hadn't been answered properly.
    https://discussions.apple.com/thread/3557308?start=0&tstart=0
    Quite simply, the question is;
    I have my work e-mail, my Hotmail and my Gmail all set-up on my iPhone 4S and my iPad 1st gen.
    When I read an e-mail on the computer via browser or outlook, I would like for this e-mail to appear as READ on my devices as well.
    Vise versa for when I read it on the iPad/Phone and I want that e-mail to show as read on Outlook and browser.
    Because this doesn't happen automatically, the Mail icon on my home screen is constantly showing over 1K e-mails, when in reality I may have like 10 on each e-mail account.
    How can I set this up?
    Is it possible for my to set this up for deleting e-mails also?
    I know I can do that on Gmail, delete from server blah blah, but how about when I delete e-mail from Outlook...I want them to be off my phone also.
    It's a business e-mail, and I get like over 50 read/received notifications that spam my inbox.
    Thank you for taking the time to read and for any advice you may have.

    Please go to
    1.Setting
    2. mail,contacts and calenders
    3. add accounts
    4. insert your email account and password
    5. Autometically imports your mails if you open mail folder on the desktop..
    That is it.

  • How can i set an image to a portal

    how can i set an image to a portal using response.write();
    please guide me i have an image in C drive how to get the image

    Hello,
    you can use the HTML Tag:
    <img src="file://c:/path/image.jpg" />
    Regards
    Gregor

  • How can I set the data binding between Web Dynpro & Database table

    Dear friend,
    I am a beginner of Web Dynpro. I want to develop my simple project like these:
    1. Create my own database table via Dictionary Project such as TAB_USER and have 3 fields: USER_ID, USER_NAME, USER_POSITION and I have already deployed & archived it.
    2. Create my own Web Dynpro Project, and create the input fields as User ID, User name, User position and icon 'Save' on the selection screen and I have deployed it already.
    For the process, I want to input data at the screen and save the data in the table, please give me the guide line like these:
    1. How can I set the data binding between Web Dynpro and Database table ?
    2.  Are there any nescessary steps that I will concern for this case?
    Sorry if my question is simple, I had try  to find solution myself, but it not found
    Thanks in advances,
    SeMs

    Hi,
    You can write your own connection class for establishing the connection with DB.
    Ex:
    public class  ConnectionClass {
    static Connection con = null;
    public static Connection getConnection() {
    try{
    Context ctx = new InitialContext();
    DataSource ds = (DataSource) ctx.lookup("jdbc/TSPAGE");
    con = ds.getConnection();
    return con;
    }catch(Exception e){
    return null;
    You can place the above class file in src folder and you can use this class in webdynpro.
    You can have another UserInfo class for reading and writing the data into the DB .
    Regards, Anilkumar
    PS : Refer
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/java/simple java bean generator for database.pdf
    Message was edited by: Anilkumar Vippagunta

  • In EIC, how can we set the SLA of a subcategory to none SLA-related.

    Hi Experts,
    This is our current setup in EIC...
    Category 0501 has an SLA of 8 hours. Subcategory 050101 has to be none SLA relevant. But if we put zero or blank to the SLA Target Value field, it will automatically have a due date defaulted to today. If we will not indicate 050101 on the configuration, it will have the 0501 SLA of 8 hours.
    How can we set the 050101 SLA off?
    The path: IMG --> Personnel Management --> Employee Interaction Center (EIC) --> Interaction Center Web-Client --> Application Functions --> Activity --> Service Level Agreement (SLA) --> Define SLV Properties
    Thanks in advance.

    Hi Harish and Jarret.
    @Harish, I already tried unchecking the checkbox of the Display field but the problem with this is, it will also apply for the rest of the categories. It should only be for this specific subcategory.
    @Jarret, apology, but can you explain to me further about your instruction/advise? I get the feeling that we're on to something with your advise but I didn't quite get it on how to exactly.
    1. You should build the SLA from the lowest level up...
                        -I'm not really sure how, actually.
    2. If you have 8 subcats... will put the 8 entries in the table...
                        -where do I put the 1 subcat? This is because if I don't put that "No SLA" subcat in the table, the due date of that specific subcat will automatically appear todayu2019s date.
    Thanks for both of you. I really appreciate your help. 

  • I want to email photos on a different email system, gmail. How can I get the email icon of iphoto to put my photo on a gmail email?

    I want to email photos on a different email system, gmail. How can I get the email icon of iphoto to put my photo on a gmail email?

    If you have Mail setup a a client for your Gmail account set iPhoto to use Mail.  Then select one of Mail's stationary templates for photos and use it. May not be as good as the iPhoto templates but will be fancier than a plain email window.
    Click to view full size
    OT

  • How can I get an iMessage icon on my iPad2 screen?

    How can I get an iMessage icon on my iPad2screen?

    It should be on one of your iPad screen unless you have set restriction
    Settings>General>Restrictions

  • How can I set two different emails in only one contact form?

    How can I set two different emails in only one contact form?

    To enter multiple email address with the Contact Form Widgets:
    Click the Options icon for the selected widget, then
    In the Email to box, enter multiple emails by delimiting them with a semi-colon. For example: [email protected];[email protected]
    Cari

Maybe you are looking for