ImageIcon moves and buttons don't when resizing!

Hi,
when i resize my applet window, ImageIcon (which i'm using as background) moves along with the applet window, so it stays in the center. The buttons don't. As a result the buttons end up in the wrong place in the applet window compared to the background.
Does someone have a suggestion for me how to make the ImageIcon stay where it is?
Here is a piece of my source code. If more is needed, let me know.
static String imageFile = "kamer zonder kleppen.jpg";
public Kamer() {
     Container contentPane = getContentPane();
     contentPane.setLayout(new BorderLayout());
     Dichtbutton = new JButton("Dicht");
     Dichtbutton.setBounds(230, 271, 46, 25);
     Dichtbutton.setMargin(new Insets(0, 0, 0, 0));
     Dichtbutton.addActionListener(this);          
     contentPane.add(Dichtbutton);
     picture = new JLabel(new ImageIcon(imageFile));
     picture.setBounds(0,0,800,600);
     contentPane.add(picture);
     setVisible(true);
I hope someone can help me with this.

hi, i notiested that you set yoour buttons to be in certain predefined place:
Dichtbutton.setBounds(230, 271, 46, 25);
if you would upon any resize event calculate new position, then you would not have the problem you're having right now.
if you consult JButton's API then you find that there is inherited method from Component that allows you to set new location (setLocation()) for your button
see following url, that should end after 'int)' not before it:
http://java.sun.com/j2se/1.4.1/docs/api/java/awt/Component.html#setLocation(int, int)
but if you would like this button to move without you to code any resize event listeners, then you should use some layout manager, these pack your components on some certain places and upon resize repack it where they think it is apropriate for them to be.
L.

Similar Messages

  • HT1657 What happens when you rent movies and they don't play? How come that question is not on the list?

    What happens when you rent movies and they don't play and you tried getting credit for it?  I rented two movies which they were very very old movies in black & white and they both don't play.  I never had this problem before even when downloading videos. Now how can I get credit for it?  I contact itunes a number of times and no one has done nothing as of yet.  Itunes also asked me for my order number which I sent them but still no credit.

        Great question MommaBof4! This is actually something that can be completed. VZW does have the option to turn this feature on or off based upon the users request. If you would like to update this feature on your device please give us a call by dialing *611 send from your VZW device, thanks!
    MatthewS_VZW
    Follow us on Twitter @VZWSUPPORT

  • Since the new updates am unable to move and scale a photo when trying to apply it as wallpaper or to a contact.  Any ideas on how to fix this?

    SInce getting the new updates I am unable to move and scale a picture when I am trying to assign it as wallpaper or as a contact. Has anyone else had this problem and know how to fix it?

    It's a known issue. You do have more control if you go into the photos app, resize etc and then send it to your wallpaper. It wont' be perfect, but better.

  • When importing files into fcpx from go pro hero2, some are importing as .mov and some as .mp4. when making a multi cam clip it will only add one type, if you try and add the other it says camera clip cannot be processed.

    when importing files into fcpx from go pro hero2, some are importing as .mov and some as .mp4. when making a multi cam clip it will only add one type, if you try and add the other it says camera clip cannot be processed. need to figure out why it randomly imports differently, or how to add different file tyoes to multi cam.

    here is one that is imported and stays .mp4. the specs are same as original file before import.
    here is one that has changed somehow during import. specs on original file are same as above, but once it is imported it changes to this in event folder, and others randomly keep the above specs.

  • I rented 4 movies and I don't have enough space to download them. How do I get them off of my iPad?

    I Rented 4 movies and I don't have enough room to download them on my iPad. How do I remove them from my iPad.

    Download movies to iTunes (Computer)

  • Click wheel and buttons don't work on 5th gen.

    I have had my iPod for about half a year and for some reason my iPod buttons don't work. If I move the hold button it turns on but none of the other buttons work. It charges and everything. Does anyone know what to do?
    5th generation   Windows XP  

    There isn't any problem with your ipod, theres just a different way of going about when you put video games on your ipod. First, plug in your ipod. when your ipod icon appears on the left side where it usually does, click on it. Look at the top on the ipod screen that appears. The screen should give u info about your ipod. At the top look for an icon that says games. Pictures and a few other things are there but click on games. Once that screen appears click on the check mark that say sync games. After that it is pretty self explanatory. GoodLuck

  • Quicktime high cpu, and buttons don't work

    Hi, I'm mainly intending to use quicktime to export files to a readable format by my mp3 player. When I open a movie, click file, export, and then options, none of the bottons in the window will work besides the Fast Start/Fast Start-Compressed Header/Hinted Streaming Settings. All other buttons on the page won't work. They interact to the mouse clicks but nothing changes. This is the only screen that buttons don't work in, its fine with other things in quicktime. The CPU usage for quicktime is really high, always in the 90's, even when nothing is happening. And in task manager, quicktime's priority is automatically set to low, I never did this. It's the only program that acts up like this with the buttons, but other programs' priorities are automatically set to low as well. I've scanned for spyware, adware and viruses. Quicktime used to work, now it doesn't. I didn't change anything. I have quicktime's latest version.
    Thanks,
    Peter

    Send the form to [email protected] and I will have a look.
    Paul

  • I have bought some movies and the don't sync to my iPod touch it comes up with this message that says it cannot be played on my iPod. Please can someone help

    I have brought some movies and they just come up with this message that says it cannot be played on this iPod. I've bought movies before without iTunes Extras but these have iTunes extras and they don't want to sync with my iPod
    Does anyone know what is wrong?

    Sounds like you are trying to sync the HD version of the video.  You should try to download the Standard Definition copy instead and sync that to your device as HD content is only compatible with the 4G iPod Touch.  See here for more information:
    iTunes: May be unable to transfer videos to iPhone, iPad, or iPod
    To prevent HD versions from being downloaded in the future head to the iTunes Store, click the Purchased link, and then select TV Shows and remove the tick mark next to Download HD when available.  You should be able to download the SD version now from under this same page.
    B-rock

  • Movie and TV thumbnails disappear when sync to Ipad

    Whenever I sync my Ipad to my Itunes on my MBP to add a movie or tv show to the Ipad, the rest of my movies and TV shows on my Ipad lose the thumbnails to the tv show or movies.  Only way to get them back is to delete the show and movies and redownload them.   This is VERY frustrating.  Is there a better solution that someone knows about?
    Thanks
    Bryan

    I don't use this feature and I'm not sure this is the reason - but do you have restrictions enabled on the devices? If so, I don't know if they will sync from iTunes. You can try turning it off it you have it enabled. Go to Settings>General>Restrictions and turn it off and then try to sync the movies.
    The other generic fixes would be to restart both of your iDevices and then maybe try a reset - hold down on the sleep and home buttons for about 10 seconds until the Apple logo appears. See if they will sync then.

  • Creating Input and Button UI Element when doing an action

    Dear All,
    I have a requirement like this, initially i have one button in view, when i click on that button i need to add some group of input fields(say 10) and one button. can we achieve this? any code help pelase..
    Thanks and Regards,
    Venkat.

    Hi,
    first create two context attribute in the context
    named flag and count
    FLAG should be of type WDY_BOOLEAN.
    COUNT should be of type INT1.
    then just copy paste the code it will work .
    Use the following code for creating 10 input fields and one button dynamically in one row.
    write this code in wddomodify
    DATA lo_el_context TYPE REF TO if_wd_context_element.
        DATA ls_context TYPE wd_this->element_context.
        DATA lv_flag LIKE ls_context-flag.
    *   get element via lead selection
        lo_el_context = wd_context->get_element(  ).
    *   get single attribute
        lo_el_context->get_attribute(
          EXPORTING
            name =  `FLAG`
          IMPORTING
            value = lv_flag ).
      DATA lv_count LIKE ls_context-count.
    * get element via lead selection
      lo_el_context = wd_context->get_element(  ).
    * get single attribute
      lo_el_context->get_attribute(
        EXPORTING
          name =  `COUNT`
        IMPORTING
          value = lv_count ).
    if lv_flag = abap_true.
    Data name1 type STRING value 'NODE'.
    data COUNT1 type string.
    data attr_name type string value 'ATTR'.
    data indx type String.
    data tr_name type STRING value 'TR'.
    data inp_name type string value 'INP'.
    count1 = lv_count.
    concatenate name1 count1 into name1.
    condense name1.
    concatenate tr_name count1 into tr_name.
    condense tr_name.
    data: lr_container type ref to cl_wd_transparent_container.
    data: lr_container1 type ref to cl_wd_transparent_container.
    data: lr_flow_data type ref to cl_wd_flow_data.
    data: lr_matrix type ref to cl_wd_matrix_head_data.
    data: lr_matrix1 type ref to cl_wd_matrix_data.
    data :lr_button type ref to cl_wd_button.
    lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
    lr_button = cl_wd_button=>new_button( text = 'Add' on_action = 'CREATE' id = TR_NAME ).
    data lo_node type ref to if_wd_context_node.
      data lo_node_child type ref to if_wd_context_node.
    data lo_node_info type ref to if_wd_context_node_info.
    data lo_childnode_info type ref to if_wd_context_node_info.
    DATA EL TYPE REF TO IF_WD_CONTEXT_ELEMENT.
    data bind_val type String.
    lo_node_info = wd_context->get_node_info( ).
    lo_node_info->ADD_NEW_CHILD_NODE( name = name1 ).
    lo_node_child = wd_context->get_child_node( name = name1 ).
    EL = LO_NODE_CHILD->CREATE_ELEMENT( ).
    LO_NODE_CHILD->BIND_ELEMENT( EL ).
    lo_childnode_info = lo_node_child->get_node_info( ).
    do 10 times.
      data attr type WDR_CONTEXT_ATTRIBUTE_INFO.
      indx = sy-index.
      concatenate attr_name indx into attr_name.
      condense attr_name.
      attr-name = attr_name.
      attr-TYPE_NAME = 'STRING'.
    lo_childnode_info->add_attribute( attr ).
    concatenate name1 '.' attr_name into bind_val.
    condense bind_val.
    condense count1.
    condense indx.
    concatenate inp_name indx count1 into inp_name.
    condense inp_name.
    data lr_input type ref to CL_WD_INPUT_FIELD.
    CALL METHOD CL_WD_INPUT_FIELD=>NEW_INPUT_FIELD
    exporting
    bind_value =  bind_val
    id = inp_name
    RECEIVING
    CONTROL = lr_INPUT.
    IF sy-index = 1.
    lr_matrix = cl_wd_matrix_head_data=>new_matrix_head_data( lr_INPUT ).
    lr_INPUT->set_layout_data( lr_matrix  ).
    else.
    lr_matrix1 = cl_wd_matrix_data=>new_matrix_data( lr_INPUT ).
    lr_INPUT->set_layout_data( lr_matrix1  ).
    endif.
    lr_container->add_child( lr_INPUT ).
    inp_name = 'INP'.
    enddo.
    lr_matrix1 = cl_wd_matrix_data=>new_matrix_data( lr_button ).
    lr_button->set_layout_data( lr_matrix1  ).
    lr_container->add_child( lr_button ).
    * get element via lead selection
      lo_el_context = wd_context->get_element(  ).
    * get single attribute
      lo_el_context->set_attribute(
        EXPORTING
          name =  `FLAG`
          value = abap_false ).
      endif.
    create first button manually and give it an action named 'CREATE'
    wirte the following code in the eventhandler of the first button.
    DATA lo_el_context TYPE REF TO if_wd_context_element.
        DATA ls_context TYPE wd_this->element_context.
        DATA lv_flag LIKE ls_context-flag.
    *   get element via lead selection
        lo_el_context = wd_context->get_element(  ).
    *   get single attribute
        lo_el_context->set_attribute(
            name =  `FLAG`
            value = abap_true ).
      DATA lv_count LIKE ls_context-count.
    * get element via lead selection
      lo_el_context = wd_context->get_element(  ).
    * get single attribute
      lo_el_context->get_attribute(
        EXPORTING
          name =  `COUNT`
        IMPORTING
          value = lv_count ).
    lv_count = lv_count + 1.
    lo_el_context->set_attribute(
        EXPORTING
          name =  `COUNT`
          value = lv_count ).
    let me know if you need further assistance
    thanks
    sarbjeet singh
    Edited by: sarbjeet  singh on Jan 17, 2011 4:23 PM

  • I'm using Windows 8.  I have 2 folders in my videos library - movies and personal videos.  When I try to import a movie into iTunes, it puts it in the Home Video section and if I import a personal video, it puts it into the home video section.  what up?

    Im using Win8.  I originally had all my ripped movies in a movie folder listed in the videos library.  This imported into iTunes movies with no issue.  I later added a second folder t my library - personal videos where i put all my home videos.  I was able to import this into iTunes and it showed up in "Home Movies" - very cool and exactly what I wanted.  Now, if I add a new ripped movie and put it in my movie librairy and try to import it into iTunes, it places it in Home Movies.  And if I put a new personal video, it will also import into iTunes under 'Home Video?.  What is going on here??  Any help would be greatly appreciated - it seems like this is a bug in iTunes 11.

    I thank you for the response.  Apple does some assinine things sometimes and this is one of them.  Ask the planet the difference between a movie and a home video and with the exception of Apple, you'd get 100% consenus on the what difference is.  A home video is something that I shoot, like my kids birthday party.  A movie is something I urchased either via download or a DVD that I ripped.  Unbelievable!   The fact that Apple has chosen not to distinguish based upon which folder I tell it is Movies and which folder is Home Videos is really hard to fathom - sounds like something Windows would do. I find it funny that in my iTunes movies sub-section of the movies section, the movie icons have a cloud icon in upper right corner to distinguish it as bought from Apple iTunes versus no cloud icon for movies that I have ripped - so the distintion was already made and clearly visible.  Now - everything just defaults to "home videos" if I try to import a new ripped DVD - why even bother to have this distinction on the iTunes bar?  WOW!
    As for your direction, I do not understand what you are telling me - what Media Kind and what Options tab are you referring to?  I see no Options tab in iTunes.  Right licking on the movie icon does not yield media kind or options as well.  Gping to the source file does not yield these options either.
    Thanks again for your help.
    Clay

  • Touch wheel and buttons don't work

    Touch wheel and buttons dont work. Ipod works with my Alpine car stereo, while using the stereos selector wheel. Sometimes the Ipod tries to work normally, but the buttons still won't work.

    You might want to try the five R's
    iPod Issues?
    These five steps (known as the five Rs) will conquer most iPod issues.
    1. Reset your iPod.
    2. Retry with a different USB port.
    3. Restart your computer.
    4. Reinstall iPod and iTunes software.
    5. Restore your iPod.
    If none of these work, the easiest thing to do is go to the "great" Apple store they know everything overthere.
    DELL 4600   Windows XP   Apple iPod, 5G, 30GB, white

  • The stills in my movie project do not respond when I try to edit their "duration" I change it  the clip inspector and click done, but when I exit clip inspector , it reverts back to what it was prior to my trying to change it?

    The stills in my i movie project will not allow me to edit the duration time. I change it in the clip inspector, but when I click done, it just reverts back to what it was prior to my attempt to change it?

    Hi There,
    I tried your workflow and some how I am not able to see your issue.
    - Will it be possible for you to share your project(where-in you always see this issue) with us. You can upload your project and send the link to maanand (at the rate of ) adobe (dot) com.
    - If sharing of project isn' t possible then please share the project details such as no of slides, objects etc.
    -Manish
    blogs.adobe.com/captivate

  • I just upgraded to 10...and now links and buttons black out when my cursor moves over them, and my entire window goes black whenever I scroll.

    I just upgraded to Firefox 10 and had to go back to 3.6 because 10 doesn't seem to work on my computer. I have a windows 7 pc. After upgrading, whenever I moved my cursor over a button or link, that link blanks out or a black bock appears over it. Additionally, whenever I try to scroll, the entire window goes black until I stop scrolling.

    Hi Nester88,
    I'd try starting Firefox in [[Safe Mode]]. If you don't have the issue while all of your add-ons, extensions, and themes are disabled, you can try adding them back in one by one until you find the culprit.
    Hopefully this helps!

  • HELP!! i cant export my movie and keep good quality when I put it on youtub

    On my final cut express, the movie looks great, Great quality and great sound. But when I export it, it loses so much quality, and looks terrible online. I know you should lose some quilty, but this is more then some, it looks bad.
    Ive tried so many different ways to export it. Its only a 4 min music video, and youtube and myspace allow up to a gig. I don’t under stand it help!!
    If u want to see what im talking about go to www.wearetheweekend.com

    File>Export>Using QuickTime Conversion.
    Change the "Default Settings" to "Broadband High" from the dropdown menu and click Save.
    PS. The link you gave seemed reasonably OK for an internet video.
    Message was edited by: Ian R. Brown

Maybe you are looking for

  • RAID-1 performance with Sun v40z

    We are using Sun v40z machines with built in LSI RAID controller (RAID level 1). I was wondering about the performance of RAID on these machines. Our application does a lot of I/O (mainly random and sequential reads). Since we are using a RAID-1 syst

  • Maintenance Cost Settlement on Profitability Segment

    Hi, Can anyone tell me, that how can we settle our Maintenance Cost from PM to a Profit Center. In my company there is a Cost receiver defined as Profitability Segment and available in Settlement Rule. Can anyone explain, what does it mean. Are we se

  • MBAM 2.5 - Client Errors 0x803D0006, 0x803D0010 and 0x803D0005

    I've seen multiple posts here about these errors but none have provided a solution for my issue. In the title of this thread, I've mentioned three error codes. I first get the 006 code which shows that my client could not reach the endpoint in the al

  • How can I ignore server certificate for wireless connection?

    I just got a Treo 800w and can't get it connected to my work wireless.  It uses PEAP MS-CHAPV2.  How can I get the device to ignore the server certificate? Thanks,   Adam Post relates to: Treo 800w (Sprint)

  • Plantronics Voyager PLT-510 not audible with iPhone

    http://discussions.apple.com/thread.jspa?threadID=1701919 http://discussions.apple.com/thread.jspa?messageID=8877788 I'm just following up from the above prematurely archived threads (what is with this forum doing that before an issue is resolved!).