Adding JLabel relative to button

In the post given below(previous post), what need to be done, if I need to have a JLabel indicating name, exactly under that button.
It should be something like, the name displayed under an icon
http://forums.sun.com/thread.jspa?threadID=5322424&tstart=0
Rony

>
It should be something like, the name displayed under an icon >
import java.awt.*;
import javax.swing.*;
import java.net.URL;
class LabelAlignment {
  public static void main(String[] args) throws Exception {
    final URL url = new URL(
      "http://pscode.org/media/starzoom-thumb.gif");
    Runnable r = new Runnable() {
      public void run() {
        ImageIcon ii = new ImageIcon(url);
        // one layout, that when nested in other layouts,
        // can achieve the appearance of an icon with label
        // centered below it.
        JPanel iconWithLabel = new JPanel( new BorderLayout() );
        iconWithLabel.add(new JLabel(ii), BorderLayout.CENTER);
        JLabel label = new JLabel("Zooming Stars",
          // make sure it is CENTER aligned
          SwingConstants.CENTER);
        iconWithLabel.add(label, BorderLayout.SOUTH);
        JOptionPane.showMessageDialog( null, iconWithLabel );
    EventQueue.invokeLater(r);
}

Similar Messages

  • Have to toggle "Relative to" button each time I try to change an image source

    Dreamweaver CS4 running on Windows 7. 
    When changing an existing image on an existing web page in Dreamweaver by double-clicking the existing image on the page to open the Select Image Source panel, I have to toggle the "Relative to" (Site Root / Document) button for each image.
    In other words, say that when using Design view, I want to replace img1.jpg with img3.jpg, and IMG2.jpg with img4.jpg,   The steps I have to take are:
    1. Double click img1.jpg on the page to open the Select Image Source panel.
    2. Select img3.jpg. 
    3. Click the Relative to button at the bottom of the panel and change it from whichever it is on (Site Root, let's say) to the other option (Document).
    4, Then click OK.
    5. Double click img2.jpg on the page...
    6. Select img4.jpg
    7 Select the other option (SIte Root) in the Relative to drop down
    8. Then click OK
    9. Repeat for each image whose source is being changed.  If one is relative to Site Root, the next will have to be relative to Document, then the next again I have to select Site Root, etc.
    If I don't select the other relative to option, the image source path will not change when I click OK.
    Default Link Relative To in site definition is set to Document.
    It's been like this for weeks now and it's starting to get annoying.  Any ideas?

    David, I tried deleting the corrupt cache flie, no difference.  Deleted the config folder, same.  Other than I lost the extensions... and had to reinstall them.
    However, John's answer is correct.  And clicking another image before clicking the one I want is faster than the way I was doing it.
    It makes no difference if they are .png .jpg or .gif images.
    By the way, I was wrong about my DW version.  Turns out it's CS3.  Guess it's time to upgrade... one of thes days!
    Thanks everyone!
    Message was edited by: tarfh, to add sentence about png images.

  • User exit/ BADI in f-32 / f-28 for adding application tool bar button

    Hi Experts,
    There is a requirement, for adding application tool bar button in the Transaction codes F-32 / F-28 / Feba_lockbox. So that while clearing documents with reference document, they can upload the data(Reference Documents) from local file and after the data is fetched for clearing, they need to download the data to local file for verification. If the data is verified to be okay, then they can go ahead with simulation and posting. They need this verification to be done in excel sheet, so need to download the data into local file.
    I found a BADI in that screen is BADI_LAYER but I don't think it is relevant.         
    Any help is apreciated!
    Is there any EXIT ? Because I can not find it too.
    Regards,
    Nitin

    where you did the enhancement?
    I have to create the IDOC once Clear docuemnt is created.. It may help me.

  • Related Topics Button disappearing

    Am I not allowed to use "Related Topics" button/links over a
    network drive, or
    does it require unique configuration or security? Many of our
    clients run their
    application over a network drive, thus, our compiled Help
    Topics must be
    operational for them. Thanks.
    email me if possible: [email protected]

    Hi spiraljoe,,
    take a look at the following message
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=449&threadid=1030613&hi ghlight_key=y&keyword1=related%20topics
    You an use the search feature on the forums to run a query on
    'related topics button'
    cheers
    Craig

  • ALV Grid default values for new rows added with Add/Insert buttons

    Hi!
    Help, please,  to find a way how to set default values for new rows added with Add/Insert buttons in
    ALV Grid.

    I have found salution:
    ALV Grid u2013 Insert row function
    Sometimes we need to assign some default values when we create a new row in a grid using standard ALV Append row button. In our scenario we will see how to assign default values to Airline Code (CARRID), Flight Connection Number (CONNID) and Flight date (FLDATE) when a new row is created. To do that we need to handle DATA_CHANGED event in the program like mentioned below.
    Definition of a class:
    Code:
          CLASS lcl_event_receiver DEFINITION
    CLASS LCL_EVENT_RECEIVER DEFINITION.
      PUBLIC SECTION.
    METHODS:
         handle_data_changed
         FOR EVENT data_changed OF cl_gui_alv_grid
         IMPORTING er_data_changed
                           e_ucomm.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
    Implementation of a class:
    Code:
    CLASS LCL_EVENT_RECEIVER IMPLEMENTATION.
      METHOD HANDLE_DATA_CHANGED.
        DATA: dl_ins_row TYPE lvc_s_moce.   " Insert Row
          FIELD-SYMBOLS: <fs> TYPE table.    " Output table
    Loop at the inserted rows table and assign default values
        LOOP AT er_data_changed->mt_inserted_rows INTO dl_ins_row.
          ASSIGN er_data_changed->mp_mod_rows->* TO <fs>.
          loop at <fs> into ls_outtab.
            ls_outtab-carrid  = 'LH'.
            ls_outtab-connid  = '400'.
            ls_outtab-fldate  = sy-datum.
            MODIFY <fs> FROM ls_outtab INDEX sy-tabix.
          endloop.
        endloop.
      ENDMETHOD.                    "handle_data_changed
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
    Register the events to trigger DATA_CHANGED event when a new row is created.
    Code:
        CALL METHOD OBJ_GRID->REGISTER_EDIT_EVENT
          EXPORTING
            I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_ENTER.
        CALL METHOD OBJ_GRID->REGISTER_EDIT_EVENT
          EXPORTING
            I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED.

  • "Hide Related Messages" button shouldn't be grayed out

    New iMac, OS X Lion, Mail 5.1, everything migrated over from older iMac running Snow Leopard
    Getting used to the way Lion handles some things in Mail has been a challenge for one of my coworkers. But this one has me stumped.
    Normally, when you select a message that is part of a Conversation, you can click on the "Hide Related Messages" button to look at just the message you have selected. But, for this person, the "Hide Related Messages" button is grayed out - even when a message that's part of a conversation with multiple messages is selected. They really want to be able to look at their messages one at a time without seeing every message tied to it as well.
    Does anyone have any suggestions?

    Anyone?

  • Adding text to a button.

    Can anyone tell me how to add text to a button I created? If it changes anything, it is a sub-menu button

    Hi:
    Sorry if it sounds like a RT_M answer, but look in the User Manual for the topic Adding Text to a Button and you'll get the step by step procedure.
    If it don't answer your question or you mean something different come back please !
      Alberto

  • Adding text to a button, and related button fun

    Ok, I'm new to AS3 (only been doing it for a couple weeks
    now, never really learned AS2), so help would be great, especially
    as the deadline was more then a week ago (not all my fault there)
    I put a text field inside a button and tried to put text in
    that button's text field via the following:
    hmm.. I'm new to the forum I guess... don't know if it added
    the code, the code is: instancenameofbutton.textfieldinstance.text
    = "play";
    Well that seems not to work... so how do I make it obey my
    auth-or-a-tah?
    Am I perhaps just slash dot syntax impaired?
    Trouble seem to be that putting text over the button blocks
    the event.. Is there another way to skin this cat?
    A related problem I haven't been able to fix is.. I have a
    text field with dynamic text.. numbers, and I want it to be bold.
    Where I'm at in trying to figure out the solution is that bold
    dynamic text needs to be specially embedded.. Well, I follow what
    the help system tells me to do.. and nothing seems to actually
    work. Is there a bug here or something?
    Ok, one last related thing.. I'm following the book on
    "things thou shalt not do" in that I have a good amount of moving
    transparent gradients... well 2 of them actually.. but then other
    transparent stuff all over the place that.. could be pushing things
    a little far. The frame rate's about 14 fps, screen size is only
    about 600x450, I am on an 8 core mac pro with a better then
    standard graphics card... seems to me that I've been able to get
    away with worse on older version of Flash on a G3 power mac bad in
    the day....
    Well when I tried to dynamically load mp3s, that's when
    things started going down hill! now buttons blink, sometimes aren't
    responsive at all.. I'm thinking maybe its that I've over laded the
    player and ought to think pulling back...
    I have on gradient spinning shape thing that I was
    controlling by actionscript using the enter frame thing.. when I
    disabled the code.. well things worked fine again... accept that
    one of my buttons stopped working.. which is mysterious... cause as
    far as I know the code wasn't touching that at all.. so I went back
    to buggy vill, cause at least then my buttons work! (most of the
    time).
    So the only thing I can think to try and do is to try and
    optimize stuff... the projects a bit of a rush job.. so it's "a
    little hack-e" ( well I confess that at my best things are probably
    "a little" hack-e, so this is really bad)
    So I'm thinking of just changing the code over to a timer
    thing, will that make it all groovy? I mean do you think? I seem to
    remember hearing something, somewhere, about the enter frame thing
    as having some issues somewhere...
    What's also kind of strange is that stuff gets strange when
    the mp3s are loaded.. There's only 4 of them, small little
    snippets.. which probably total only about 1MB or so.. so why
    should that make it trouble? Admittedly there's not a lot of
    compression on them, and there stereo but?
    Anyway.. I guess I'm just wondering if any of this sets of
    any red flags for anyone who actually knows what they are doing..
    probably not describing things well enough.. but you know, any help
    is appreciated :)

    same questions, same answers
    I'm new to AS3 too. I know the kind of frustration you face,
    especially when it comes to finding out the how's. So I'm giving
    answers rather than telling people where to look for them (for
    now).

  • Ideas for Adding a Quick Print Button to VA01 Overview Screen

    Problem Statement:
    Our users would like a "quick print" button on the VA01/VA02 application toolbar that immediately spools the Order Confirmation output to the printer.  Our users want to print the output on demand, i.e., they do not want the output to automatically be printed when the order is created because a printout is not always needed.  We already have condition records created with Dispatch Time set to 3 - Send with application own transaction.  However, it takes 7 or more clicks to print the output on demand by navigating the menu (Extras > Output > Edit...Further Data...etc.) and changing the Dispatch Time to 4 - Send immediately when saving.  This is a big ergonomic issue and a time killer.
    Although the number of clicks to print are less when printing the output from the VA02 initial screen (via menu Sales document > Issue Output To), this is not acceptable when creating new orders.  Really need an on-demand, quick print button on the VA01 screen.  As an aside, we have a totally custom transaction for preparing sales order data (shopping cart-like way of finding materials and entering required data) that then calls VA01 and fills in all of the information.  When saving in VA01, the user is returned to our Z-transaction so asking the user to subsequently run VA02 to print is not practical.
    Current Output Determination:
    We have custom output type ZBS0 (copy of BS0).  Condition records for print medium are set to Dispatch Time = 3.
    Questions:
    1.  Searching these forums, it appears custom code (extension or user exit?) can be written to call RSNAST00, or something similar, to automatically send output having a Dispatch Time = 3.  Where can I find more information on exactly how to do this?
    2.  Do transactions VA01 and VA02 (Overview screens) have extensions that allow a print button to be added to the application toolbar?  We would want to call the custom printing code from the button to send the output.
    Any feedback on how others have solved this problem would be greatly appreciated.
    Warm Regards,
    Rob
    P.S.  Using GuiXT is not an option for us.

    HI
    We had similar issues with printing packing list and picking list by the warehouse people.
    We created a new ztransaction with input fields of delivery number, output type, number of copies and a check box for repeat output(in case if the output was already printed).
    You can also create a new Z-transaction with input fields of Sales order number(mandatory field), output type (Default it with value of ZBS0), number of copies (default it with 1) and a check box. On executing the transaction You can provide a message if the output was already printed so that the user can select the check box to repeat the output and execute. You can also print multiple SO by giving a range value if required.
    If you do not want the user to enter the new ztransaction every time, try providing a menu path to the new z-transaction from the existing z-transaction which you are using for order entry.
    Hope this helps you.
    Thanks,
    Arun.S

  • Adding a new toolbar button in IC to Save the transaction

    Hi,
    I want to add a new custom button to my IC Toolbar which would do save. I have gone through some blogs( http://it.toolbox.com/blogs/sap-crm/how-to-add-buttons-to-the-ic-webclient-toolbar-46764 ) and able to get a new button and subscribe an event to that button but the now which APIs to use to save the current transaction. Currently in the standard IC web UI , End button does the save and ends the call but my requirement is to only save.
    Please help on the save. I am on SAP CRM 5.2
    Thanks,
    Saurav.

    Closing this thread as I have raised same Question in other forum which is IC specific.
    Re: Adding new button in IC Toolbar to SAVE current transaction

  • Problems adding  url link to buttons in action Script 3

    each time I added it link 1 to the button on file i get these error messages-  
    1046: Type was not found or was not a compile-time constant: link1.
    1180: Call to a possibly undefined method link1.
    Warning: 3594: exec is not a recognized method of the dynamic class RegExp. var r:Object = p.exec(s);  
    This is the code I am using:   import flash.net.navigateToURL; import flash.net.URLRequest;  var link_one:link1;  link_one = new link1(); stage.addChild(link_one);  link_one.addEventListener(MouseEvent.CLICK, buttonClickHandler);  function buttonClickHandler(event:MouseEvent):void { var url:String = "http://www.masterpiececorp.com/ARMREF.htm"; var request:URLRequest = new URLRequest(url); navigateToURL(request); }    I have no other problems with link 3 or 4, just link 1  I still cannot get my urls link to movie clips on the flash  
    Can you upload flash here? if not I have a image capture I can use to have you look at my buttons  and action script code. i have been to every forum I know and not any have been helpful at all. This is my last hope.
    Very frustrated newbie  Gina T
    Message was edited by: gtaylor0406

    The way you had your code originally would be correct...
    var link_one:link1;
    link_one = new link1();
    addChild(link_one);
    The 1046 error is indicating it doesn't recognize the link1 class.  So the first thing you need to make sure of is that you have assigned the link1 class designation to whatever symbol that is in the library.

  • Adding actionscript to a button?

    For some reason, my actionscript on my button is not working.
    I did a button in Photoshop, imported into the library, dragged it
    onto the stage and what it does is fade in and then stays normal,
    which I have converted into a button. But now when I click that
    button and add actionscript:
    "on (release) {
    getURL("
    http://www.google.com");
    It doesn't work for some reason. =/
    my problem:
    http://mu.thesixthdesign.com/banner_backupExact.html
    Try clicking 'free trial' or demo'; I haven't added any
    actionscript to most of the other buttons yet, since it's not
    working. >_<
    Any help is super appreciated.

    Adriennee wrote:
    > For some reason, my actionscript on my button is not
    working. I did a button in
    > Photoshop, imported into the library, dragged it onto
    the stage and what it
    > does is fade in and then stays normal, which I have
    converted into a button.
    > But now when I click that button and add actionscript:
    >
    > "on (release) {
    > getURL("
    http://www.google.com");
    > }"
    >
    > It doesn't work for some reason. =/
    Action looks a OK.
    Perhaps you apply it after you apply the tween ?
    If you add action after you add the tween, the action only
    appear
    on first or last frame of the tween, not throughout.
    Try to add an action first than apply the tween.
    Other than that... not sure, it all looks ok.
    Perhaps you could upload it somewhere so we can check out the
    source
    file.
    Best Regards
    Urami
    !!!!!!! Merry Christmas !!!!!!!
    Happy New Year
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Adding Script to a Button?

    Is there a way to add JavaScript to a button when creating an Interactive PDF in InDesign (CS6)? This Interactive PDF is being turned over to other developers, who need to tack on a Certificate/Completion process, which is called to from a script that I need to place in the document somewhere.
    Other issues: I know this is probably doable by opening the interactive PDF in Acrobat and adding the script from there - but I have to save the Interactive PDF as a SWF (the developers' process eliminates interactivity from a PDF.)
    Any ideas? Help?

    Perhaps the definition of windows is the issue. Flash swf
    movies are self
    contained in a web browser window web page. So opening an
    external image in
    a MovieClip is simply redrawing the Flash swf.
    If you are thinking of windows within the Flash movie, they
    will have to be
    within the confines of the Flash movie that is first
    launched. You can have
    MovieClips with externally loaded content appear as windows
    and even be
    draggable, but they will not be a separate web browser
    window.
    If you need the web browser to open another window and then
    load another
    Flash movie in it that does the loading, then you need to use
    getURL("
    http://www.domain.com/pagewithotherflashmoviecontainingloadjpg.html/",
    "_blank");
    However it seems it would be less files to simply use html in
    the other
    window page to show the jpg without the Flash movie doing the
    loading unless
    you are using Flash to animate the jpg in some fashion like a
    fade in or
    out.
    Lon Hosford
    www.lonhosford.com
    Flash, Actionscript and Flash Media Server examples:
    http://flashexamples.hosfordusa.com
    May many happy bits flow your way!
    "Chicca81" <[email protected]> wrote in
    message
    news:e92am7$58n$[email protected]..
    >I need some help to understand and find a way to script
    the loading of
    >pictures
    > on different window. I already tryed to use behaviours:
    adding the
    > following
    > script to a button:
    >
    > on (release) {
    >
    > //load Graphic Behavior
    > _root.Contenitore.loadMovie("Cornice 10.jpg");
    > //End Behavior
    >
    > }
    >
    > When I do test the movie though I realised that it
    doesn't work as I
    > expected.
    > The picture "Cornice 10" loads on a what I think to be a
    new window: the
    > Movie
    > Clip "Contenitore" but it doesn't appear to a different
    window. How should
    > I
    > procede then?
    >

  • Adding icon to a button

    Hello
    When I put a JButton on a frame I see in Property Inspector , Visial tab a icon section which it's follow is "<none>"
    how I can use it for adding a icon to the button
    my mean is I want add an icon to button by Property Inspector , but I don't know how I can do it
    can you say to me ?
    thanks

    Hi,
    I don't think the property inspector will help you adding the icon because it needs to be added from the class loader path. In an older JCLient Demo we used the following class
    public class ImageLoader
       public ImageLoader()
       public ImageIcon getImageIcon(String name)
          return new ImageIcon(getClass().getResource(name + ".gif"));
    }This then could be called when setting the icon to a JButton at runtime, passing the icon name to it
    Frank

  • Adding links to multiple buttons.

    I made a flash banner + have photo creds on each photo. I want to make it a link to source to the photographer's portfolio.
    I've got 5 links for 5 buttons, button1, button2, button3, etc, each is named in the library with a matching name for the instance.
    I got the link working for the first image, but whenever I try and do it for others I keep getting a message of
    "TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at flashBanner_tryingnewcode_fla::MainTimeline/frame1()"
    Here is my current code, any ideas?:
    button1.addEventListener(MouseEvent.CLICK, buttonClickHandler);
      function buttonClickHandler(event:MouseEvent) :void {
      navigateToURL(new URLRequest("http://www.flickr.com/people/chrisschoenbohm/"));
      trace("I'm clicked");
      button2.addEventListener(MouseEvent.CLICK, buttonClickHandler2);
    function buttonClickHandler2(event:MouseEvent) :void {
    navigateToURL(new URLRequest("http://www.flickr.com/people/10566958@N02/"));
    trace("I'm clicked 2");

    The 1009 error indicates that one of the objects being targeted by your code is out of scope.  This could mean that the object....
    - is not in the display list
    - doesn't have an instance name (or the instance name is mispelled)
    - does not exist in the frame where that code is trying to talk to it
    - is animated into place but is not assigned instance names in every keyframe for it
    - is one of two or more consecutive keyframes of the same objects with no name assigned in the preceding frame(s).
    If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number following the frame number which will help you isolate which object is involved.
    And just in case it matters since you mentioned it, library names have no meaning other than that... they are not related to code in any way, they just help you know what's in the library, if anything.

Maybe you are looking for

  • Iphoto upgrade examines my photo library and says its damaged or unreadable and cannot be opened.

    For some reason, iphoto automatically goes to an upgrade window upon launch. I believe I still have iPhoto 09 but since it won't launch i can't check that out. But it was created on 3/13/09 and last modified on 9/20/10...so I'm sure it's still the 09

  • Problem with slis_t_specialcol_alv Field Symbol Assignment

    I have created a dynamic internal table (runtime determined number of columns) to contain data to be displayed in an ALV. I’ve also made ensured that the last column of the dynamic itab is of type <b>'slis_t_specialcol_alv'</b> and named <b>‘CINFO’</

  • Twistie Functionality Missing from RoboHelp 8

    Hello, My technical writing team and I were recently upgraded to RoboHelp 8. It is our understanding that you can add a Twistie in a help file. I've been researching for the past few hours and can't seem to find accurate instructions, nor can I find

  • How to create entity reference in DOCTYPE

    Hi, I am having trouble creating entity nodes in the doctype line Something like this <!DOCTYPE model SYSTEM "/my/local/copy/of/the/cellml_1_0.dtd" [ <!ENTITY % mathml_dtd_path "'relative/path/to/mathml2.dtd'"> <!ENTITY % use_mathml_dtd "INCLUDE"> ]>

  • Currency units not displayed

    Hi all, I have query, in rows i have g/l account  and in columns i have actuals total in group currency and actuals total in local currency of spain, local currency of france local currency australia etc. The thing is when i execute the query it show