Results 1 to 2 of 2
  1. #1
    goffy is offline Member
    Join Date
    Apr 2010
    Location
    Cambridge
    Posts
    30
    Rep Power
    0

    Default Help with radiobutton!

    Hello there im struggling to add a radiobutton formula to my project.
    What i finally aim to create is a small map of my college, which has a radiobutton with two colums, this can be used to find out the distance between college hotspots.
    To do this i have created several different maps with hotspots on them, when the two radiolabel colums are filled out, this will show a picture of the map with the two hotspots highlighted.

    I feel i have everything setup perfectly, however my createImageIcon is not working and it's frustrating me as i do not know what i am doing wrong!
    Heres a snippet!

    Java Code:
            picture.setIcon([COLOR="Red"]createImageIcon[/COLOR]("image\" + receptionString + ".png"));
            picture.setPreferredSize(new Dimension(177, 122));
            map.add(receptionbutton);
            map.add(map, BorderLayout.LINE_START);
            map.add(picture, BorderLayout.CENTER);
    Any help would be appreciated!

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Are you sure that the program is looking in the right spot for the images? Do you know what the user directory for this app is? Is it Jar'd or an applet?

    To find the user directory, have this line of code run:

    Java Code:
    System.out.println(System.getProperty("user.dir"));
    and this may be the base path where your program starts looking for the icon.

Similar Threads

  1. RadioButton clearSelection Problem
    By Aniczka in forum New To Java
    Replies: 3
    Last Post: 10-31-2009, 02:26 PM
  2. uses of radiobutton...
    By mlibot in forum New To Java
    Replies: 22
    Last Post: 09-17-2009, 08:33 AM
  3. freeze radioButton without disable them
    By itaipee in forum AWT / Swing
    Replies: 5
    Last Post: 05-25-2009, 09:29 AM
  4. RadioButton
    By tiger100plus in forum New To Java
    Replies: 1
    Last Post: 01-05-2009, 08:04 PM
  5. radiobutton selection
    By newtojava7 in forum New To Java
    Replies: 1
    Last Post: 03-17-2008, 02:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •