Can i put a Image  or ImageIcon inside a JTextField?

youst the same way it is on Windows Media Player 11(the textField on the toolBar) and add AddXXXListerner to the image?
or maybe like the textField on the iTunes toolbar?

Can i put a Image or ImageIcon inside a JTextField?http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=2&t=014531

Similar Messages

  • How can I put an image/s in Java Application?

    Hi to all.
    How can I put an image/s in Java Application?
    I can put some images in Java applet but when i try to put it in Java application there was an error.

    hey u can easily do it with JLabels...i found a Code Snippet for u
    public class MyPanel extends JPanel
    {private JLabel imageLabel; public MyPanel() {     Image image = Toolkit.getDefaultToolkit().getImage("myimage.gif"); // Could be jpg or png too     imageLabel = new JLabel(new ImageIcon(image));     this.add(imageLabel);  }}
    hope it helps
    Cheers,
    Manja

  • How can I put the image fixed on the bottom-left of the HTML page

    I can't put the image at the left-bottom of my div id="content". I have "textcontent" (float:left) and "sidebar" (float:right) inside the content. I am attaching my code here for your review. Please help!
    HTML:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Interior and Exterior</title>
    <link href="main.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    </script>
    </head>
    <body onload="MM_preloadImages('images/rollover_home.jpg','images/menu_home_over.png','images/m enu_paint_over.png','images/menu_contractor_over.png')">
    <div id="container">
      <div id="header">
      <div id="contactinfo">contact us for free estimates  250-878-1786</div>
    <div id="logo"><a href="index.html"><img src="images/logo.png" width="276" height="53" /></a></div>
    <div id="topmenu">
    <ul>
    <li><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home','','images/menu_home_over.png',1)"><img src="images/menu_home.png" name="home" width="119" height="54" border="0" id="home" /></a></li>
    <li><img src="images/menu_interior_over.png" width="177" height="54" /></li>
    <li><a href="paint_design.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('paint','','images/menu_paint_over.png',1)"><img src="images/menu_paint.png" name="paint" width="172" height="54" border="0" id="paint" /></a></li>
    <li><a href="contractor_trades.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contractor','','images/menu_contractor_over.png',1)"><img src="images/menu_contractor.png" name="contractor" width="166" height="54" border="0" id="contractor" /></a></li>
    </ul>
    </div>
      </div>
    <div id="content"><h1><img src="images/page_name_interior.png" width="286" height="27" /></h1>
    <div id="textcontent">
    <h2>Interior Services:</h2>
    <p> </p>
    <h3>Painting and staining:</h3>
    <table width="300" border="0">
      <tr>
        <td width="100">doors</td>
        <td width="100">walls</td>
        <td width="100">ceilings</td>
      </tr>
      <tr>
        <td>baseboards</td>
        <td>trim</td>
        <td>cabinets</td>
      </tr>
      <tr>
        <td>banisters</td>
        <td>rails</td>
        <td></td>
      </tr>
    </table>
    <p> </p>
    <h3>Fill and seal:</h3>
    <table width="300" border="0">
      <tr>
        <td width="100">cracks</td>
        <td width="100">baseboards</td>
        <td width="100">trim</td>
      </tr>
      <tr>
        <td>holes</td>
        <td>drywall repair</td>
        <td>cabinets</td>
      </tr>
    </table>
    <p> </p>
    <h3>Wallpaper and boarder removal</h3>
    <br />
    <p>No interior job is complete unless all the holes, nicks and gaps are filled and sealed.  I guarentee you'll be happy with the quality of our workmanship.</p>
    <p> </p>
    <h2>Exterior Services:</h2>
    <p> </p>
    <h3>Painting and staining:</h3>
    <table width="400" border="0">
      <tr>
        <td width="100">trim</td>
        <td width="100">posts</td>
        <td width="100">beams</td>
        <td width="100">hardiboard</td>
      </tr>
      <tr>
        <td>smartboard</td>
        <td>gables</td>
        <td>facia</td>
        <td>shakes</td>
      </tr>
      <tr>
        <td>shadowboard</td>
        <td>belly-board</td>
        <td>stucco</td>
      </tr>
    </table>
    <p> </p>
    <h3>Decks and rails:</h3>
    <table width="150" border="0">
      <tr>
        <td width="144">staining and painting</td>
    </tr>
    </table>
    <p> </p>
    <h3>Power washing:</h3>
    <table width="180" border="0">
      <tr>
        <td width="174">houses, fences and decks</td>
    </tr>
    </table>
    <p> </p>
    <p> </p>
    <h3>All nail holes are filled and all joints filled and sealed on all exterior painting projects.</h3>
    <p> </p>
    <h3>Stucco homes can be repainted quickly and inexpensively!</h3>
    </div>
    <div id="sidebar">
      <img src="images/interior_house.png" width="514" height="329" /><br />
      <a href="testimonial.html"><img style="padding-left: 40px; padding-top: 30px" src="images/interior_testimony.png" width="362" height="289" /></a></div>
    <p><img src="images/exterior_specialists.png" width="322" height="56" /></p>
      </div>
    <div id="footer"><img src="images/interior_footer.png" width="962" height="50" /></div>
    </div>
    </body>
    </html>

    Working with CSS Backgrounds:
    http://www.w3schools.com/css/css_background.asp
    #content {
         background-image:url('some-img.png');
         background-repeat: no-repeat;
         background-position: left bottom;
         min-height: 500px; /**same as image height**/
         overflow:hidden; /**float containment**/
    HTML
    <div id="content">
    the rest of page content goes here>>>
    </div>
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/

  • Can't put photos/images in email (new email) in Mail

    Okay, this is weird. I can no longer drop a .jpg image (or any other) into a new email message. (This is with my prefs set to compose in Rich Text Format, yes. And this is 10.5.2.)
    If I try to drag it from the Photo Browser into a message, sometimes it appears as if it's going into the email message, but it does not appear in the body area. Sometimes it bounces back to the Photo Browser, as if the email message is an object that cannot receive a dropped image file. And if I try to drag an image file from Finder into the body of the message, I can get either behavior again.
    Either way, I can't put an image/photo/graphic file into an email message.
    Has anyone else seen this behavior and figured out a fix for it?

    An addendum...
    Just to make it really weird, I can drag image files from the Photo Browser to the Mail icon in the Dock and make a new email, and then I can see the image in the mail message. And once I have that e-mail message created by dragging an image the Dock icon, I can drag other images/files from the Photo Browser into the same new message and see them.

  • How can I put another image without its associated sound on an audio (without its image) ?

    IMovie 11 : how can I put one image without its associated sound on an audio (without its image) ? thanks

    Hi
    As iMovie doesn't orient after Time - but only after Video/Photo clips is this not so easy to do.
    I use black photos as Dummy clips - and put them into a new project first
    then I add the Music I want
    Then I drop the Video-clip (that I realy want) ontop of the black dummy photo - Where it's supposed to be - THEN IF advanced tools are selected (in iMovie preferences) there will be a Drop-Down menu and here I can select to do a Cutaway - and select not to add the audio from it (or in wave-form just silence it out)
    Yours Bengt W

  • How can I put an image onto a postcard format?

    How can I put an image onto a postcard format?

    By postcard format do you mean crop the picture into a postcard shape?
    If so, here is one way: Activate the Rectangular Marque tool. Set Style to Fixed Aspect Ratio, and enter the dimensions for Width & Height. In this example I used a standard postcard size of 6" x 4.25".  Open your picture, draw out the rectangle, and Image > Crop. The picture will now be in the 6 x 4.25 proportion.
    To get it to the actual 6" x 4.25" size, do Image > Resize > Image Size. Check the Constrain Proportions Box, and enter either the true Width or Height; the other dimension will change accordingly.
    If this is not what you are trying to do, please be more specific.

  • How can I put an image of a painting centered on to a blank 4x6 postcard?

    How can I put an image of a painting centered on to a blank 4x6 postcard?

    moopartist wrote:
    How can I put an image of a painting centered on to a blank 4x6 postcard?
    Go to File>new>blank file. Enter the dimensions, background color to suit. For resolution, it's best to have the same value as that of the image. For printing, it is desirable to have the resolution in the 240-300px/in range, although I have printed below this range.
    Open the file with the painting. Use one of the selection tools, e.g. selection brush, lasso tool, and select the image.
    Go to Edit>copy
    Open the blank file
    Go to Edit>paste. The selection will come in on its own layer
    Use the move tool to position, and, to resize (if necessary) with the corner handles of the bounding box.

  • Mc770LL/A I PAD CAN I PUT SCREEN IMAGE ON MY TV, mc770LL/A I PAD CAN I PUT SCREEN IMAGE ON MY TV

    mc770LL/A I PAD CAN I PUT SCREEN IMAGE ON MY TV

    Yes.
    Regards.
    Forum Tip: It is generally considered inappropriate to type all in uppercase letters in Internet discussions, as text that is typed all in uppercase is by convention considered to be shouting.  Uppercase is also more difficult to read, so please use all uppercase sparingly and only when you really mean to shout, which we hope you won’t need to do here .

  • TabbedPanels Tab - How can we put individual images on each tab button?

    Hi,
    How can we put individual propeties (like size, background images etc) in each tab button of TabbedPanels Tab?
    Thanks

    Wow ! Itz amazing !! .... This is what 'm exactly looking for
    Thanks a lot Gramps
    Alin

  • How can I put an image in the page header so that it will be repeated on every page?

    Hi to everyone!
    I want to create a Pages template with the logo of our company in the page header.
    I'd like to put that image (logo) in the page header so that it will be repeated on every page but it will not modify the content of the page.
    Anyone know how to achive this, or something similar without have to copy-paste that image every time we add a page to the document?
    Thanks in advance

    Takashi,
    Turn off the Page Headers (not absolutely necessary, but since you don't need it, why not)
    Put your Graphic on the page and make the following settings:
    Then Insert > Text Box and make the same settings as for the graphic.
    Place your "Header text" in the text box and arrange the box and graphic as you want them. Move both to Section Master using the Arrange menu.
    Jerry

  • How can I move an image/file around inside a document with text already in it?

    I'm learning In Design on the job, and it's a real challenge.  One big problem I'm having is, after I've placed an image inside a document with text in it, how do I place it precisely where I want it?  Sometimes I need the image flush to the left, and sometimes I need to center it.  When I place it, it doesn't land where I need it to be.  Things I've tried work sometimes but not other times.  I've tried going to Paragraph and reducing the setting to zero to move an image flush to the left of the text frame/column (I'm working with a three-column page).  Sometimes that works, and sometimes it does not.  When it doesn't, I've tried using the Selection tool to drag the image, but it doesn't respond.  Could someone give me an idea of what I'm overlooking?  I'm finding that InDesign has many settings, and all it takes is for one setting to be what it shouldn't be for things to go badly wrong.  I'm having other issues too, but in this discussion I'll stick to this.

    Sounds like you are anchoring the images in the text flow. That's fine if you need them to move along with text during editing, but is usually not required and often counter productive. If you place your images as separate objects in their own independent frames they can be positioned anywhere and moved at will. If they need to be anchored, consider using Custom Positioned instead of inline.

  • How can I put the image and header in the same animation

    I am working on presentation and want to have the image (I choose "Showroom" theme) on the half side of the page (either left or right) and the text header (on the middle top) coming at the same time in the annimation. I am now doing by choose effect direction and set the oder. How can I have let say oder no 1 and 2 coming at the same time.
    Thanks,
    Monkon

    Select both objects and group them ( command alt G ) or (Arrange > Group)
    Inspector > Builds > Effects
    click more options and choose torun the build Automatically or On Click

  • Can one put XP image on the second disk with "img"?

    Hi all,
    We have a requirement to put in two IDE disks in the same machine and
    image the machines with different XP systems, each hard disk hosting one
    operating system.
    I was wondering whether Zen "img" utility allows for putting images on
    more then one disk. Say for example:
    XP-image1.zmg --> to hda (disk1)
    XP-image2.xmg --> to hdb (disk2)
    I have read documentation which mentions the ability of img program to
    image partitions but not other disks. Any ideas? Preferably a command
    line sample if there is such would help.
    Cheers,
    Skender

    Thanks for quick reply Dave. Looks like this will do the job for me.
    S
    Dave Parkes wrote:
    > A second disk is just a collection of more partitions, basically 4 per
    > disk - see TID 10053996. So you'd probably use
    >
    > img pc1 ntfs
    > img rp server //server/path/image1 a1:p1
    >
    > and then
    >
    > img pc5 ntfs
    > img rp server //server/path/image2 a1:p5
    > img pa1
    >
    > Cheers Dave
    >
    >

  • How can I put a image in a label?

    thanks

    You should use a JLabel. Look at the API. BTW, you should always take a look at the API before posting a question. In this case, it's quite obvious.

  • 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