Replace Buttons with Images.

Folks,
I have buttons in my application which perform a certain functions
by clicking on them.
I want to replace the buttons by gif/jpg images,so that when the
user clicks on them,it does the same set of functionality as discussed
above.
HOW CAN I REPLACE THE BUTTONS with Gif and implement the actionListener??

Hello,
there are several methods to set the icon for the button like setIcon and setRolloverIcon etc. You better setContentAreaFilled(false) if you want an icon-only button. Have a look at [url http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/AbstractButton.html]AbstractButton for further information.
Regards,
Tim

Similar Messages

  • Replace words with images, in a table, using the search/replace tool

    Hello everybody
    I have a question:
    Is it possible to replace words with images, in a table, using the search/replace tool?
    My case:
    I have a table with about 9000 articles on about 400 pages. In this table there are words which I like to replace with Logos.
    Example: The word "DM" should be the Logo "DM" (.eps). This word is about 1200 times in this table.
    Is it possible to replace it automatically?
    Thank you very much for your helb.
    Kind regards Alex

    Hello Mr. Werner
    Thank you for your reply.
    Can I ask you which Version of InDesign do you use?
    I use CS 5.5 and there I can't find the change field "other" you told me.
    Can you see it on the screenshot? (Sorry it is german...)
    Thank you very much for your support.
    Kind regards Alex

  • Use Powershell to replace text with image in Word document

    I have a powershell script that uses a Word document as a template to create signatures that I am pushing out to my organization.
    The document is populated with text formatted the way I want the signature to look, that I then do a FindText and ReplaceText on.  This works fine for replacing text with text, but I can't figure out how to properly replace some of the holder text with
    an image and a link.  I found a few posts about adding images to word documents, but none that seem to work properly in this scenario.
    Any insight would be greatly appreciated, thanks!

    Dear BOFH,
    You are correct that method I outlined is not for inserting an image into a signature block (which would be in Outlook, not Word).  The links you post do certainly deal with outlook signatures, well done... Except that the question was about how to
    use a Powershell script to replace text in a Word document with an image.  Sure it was framed in the context of creating signatures, but the poster expressed that they already had a method of generating and replacing text, and just needed to know, as
    I did, how to do the thing they actually asked.
    Please BOFH... Please forgive my audacity in hoping to find a reference (any reference) to how to replace Word text with images via Powershell in a thread titled "Use Powershell to replace text with image in Word document".
    This is certainly a scripting question, and even something as simple as "You will need to call the .NET methods for the Word find/replace functionality.  Please ask in the Word forums for the correct method to use. 
    If you need help on calling .NET methods look HTTP ://here"support you offered combined with the contempt you offer in response to my actual substantive help to the actual question asked.
    BOFH, you are not better than us, just more arrogant.
    Can you please start your own question as this one has been closed.  Please see scripting guidelines.
    We cannot guarantee you satisfaction as this is a user supported forum.  The is no SLA for community support.  Perhaps if you posted a better worded question as a new topic someone might be able to help you resolve your issue.
    The topic you are posting on is closed and answered.
    ¯\_(ツ)_/¯

  • Printing Buttons with Images

    In my application, I am attempting to print a document that has both buttons with text and buttons with images, along with plain text.
    When I print, the buttons with the images are larger than they ought to be (i.e. they don't fit within the area they were suppose to be drawn within (btw, for this application, I am using absolute positioning)).
    However, this does NOT occur with the buttons that have only text and no image.
    Can anybody tell me why this might be? It seems that to printing a JButton comes from the functionallity of JComponent.print, which simply sets a few printing flags and calls JComponent.paint.
    So whatever changes those flags make, I would think they ought to effect all buttons the same?
    Has anybody else run into this problem, and possibly found a solution for it?

    myJButton.setSize(new java.awt.Dimension(<width>,<height>));
    that line should do it. keep in mind that that will not resize your image. since you are using absolute positioning I will assume your button is of constant size. you should manually resize your images to be of the proper size for your buttons.

  • Radio Buttons with images

    Hello everyone,
    JDeveloper 11.1.1.7.0
    Is it possible to have radio buttons with images instead of plain text?
    If not, are you interested in having this kind of feature? I am ;-)
    Thx.
    Filip Huysmans

    Hi Flip,
    The user when switching between modes will fire an event to the server. This even needs to be caught in a bean and set a variable's value to either true or false.
    Now you can treat "TRUE" to be in view and "FALSE" to be in edit mode.
    Depending on this images can be changed.
    Ex: your bean will be like
    class catchMode{
    private boolean mode;
    public void changeMode(ActionEvent ae)
    boolean modVal=this.getMode();
    if(modVal) //if mode is true; i.e. view mode
         this.setMode(false);
    else if(!modVal) //in EDIT mode
    this.setMode(true);
    //Generate accessors for mode
    in JSPX:
    <af:image source="#{catchMod.mode eq true ? 'view.png' : 'edit.png'}"
    Also the partialSubmit for the command component will be set to true
    Thanks,
    Pandu

  • PSD Rollover Button with image in front stops button from changing state

    I have a wide PSD button that changes state when rolled over. I would like to place a PNG image with transparency in some areas over the top of it so that the rollover button shows through the transparent areas of the PNG.
    How can you get it to do the rollover effect when the user mouses over the bit of the button that the image is in front of? Is ther a way of making the PNG 'invisible' to the mouse?
    I know I could redesign the button so that it includes the image but I'm trying to keep file sizes and load times to a minimum, I use this button a lot on my website with a different on each, and having that number of individual buttons would result in a bloated, slow-loading website.

    Hi Abhishek
    Thanks for your reply. I was able to achieve the effect I wanted by having the PNG and the PSD Button with the same link and then grouping them. This means I can mouse over the PNG and still get the PSD rollover effect, which is perfect.
    However I also have another similar problem. I have some different PSD Rollover Buttons which have some text in front of them (basically it's the button label). On some of these buttons when you roll over the text it prevents the rollover state of the button, and on other buttons the rollover effect occurs as it should, and there doesn't appear to be any consistency about which does what. Grouping or ungrouping doesn't appear to make a difference. Can you help?

  • Replacing bullets with images

    Are there plans to add the option of replacing the bullets in a bulleted list with images, as you can do in Word? Our current workaround is to insert the image as a background image through the CSS with appropriate spacing, but this isn't very accurate.

    Hello Michael,
    Since the rendering of bullets is up to the browser, we don't have much control over that other than what the browser can provide. According to CSS, I believe the correct style to use would be "list-style-image," but it is not well-supported, and the ICE browser in OHJ does not currently support it.
    I am not sure what MS Word does, but when you save a Word file as HTML, it does all sorts of strange things to the HTML. For example, a quick test showed that saving a list (with custom bullets) as HTML created a series of P elements with things like <span style='font-family:Symbol'>^<span
    style='font:7.0pt "Times New Roman"'>       </span></span>
    You could do things like that, too, but it isn't good HTML.
    -Ben
    Oracle Help team

  • Replace tags with images

    Hi
    <br />I'm tryng to build a vb script that replace text tag with images.
    <br />Tags are like <%img=c:\logo.jpg%>. I need to replace the tag with the image c:\logo.jpg.
    <br />I try this (It didn't work). Can somebody help me?
    <br />thanks
    <br />
    <br />On Error Resume Next
    <br />
    <br />Set myInDesign = CreateObject("InDesign.Application.CS3")
    <br />Set myDocument = myInDesign.ActiveDocument
    <br />
    <br />Set myTextFrames = myDocument.TextFrames
    <br />'Get the total number of textframes
    <br />myTextFrameTotal = myTextFrames.Count
    <br />
    <br />REM : replace tag <%img=c:\logo.jpg%> image with image c:\logo.jpg
    <br />'Setup a loop through all textframes
    <br />For myloop = 1 To myTextFrameTotal
    <br />
    <br /> Set myTextFrame = myTextFrames.Item(myloop)
    <br />
    <br /> myCharacterCount = myTextFrame.Characters.Count
    <br /> If myCharacterCount &gt; 0 Then
    <br />
    <br /> id1= InStr(1, myTextFrame.Texts.Item(1).Contents, "<%img="  ,1)<br />        If  id1 >0  Then        <br />             id2= InStr(1,  myTextFrame.Texts.Item(1).Contents, "%>" ,1)
    <br /> If id1 &gt;0 Then
    <br />
    <br /> REM: image filename
    <br /> myFile = trim(Mid(myTextFrame.Texts.Item(1).Contents, id1+6, id2-id1-6) )
    <br /> REM: set tag to ""
    <br /> myTextFrame.Texts.ItemByRange(id1, id2).Item(1).Contents = ""
    <br />
    <br /> REM myTextFrame.Fit idFitOptions.idProportionally
    <br /> REM myTextFrame.Fit idFitOptions.idContentToFrame
    <br /> REM: insert image file
    <br /> myTextFrame.InsertionPoints.Item(1).Place (myFile)
    <br />
    <br /> end if
    <br /> end if
    <br /> end if
    <br />
    <br />Next 'Process the next text frame in text frames
    <br />
    <br />if Err.Number&gt;0 then MsgBox Err.Description + ", " &amp; Err.Source
    <br />
    <br />REM myPub.SaveAs ("")
    <br />REM myPub.Close
    <br />REM myInDesign.Quit
    <br />REM Set myDocument = Nothing
    <br />REM Set myInDesign = Nothing

    Hi Robert
    <br />Thanks for your help.
    <br />
    <br />I get this message error:
    <br />"Topic not optional. Vbscript error run time."
    <br />
    <br />The problem seems to be with instruction:
    <br /> myTextFrame.Texts.ItemByRange(id1, id2).Item(1).Contents = ""
    <br />and
    <br /> myTextFrame.InsertionPoints.Item(1).Place (myFile)
    <br />
    <br />Image is inserted but NON in the tag position and tag postion is not emptied.
    <br />
    <br />I do not understand if "id1, id2" for ItemByRange function are simple integer or must be a kinf of object.
    <br />
    <br />On Error Resume Next
    <br />
    <br />Set myInDesign = CreateObject("InDesign.Application.CS3")
    <br />Set myDocument = myInDesign.ActiveDocument
    <br />
    <br />Set myTextFrames = myDocument.TextFrames
    <br />'Get the total number of textframes
    <br />myTextFrameTotal = myTextFrames.Count
    <br />
    <br />msgbox myTextFrameTotal
    <br />
    <br />REM : replace tag <%img=c:\logo.jpg%> image with image c:\logo.jpg
    <br />'Setup a loop through all textframes
    <br />For myloop = 1 To myTextFrameTotal
    <br />
    <br /> Set myTextFrame = myTextFrames.Item(myloop)
    <br />
    <br /> myCharacterCount = myTextFrame.Characters.Count
    <br /> If myCharacterCount &gt; 0 Then
    <br />
    <br /> id1= InStr(1, myTextFrame.Texts.Item(1).Contents, "<%img="  ,1)<br />    If  id1 >0  Then        <br />       id2= InStr(1,  myTextFrame.Texts.Item(1).Contents, "%>" ,1)
    <br /> If id2 &gt;0 Then
    <br />
    <br /> REM: image filename
    <br /> myFile = trim(Mid(myTextFrame.Texts.Item(1).Contents, id1+6, id2-id1-6) )
    <br />
    <br /> msgbox myFile
    <br />
    <br /> REM: set tag to ""
    <br /> myTextFrame.Texts.ItemByRange(id1, id2).Item(1).Contents = ""
    <br />
    <br /> REM myTextFrame.Fit idFitOptions.idProportionally
    <br /> REM myTextFrame.Fit idFitOptions.idContentToFrame
    <br /> myTextFrame.InsertionPoints.Item(1).Place (myFile)
    <br />
    <br /> end if
    <br /> end if
    <br /> end if
    <br />
    <br /> if Err.Number&gt;0 then MsgBox Err.Description + ", " &amp; Err.Source
    <br />
    <br />Next 'Process the next text frame in text frames
    <br />
    <br />REM myPub.SaveAs ("")
    <br />REM myPub.Close
    <br />REM myInDesign.Quit
    <br />REM Set myDocument = Nothing
    <br />REM Set myInDesign = Nothing

  • Button with image in JSP

    In JSP, how could we create a button with an image on it.
    Normally in JSP we use something like :
    <input type="submit" name="ButtonName" value="Submit"> to create a button
    and we use < request.getParameter("ButtonName")> to invoke it.
    How can we create a button with an image? and how to invoke the button. Thanks.

    Not too sure how you are invoking with the request.getParameter() (I'm still fairly new to JSP), but you can certainly create a submit button with an image by using:
    <input type="image" src="buttonimage.gif" height="100" width="100" name="ButtonName" value="Submit" />(Where or course src, width and height are dependant on your image.)
    Hope that helps.

  • Replacing footage with image sequence

    Hi,
       I was wondering if anyone knew how to replace footage with an image sequence. It seems like when I choose replace footage and navigate to my image sequence there is nothing I am able to check off for image sequence. So basically if I have an image sequence in my timeline, I can only replace it with a movie which defeats the purpose of using an image sequence. Thanks in advance!

    You need to have a single directory filled with one or more supported still images which are named with a number a the end for the 'Image Sequence' checkbox to be un-grayed out in the 'Import', 'Replace Footage' or 'Locate Files' dialog. From the screenshot above, it looks like you've met all those criteria and that the checkbox is not even there, as opposed to being present but dim. On windows 8 (which it looks like you're on) that checkbox would be in between the 'File Name' label and the bottom of the file list area. The fact that you're not there makes me think your on an older version before we had all the relevant features. I'd have to check to remember just when that would have been, but I know that as of CS6 the 'Image Sequence' dialog was definitely there for the Locate Files and Import dialogs, so it's reasonable that it was an option in the replace footage dialog too. It may be something system specific which is not allowing all the UI to draw in correctly when using OS dialogs. In that case, Kevin's suggestion might still be viable since the Link & Locate workflow uses its own Premiere UI instead of OS dialogs.

  • Search .docx and replace text with image

    I've got a directory containing a series of images. The images will always be the same name and I need to insert them into placeholders in a Word document which will be a template. I thought of using the image names as placeholders, opening the document
    and searching for the image name, replacing it by inserting the image, and doing so for each image in the directory.
    $file is the name of the image in the directory and it loops through them okay.
    foreach($file in Get-ChildItem $savepath -Filter *.jpg)
            # search word doc and replace selected text with image ($file)    
    Also inserting the image seems simple enough from a TechNet article I found, but I've got no idea how to open the Word document and do a search and replace. I found a few articles related to the subject but I couldn't get them to work when I tried to adapt
    them.
    Any help is appreciated. Thanks in advance.

    This 'might' be possible, but I'm having a hard time finding good references to the com object capabilities for inserting an image into a word document.  Creating new, converting format, that sort of thing is straightforward.
    I'd do a search on "powershell word comobject" and variations of insert image update edit, etc.  Or maybe someone else with more experience/knowledge has a magic bullet for you.  Once you get some info on doing it with powershell, expand
    your search by omitting the powershell keyword, there's gotta be some solid documentation for the comobject somwhere, but it will probably be a bit complex.
    You can also:
    $word = new-object -comobject word.application
    $doc = $word.documents.add("<path to word document>"
    and get-member to your heart's content, but finding references and/or documentation might be easier.  
    Good luck!
    Edit:  This could help, but really doesn't give much insight into placement of the image, only helps getting the image into the doc:  http://gallery.technet.microsoft.com/office/44ffc6c8-131f-42f1-b24b-ff92230b2e0a
    If you do find something useful, post it here, I'm sure others could benefit!
    SubEdit:  Should have thought of this already...
    http://msdn.microsoft.com/en-us/library/ff837519(v=office.14).aspx

  • Replace text with images

    Hi,
    I'm using a script found here, to replace @equ001.pdf@ with the corresponding image, same for eq002 etc.
    This script works more or less ok for me.
    Sometimes, it removes some image names without replacing the image, sometimes it was leaving some "@" here and there.
    Sometimes, it's giving me an error on the "place image" code, saying it cannot find the image, giving it's path ending with the grep expression $2 and doesn't work at all.
    Sometimes it does part of the job, stops, gives the same error as above, and continues to work when I click ok.
    Today, it didn't worked on a document. I copied the text to work on into a new InDesign document an there, it worked (but in two times).
    Is there any other way of doing this ?
    if(app.documents.length != 0){
        var myFolder = Folder.selectDialog ('Choose a folder with images');
        if(myFolder != null){
            // reset the Find/Change dialog
            app.findGrepPreferences = app.changeGrepPreferences = null;
            // formulate a grep search string
            app.findGrepPreferences.findWhat = '@.+?@';
            // find all occurrence, last one first
            f = app.activeDocument.findGrep (true);
            for (i = 0; i < f.length; i++){
                // construct file name
                name = f[i].contents.replace (/@/g, '');
                // place the image
                var placedObjects = f[i].insertionPoints[0].place (File (myFolder.fsName + '/' + name));
        // delete all @??@ codes
        app.activeDocument.changeGrep();
    else{
       alert('Please open a document and try again.');

    You should process the found instances back to front:
    for (i = f.length-1; i >= 0; i--)
    Peter

  • Buttons with images in web!!! Please help-me!!!!

    I want to publish mine forms 6i in web. They have buttons with figures. I already converted the figures of .ICO for .GIF. I already read diverse papers on the subject but I did not understand them. What I must make now?
    I need step-by-step that to make now, therefore I have stated period to carry through this task and is if depleting. Who to know, please says which archives to me must edit, where to place the figures, etc.
    Thanks!!!!!

    Joao,
    There is Registry.dat file in which there are two items:
    default.icons.iconpath=
    default.icons.iconextension=
    My Registry.dat contains this:
    default.icons.iconpath=/nis-img/
    default.icons.iconextension=gif
    The url /nis-img/ is defined in httpd.conf (I use Apache).
    kind regards,
    Ivan
    I want to publish mine forms 6i in web. They have buttons with figures. I already converted the figures of .ICO for .GIF. I already read diverse papers on the subject but I did not understand them. What I must make now?
    I need step-by-step that to make now, therefore I have stated period to carry through this task and is if depleting. Who to know, please says which archives to me must edit, where to place the figures, etc.
    Thanks!!!!!

  • Flash button with images

    hi,
    I want to create a flash button,& for the button
    different images should load for press & release events. also I
    want to reuse this button. Please can someone tell me how to do
    that

    you'll need to use server-side scripting to handle part of the file upload and the file name retrieval from the upload folder.  assigning the uploaded files names you'll do from flash.  you'll use another script to retrieve the file names and in flash load and display which ever subset you want.

  • Problems: button with image

    hallo,
    i have the following problem:
    I've written this class:
    import java.awt.*;
    public class ImageButton
    extends Button
         private Image img;
         public ImageButton(String fname)
         img = getToolkit().getImage(getClass().getResource(fname));
              MediaTracker mt = new MediaTracker(this);
              mt.addImage(img, 0);
         try {
              //Warten, bis das Image vollst�ndig geladen ist,
              //damit getWidth() und getHeight() funktionieren
              mt.waitForAll();
              } catch (InterruptedException e) {
              //nothing
         public void paint(Graphics g)
              int a=(this.getWidth()-getPreferredSize().width)/2;
              int b=(this.getHeight()-getPreferredSize().height)/2;
              g.drawImage(img,a,b,this);
              super.paint(g);
         public void update(Graphics g)
              paint(g);
         public Dimension getPreferredSize()
              return new Dimension(
              img.getWidth(this),
              img.getHeight(this)
         public Dimension getMinimumSize()
              return new Dimension(
              img.getWidth(this),
              img.getHeight(this)
    when the frame appears, where the button is shown, the icon is shown. But when I click on the button, the icon is away and i don't know, where is the problem.
    I don't use swing because i don't like the perfomance.
    why is the image away, when i'm clicking on the button or another frame is over the button and disappears.

    just do not call super.paint(g) in paint() implementation

Maybe you are looking for

  • IPhone 5s not working after voice over turned on

    iPhone 5s not working after voice over turned on

  • Payment issue and subscription has expired

    I had some trouble with my rechargeable credit card on this month, there were not enough money to pay the monthly fee and now when I start my software I get a message saying that my subscription has expired and there are 23 days remaining. Now everit

  • Why am I not able to buy music available in the US?

    Tried to download music from Music Group WAR, available in the US but not in Ireland. Would set up an account in the US but got bumped after revealing the Irish address. What can be done to receive any music available on itunes? Thanks and Regards, A

  • Help in performance

    Hi All, i want to know if from performace side ,if it's good to select data and see if it's need to be update,or update any way. e.g. i get data on user and my quesion is if to do select single and see if the user is exist and if the user exist see i

  • S_ALR_87012994 - Orders: Current Period/Cumulativec-Int Orders

    Hi, I am looking to understand the report S_ALR_87012994 - Orders: Current Period/Cumulative, Can someone tell me what the following fields mean in the report Act.to prv,     Act. ***.,      Ttl actual Thanks, Ram Message was edited by:         Ram R