Making an image as a button

How may i make an image as a button actually i mean can i set an image for a button?
is something like that possible with java like in c# button.image("imagespath")
Thanks

ok i made it like this but this time hole applet become a button(clickable) and still my image doesnt show
package applet;
import javax.swing.*;
import javax.swing.event.*;
import java.io.*;
public class backgammon extends JApplet {
private ImageIcon pulicon;
public JButton b1;
    public backgammon()
    public void init()
        this.setSize(744, 536);
        pulicon = new ImageIcon("pul_sari.gif");
        b1 = new JButton(pulicon);
        getContentPane().add(b1);
        b1.setBounds(50,50,100,24);
}

Similar Messages

  • "input/output error' when making disc image from DVD

    I've had problems installing Logic, and a Pro Apps Genius at Applecare suggested I try making an image of the problematic DVD (Audio Content 1) and then trying an install that way.
    While I can make an image of the Install disc to my desktop fine, the Audio Content 1 disc reports an "input/output error".
    This means I'm unable to copy the disc and then successfully install my Logic Studio.
    Any ideas?

    Thanks for your answer.
    Yes, I thought that might be the case - but I'd taken my Mac and Logic disks to a Genius bar, and the 'Genius' had said he'd fixed the issue. I just wish he'd explained what he did and why he didn't replace the faulty disk(s)!
    But is there any way around having the claim a disk, now I'm living abroad and my 'warrantee' has run out? It's going to be a pain in the fundament trying to claim a replacement set.

  • Can't get rid of background image of toolbar buttons

    I am just a front-end developer and responsible for the front-end look of an ADF application that we are creating: We are using jDeveloper 11.1.1.4.0 (and we cannot upgrade due to being told no...so I cannot USE the skin editor which when I tried to use, migrates the files).
    I have created the necessary directories and files per tutorials I have been reading up on...
    skins directory - (new directory)
    skin.css (new file)
    Web-Inf -
    trinidad-skins.xml (new file and correctly configured)
    trinidad-config.xml (existing file but updated to use the new skin)
    Within the trinidad-skins.xml file I have the the new skin specified and is extending the "fusionFx-v1.desktop" default theme being used.
    Now the problem... I cannot get the background images to be overwritten or disabled for af|toolbar::item within the .css file
    I have looked up information about how to overwrite this and I tried to use the
    -tr-inhibit: background-image; within the .css declaration like this
    <code>
    af|toolbar::item {
    -tr-inhibit: background-image;
    </code>
    That was unsuccessful. I even just tried standard background {none;} and that was a no go as wel.
    What am I doing wrong here? This is driving me nuts... they made this skinning stuff way too complicated IMO. I don't see why I can't just add a class to the component within the property inspector of that component and then be able to reference it via normal css conventions... but nope BREAKS grrr... And I'm advanced level CSS coder! This stuff has me absolutely clueless and ready to just quit!
    Any suggestions or help is appreciated! And again... I cannot use the skin editor! Everytime I tried to, it prompted me to migrate the application and I cannot do this since there are about 5 other developers working on this application (we use clearcase for version control).
    Thanks,
    Michael

    I can't use the stand alone skin editor since it will want me to migrate the project files (developed in 11.1.1.4) and all files are source controlled via ClearCase.
    I have been experimenting...This is the code on the .jspx page
    <code>
    <af:panelGroupLayout id="header" styleClass="headerParent">
    <af:panelGroupLayout id="topLinkBar" layout="horizontal" styleClass="topLinkBar AFStretchWidth">
    <af:outputLabel value="#{customeradminportalviewcontrollerBundle.CUSTOMER_ACCOUNT}" styleClass="customerLabel"/>
    <af:outputText value="outputText2012" styleClass="customerOutput"/>
    <af:toolbox id="topLinkToolBox" styleClass="topLinkToolBox">
    <af:toolbar id="topLinkToolBar" styleClass="topLinkToolBar">
    <af:commandToolbarButton text="#{customeradminportalviewcontrollerBundle.HELP}" id="ctb2"/>
    <af:commandToolbarButton text="#{customeradminportalviewcontrollerBundle.POWER_INVOICE}" id="ctb1"/>
    <af:commandToolbarButton text="#{customeradminportalviewcontrollerBundle.CONTRACT}" id="ctb3"/>
    <af:commandToolbarButton text="#{customeradminportalviewcontrollerBundle.SIGNOUT}" id="ctb4"/>
    </af:toolbar>
    </af:toolbox>
    </af:panelGroupLayout>
    </af:panelGroupLayout>
    </code>
    Here is the CSS code
    <code>
    #topLinkToolBar af|commandToolbarButton {
    background-image: none;
    background-color: transparent;
    border: 0;
    </code>
    That WILL NOT get rid of the background images on the buttons! However if I do the !important hack within the CSS like this:
    <code>
    #topLinkToolBar af|commandToolbarButton {
    background-image: none!important;
    background-color: transparent!important;
    border: 0!important;
    </code>
    Then BOOM it works... I do NOT want to use the !important hack since that will cause problems in CSS inheritance and cascading...
    What am I doing wrong?
    Also how do I (if possible) target a specific ID used? For example the af:toolbar has an ID of "topLinkToolBar" how can I target that within the CSS? I know I can target it via class attribute like this:
    <code>
    af:toolbar.topLinkToolBar
    </code>
    but how would I do the same if I wanted to only apply to a component with a particular ID?
    Thank you everyone for all your patience, suggestions and help with this... I'm totally new to this type of environment and it's been a slow and frustrating learning experience!
    Michael

  • How to link an image to a button in Flash Builder 4

    I am new to Flash Builder 4 and have trouble to link an image to a button in Flash Builder 4.
    For example, I want an image of a round green button to replace the default retangle button in Flash Builder 4.
    Can anyone help me up?
    Thanks

    You could also use the mx:Image control and just add a click event handler:
    function(){return A.apply(null,[this].concat($A(arguments)))}
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/mx"
            width="500" height="400">
        <fx:Script>
            <![CDATA[
                import mx.controls.Alert;
                protected function image1_clickHandler(evt:MouseEvent):void {
                    Alert.show("You clicked the image");
            ]]>
        </fx:Script>
        <mx:Image source="http://helpexamples.com/flash/images/image1.jpg"
                click="image1_clickHandler(event);" />
    </s:Application>

  • Photoshop crashes when I try and save for web and devices. Making the image size smaller does not help.

    I'm trying to make a lopping .gif from an animation that I made. It's 147 total frames. It's crashed about 6 times now every time I either try and Save for Web or even just save the document on my desktop so in case it crashes I can reopen PS and recover it. Making the image size smaller (original size is 1920 x 1080 with resolution 72) does not help, it still makes the *ding* error when I attempt to save. I made the image more than half of the original size and the Save for Web box actually came up that time, but when I tried clicking save it said there was an error and PS crashed without warning.

    Look at the crash report for your Photoshop crashes see what they show

  • Anchored images outside of button frame

    Hi Experts
    I am trying to find a way of getting an image to become visible on rollover on a button I've created, without having the image positioned within the button frame. The images are large & I have several small buttons on the page, each linked to text frames with anchored text objects (the images.) Anchoring the images outside the text frame is no problem, but visibility is limited to the button frame.How do I link large images to small buttons that only activate on rollover? Any ideas? PLEASE help!

    Convert that image you want to appear to separate button, and attach show/hide buttons action to your real button. Use rollover as trigger for showing your image, and rollout for hiding it again....

  • t:inputcalendar i want an image instead of button?

    Hi
    i am using tomhawak inputdate and inputcalendar in my appliation. i want to use an image insated of button.
    Please some one let me know how can we do that
    thansk in advnace
    sreedevi.

    Hi,
    i have tried the following tag image is displaying on the button.
    <t:inputCalendar id="dtTo" value="#{selectPlan.timeFrame.endingDate}" renderAsPopup="true" size="14" popupDateFormat="yyyy Week w" readonly="true" required="true" onclick="validateTimeFrameDate()" renderPopupButtonAsImage="true" popupButtonImageUrl="images/calendar.gif" />
    Thanks,
    N.Kishore

  • Is there a way to add images , text and button in the individual marquee of a carousel

    Is there a way to add images , text and button in the individual marquee of a carousel ?

    Write a custom carousel.  Usually carousel components are just ULs that use something like jQuery to rotate through the LIs.  The foundation carousel component is really just designed for some specific use cases.  Generally I would just recommend rolling your own.

  • "Authentication error", making disk image

    I'm trying to make a disk image of my OS X boot disk, as an emergency backup. I'm booting from the Installation CD that came with my Mac Pro, and using Disk Utility. I select my boot drive, click New Image, and tell it to save to an external firewire drive, compressed and encrypted. It starts and quickly errors out, with "Authentication error." What does this mean?
    I've used 250 GB of the 500 GB on my boot drive, and my external drive is 120 GB. I'd rather tell it to skip some files to save space, but it doesn't give me the option to do that. Will "compress" get it to be small enough? Is this why I'm getting an error? I've repaired permissions before booting from the CD.

    I don't know about the authentication error; however, to make a disk image of 250 GB source drive to a 120 GB target is an exercise in futility. There's not enough room. 250 GB? What are storing? A complete music store, the movies of Hollywood, or the pictures in an art gallery?
    If you want an emergency backup of your 500 GB HD, then you'll need an external at least as big. BTW, making disk images for this purpose is fraught with danger since you can't ensure that it's good until you restore it to a bootable HD. I strongly recommend something like Carbon Copy Cloner, SuperDuper!, etc. instead. BTW, you can just drag & drop any data files from one HD to another. There's no need to put them in a disk image and certainly no need to encrypt things. If you decide to go the bootable backup route, move the data files to root-level and don't back those up. That should make your emergency backup a lot smaller.

  • After importing an image from cs5 back into lightroom, lightroom is making the image darker

    Lightroom is making my images darker after i edit them in photoshop cs5 and I dont know why. When i open the image back into photoshop it looks fine. Even when i save it as a jpeg lightroom is making the image darker. When i imported the raw image into lightroom before i edited into photoshop it looked fine. Is there a way to fix lightroom?

    See screen shot:
    Click on the two small triangles and under <Lightroom General Presets> select <Zeroed>. Sorry, it seems that the option <None> is not available anymore in Lr 4.3. But <Zeroed> has the same effect.
    Alternatively, in the Develop Module, bottom right, just above the film strip click on <Reset>.  See screen shot:

  • Change Image of a Button

    Hey,
    I'm searching for the command for changing the image of a button, after that is clicked. (iPhone OS)
    I added an outlet to my app:
    IBOutlet UIButton *myOutlet1;
    But I don't know how to change the picture after the click!
    Can someone please give me the code to do that?
    I'm new to iPhone development.
    THANK YOU VERY MUCH!!!

    Here is an example of how you might set up a button to handle all four states. This assumes that the images are in your bundle (in Xcode, you have added them to the project in the "Resources" section).
    [myOutlet1 setImage:[UIImage imageNamed:@"DOA_NORMAL.jpg"] forState:UIControlStateNormal];
    [myOutlet1 setImage:[UIImage imageNamed:@"DOA_HIGHLIGHTED.jpg"] forState:UIControlStateHighlighted];
    [myOutlet1 setImage:[UIImage imageNamed:@"DOA_DISABLED.jpg"] forState:UIControlStateDisabled];
    [myOutlet1 setImage:[UIImage imageNamed:@"DOA_SELECTED.jpg"] forState:UIControlStateSelected];

  • How to change an image only when button is pressed

    is there an easy way to make the image in a uiimageview change to a different image while a button is being pressed? then, once the user stops pressing the button, the image view needs to return to the first image.
    thanks in advance!

    Hey , U can handle that with Touches ,
    But in a simply way
    Use Touchupinside to show the pressed image ,
    and use Touchupouside to show the normal image.
    This may give you the same  impression.
    Thanks
    Srikanth

  • Is possible to add a image in  a button?

    I know it can assign a icon for <mx:Button ...>
    my button is created programly:
    var but:Button = new Button();
    but.width=20;
    but.addEventListener("click",indent);
    myRTE.toolbar.addChild(but);
    I want to assign a image on this button. Who has idea how to
    do it?

    try this:
    [code]
    <mx:Button styleName="myButton" label=""/>
    <mx:Style>
    .myButton
    upSkin: Embed(source="../forum.gif");
    overSkin: Embed(source="../forum.gif");
    downSkin: Embed(source="../forum.gif");
    disabledSkin: Embed(source="../forum.gif");
    [/code]

  • Actions menu wheel image and Go button image

    Hello ,
    In APEX 4 Interactive Reports, the actions menu wheel image and the go button are coming as html buttons instead of the wheel image and go button image.
    Is there a way I can rever to the old wheel img and go button .
    Thanks,
    Dippy

    Within the IR, under Search Bar, you can set Actions Menu Image to '/i/ws/action_32x24.gif' - this is the green wheel but does not have little arrow. I will contact our image guru and see if the old one is sitting somewhere. As for 'Go', this does not support an image but you can change the word if you need to (using Search Button Label) and set a button template to match your application.
    -- Sharon

  • Can i put images on a button

    Hi i have some omages which i need to put on a button can i do that in java. I cannot use swings cause i am using java 1.1.7. can i do something using awt.
    Is there ImageButton in jdk 1.1.7 ???
    Please help me in this.
    Please post a sample code if any one can
    Thanks
    Ram

    Hi This is my actual program.
    I have some images posted and some buttons. But can i click on the images to open new files or can i put an image on a button. I donno how to use mouse click. or how do i map an image.
    Can i also mouse click on a text string???
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.event.MouseEvent;
    import java.applet.*;
    import java.io.*;
    import java.lang.String;
    public class chemviz extends Frame implements ActionListener
         private Button offwaltz, nanocad;
         private Panel PagePanel, buttonPanel;
         private Image logo;
         private Image nanocadhome, waltzhome;
         //private TextArea TextArea1;
         private String About = "About";
         private String test= "This is a Test";
         //test.setFont(new Font("Arial",Font.BOLD,12));
         public String line1 = "ChemViz (Chemistry Visualization) is an interactive chemistry program which incorporates computational chemistry simulations ";
         public String line2 = "and visualizations for use in the high school chemistry classroom. The chemistry simulations support the chemistry principles ";
         public String line3 = "teachers are trying to convey, and the visualizations allow students to see how matter interacts at an atomic level.";
         public void loadPanel()
              //ImageIcon offwaltz = new ImageIcon("images/waltzhome.jpg");
              //offwaltz = new Button(offwaltz);
              offwaltz = new Button("OffWaltz");
              offwaltz.addActionListener(this);
              nanocad = new Button("Nanocad");
              nanocad.addActionListener(this);
              buttonPanel = new Panel(new FlowLayout(FlowLayout.CENTER));
              buttonPanel.add(offwaltz);
              buttonPanel.add(nanocad);
              //TextArea1 =new TextArea(text, 10, 100);
              MenuBar mb = new MenuBar();
              setMenuBar(mb);
              Menu fileMenu = new Menu("File");
              mb.add(fileMenu);
              MenuItem exitMenuItem = new MenuItem("Exit");
              fileMenu.add(exitMenuItem);
              exitMenuItem.addActionListener(this);     
              PagePanel = new Panel();
              PagePanel.setLayout(new GridBagLayout());
              GridBagConstraints c = new GridBagConstraints();
              c.anchor = GridBagConstraints.NORTH;
              c.gridwidth = 1;
              c.gridx = 0;
              c.gridy = GridBagConstraints.RELATIVE;
              c.weightx = 1;
              c.weighty = 1;
              c.insets = new Insets(0, 0, 0, 0);
              //PagePanel.add(TextArea1, c);
              //PagePanel.add(buttonPanel, c);
              setLayout(new GridBagLayout());
              add(PagePanel, c);
              PagePanel.setLocation(0, 100);
              //PagePanel.setSize(100, 100);
              setVisible(true);
         public void update(Graphics g)
              paint(g);
         public void paint (Graphics g)
              g.drawImage(logo, 0, 30, this);
              //g.drawString(About, 20,150);
              //setFont(new Font("Arial",Font.BOLD,12));
              g.drawString("About", 20,130);
              g.drawString("Tools", 70,130);
              g.drawString("Curriculum", 120,130);
              g.drawString("Resources", 200,130);
              //g.drawString("Test", 690,130);
              //g.drawString("This is a Test String", 20,130);
              g.drawString(line1, 50,175);
              g.drawString(line2, 20,200);
              g.drawString(line3, 20,225);
              g.drawRect(38,373,148,168);
              g.drawImage(nanocadhome, 40, 375, this);
              g.drawRect(248,373,148,168);
              g.drawImage(waltzhome, 250, 375, this);
              //System.out.println("Test is ending");
         public void imagePanel()
              logo = Toolkit.getDefaultToolkit().getImage("images/logo.jpg" );
              nanocadhome = Toolkit.getDefaultToolkit().getImage("images/nanocadhome.jpg" );
              waltzhome = Toolkit.getDefaultToolkit().getImage("images/waltzhome.jpg" );
         public void actionPerformed(ActionEvent e)
              String s = e.getActionCommand();
              String osCommand = "cmd /q /c start /w";
              if (e.getSource() instanceof MenuItem)
                   String menuLabel = ((MenuItem)e.getSource()).getLabel();
                   if(menuLabel.equals("Exit"))
                        dispose();
                        System.exit(0);
              if (e.getActionCommand().equals("OffWaltz"))
                   try
                        Runtime.getRuntime().exec("cmd.exe /c java -jar offwaltz.jar ");
                   catch (IOException ex)
                        System.out.println( ex.toString() );   
             if (e.getActionCommand().equals("Nanocad"))
              try
                        Runtime.getRuntime().exec("cmd.exe /c java -jar nanocad.jar ");
                   catch (IOException ex)
                        System.out.println( ex.toString() );   
         public static void main(String args[])
              chemviz frame = new chemviz();
              frame.addWindowListener(new WindowAdapter()
                   public void windowClosing(WindowEvent e)            
                        {               System.exit(0);        }});
                   frame.setSize(800, 600);
                   frame.imagePanel();
                   frame.loadPanel();
                   frame.setVisible(true);

Maybe you are looking for

  • ASA 5505 ssh access question

    Hi, Currently any ip address can ssh to my asa 5505 firewall outside interface. What should I do to restrict only certain IP can? What's the command to see the current ssh management access rule? Thanks. Ye 

  • Ipod stops playing after 7 minutes

    I have downloaded a couple of talking books from iTunes onto my ipod nano. It stops playing the book after 7 minutes, no matter which book I select. Any ideas ?

  • Changing SID of Windows Installation

    If we implement bootcamp the computers will be part of our Windows Active Directory. What is the easist way to change the SID of the Windows partition?

  • PSE 11 suddenly stops working

    Hi there, I have never had issues with PSE 11 at all, nor PSE 9 prior to that.  Suddenly, I am experiencing "fault bucket" errors and the "photoshop elements 11 has stopped working" error.  It always occurs when I am accessing a plug-in; either a Top

  • CR 2008 runtime and CRVS2010 runtime

    Can the CR2008 runtime and the CRVS2010 runtime be installed on the same machine?  Or does the CRVS2010 runtime require you to uninstall the CR2008 runtime?