What component do I use to display image ????????

hi there
which component do i use to display image or pisture? JLabel?

the most simple is a JLabel with an ImageIcon

Similar Messages

  • What Component should be used to display the list on UI

    Hi All,
    I have a table in which when the user selects a row and tries to remove the row. I am supposed to show the pop up which shows all the rows matching to the header of the row.
    In my backing bean i have the context of the row so i could extract the matching rows form db into a List<String> . Now what i need to know is which component on the Ui will show this as a list in Pop Up.
    I mean which component af:??? should be used to display the List ?
    I am kind of new to ADF.
    Regards,
    Sharma

    inputComboboxListOfValues
    selectOneChoice
    inputListOfValues

  • What component Should I use?, Jpanel doesn't work

    Hi
    I need a program that has a window that can go fullscreen and windowed (I did that with a Jframe in fullscreen mode with a jpnale and a 800x600 Jpanel and destroying them with an object that maneges them), I did it with a jframe that contained a Jpanel, I used a Jpanel to avoid the flickering on the screen but I also need to change the font type and the font size, but the setFont on the Jpanel doesn't change the font (as I have realized and also read here [http://forum.java.sun.com/thread.jspa?forumID=257&threadID=150588] ), so I'm lost, I might have to redo the whole thing, but I just wanted to know what component should I use for a window that is going to have custom graphics and need diffrent fonts and diffrent font sizes and work in fullscreen without flickering
    Thank you for your attention, I would aprecciate any help given

    for example:
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.RenderingHints;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JSlider;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ChangeListener;
    public class JPanelFont extends JPanel
      private Font font = getFont();
      private String myString = "Fubars Rule";
      private int fontSize = font.getSize();
      private JSlider slider = new JSlider(0, 100, fontSize);
      public JPanelFont()
        setPreferredSize(new Dimension(620, 250));
        setLayout(new BorderLayout());
        JPanel inputPanel = createInputPanel();
        add(inputPanel, BorderLayout.SOUTH);
      private JPanel createInputPanel()
        JPanel ip = new JPanel();
        slider.setMajorTickSpacing(20);
        slider.setMinorTickSpacing(5);
        slider.setPaintTicks(true);
        slider.setPaintLabels(true);
        ip.add(slider);
        slider.addChangeListener(new ChangeListener()
          public void stateChanged(ChangeEvent evt)
            fontSize = (Integer)slider.getValue();
            repaint();
        return ip;
      @Override
      protected void paintComponent(Graphics g)
        Graphics2D g2 = (Graphics2D)g;
        Object originalHint = g2.getRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING);
        g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        super.paintComponent(g2);
        myPaint(g2);
        g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, originalHint);
      private void myPaint(Graphics2D g2)
        font = font.deriveFont(Font.BOLD, fontSize);
        g2.setFont(font);
        g2.drawString(myString, 20, 100);
      private static void createAndShowUI()
        JFrame frame = new JFrame("Dynamic JPanel Font");
        frame.getContentPane().add(new JPanelFont());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      public static void main(String[] args)
        java.awt.EventQueue.invokeLater(new Runnable()
          public void run()
            createAndShowUI();
    }Edited by: Encephalopathic on May 21, 2008 9:18 PM

  • A component is not able to display Image UIElements anymore

    Dear Developers,
    I am discovering today that a component that I have developped is not able to display the Image UIElement anymore. In the workbench, the element is displayed correctly ( it has no binding of its attributes to the context and the URL of the source is static).
    Its parent container is the ROOTUIELEMENTCONTAINER and it is visible (all parameters are the default).
    No Image can be displayed anymore. This is very strange. My other UIelements in the view are displayed correctly and seem to be working nicely (events, actions, methods calls ...).
    Can you help me ?
    Best Regards,
    Olivier MATT
    PS: I tried accessing the same URL with a Image UIElement in another component and it works fine.  It seems that the generated coding Javascript/HTML is invalid (when I try to display the sourcecode of the application/frame, IE informs me that the source contains errors). For Information, I am running Netweaver SP 11.

    Hi again,
    I think I have found where my problem is. I have right clicked on th eimage and try to set some settings in the browser while using the application (on the displayed image).
    Now the image is not displayed anymore (according to the settings) but I dont know where I can delete these setting values. I tried removing my cookies but it did not help.
    Any idea?
    Sincerely,
    Olivier MATT

  • What is the best way to display image ??

    hi my questions is unusual, there are so many ways to display images.
    I m developing image processing s/w can any one suggest me which would be the best way to display image on which i can perform image operations.
    like in JPanel, icon, trhough paint() or anything else...
    thank you..In advance

    hi man... i think so imaging is better with JAI(Java Advanced Imaging) .... is perfect for display in jcomponent like JPanel or JLabel, you have to replace the paintComponent().
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Rectangle;
    import java.awt.geom.AffineTransform;
    import javax.media.jai.PlanarImage;
    import javax.swing.JComponent;
    class ImagePanel extends JComponent {
         protected PlanarImage image1;
         protected AffineTransform atx= new AffineTransform();
         protected int width, heigth;
         public ImagePanel() {
         public ImagePanel(PlanarImage i) {
              image1= i;
              width= i.getWidth();
              heigth= i.getHeight();
         public void paintComponent(Graphics gc) {
              Graphics2D g= (Graphics2D)gc;
              Rectangle rect= this.getBounds();
              if ((width != rect.width) || (heigth != rect.height)) {
                   double magx= rect.width / (double)width;
                   double magy= rect.height / (double)heigth;
                   atx.setToScale(magx, magy);
              if (image1 != null)
                   g.drawRenderedImage(image1, atx);
    if you need more info, ask about JAI api and docs

  • How do I find out what filter effect I used on an image after I have saved it?

    I used a series of filters that gave an image a very cool painterly - impressionistic painting - quality.  I have forgot what steps I took to get that effect.  I have tried to go back and look at the image history but that did not tell me anything since I already saved the image.  The finished photo looked like swirly painted brush strokes with depth just like you would get if you actually painted it.
    I recall an old program like Fractal Painter used to have some filters like that.  I don't think Fractal Painter even exists anymore.  Does anyone know what I may have done to get that effect or how I can look at the image data to figure out what filters I used?

    Len Turnquist wrote:
    Thanks rkelly!  You put me on the right track with the missing oil paint filter.  It's not in 2014 CC for some reason.
    Check out Jeff Tranberry's CC 2014 FAQ for the reason why.
    2014 release of Photoshop CC: FAQ

  • Whats the best way to manage/display images ?

    I'm building a yet another photo management application that is designed to be a Picasa2 "lite". I've got a lot of JPGs I need to manage, all of which are loaded asynchronously and cached over the web.
    The same image may appear in multiple places, (i.e. thumbnail, fullsize, original with a zoom box, etc.) I'm having problems keeping all these images in synch when I change the underlying image -- right now I have to create all new JLabels for everything and add them to their respective Panels again. But that doesn't seem like its the best way.
    Here's my JLabel sub-class:
    public class ImageLocatorSubscriber extends JLabel {
         public final ImageDimEnum maxDimEnum;
         final ImageIcon imgIcon = new ImageIcon();
         BufferedImage bi;
         ImageLocator il;
         public ImageLocatorSubscriber(ImageLocator il, ImageDimEnum d) {
              super();
              this.maxDimEnum = d;
              this.imgIcon = new ImageIcon();
              if (il != null) {
                   this.il = il;
                            this.bi = il.getBi(RunMode.NOWAIT);
                      if (bi.getWidth()!=maxDimEnum.dim.getWidth() || bi.getHeight()!=maxDimEnum.dim.getHeight()) {
                           bi = FotoFix.resize(bi, maxDimEnum.dim);
                      this.bi = bi;
                      this.imgIcon.setImage(this.bi);
                      this.setSize(bi.getWidth(), bi.getHeight());
              this.setIcon(this.imgIcon);
              this.setBorder(Constants.borderGray);
         }Is the preferred method for changing the image displayed in a JLabel
    a) create a new ImageIcon and use (JLabel) this.setIcon()
    b) reuse the existing ImageIcon and use (JLabel) this.imgIcon.setImage();
    c) remove the old JLabel from the panel, create a new JLabel, and add that to the panel?
    I can only get c) to work. When I try to use b) some of the images are not updated properly, even as I have declared this.imgIcon as final. Any ideas, or should I just leave it be?

    override this method in any JComponent subclass
    http://java.sun.com/javase/6/docs/api/javax/swing/JComponent.html#paintComponent(java.awt.Graphics)

  • Need advice on what component(s) to use

    I'm trying to put together a UI that displays a background image and displays on top of that image several jpanels, jlabels, and icon type images . I'd like the user to be able to drag the panels etc. to a desired location.
    I'll then need to grab the coordinates and store them to a file, so that I can rebuild the UI with the components in the same place that they were placed when restarting the application
    Wow that was hard to put into words.
    The idea is the image will be a layout and the panels will be the physical position of a data source. A bit like in home automation programs that shows a layout of the house with the locations of cameras and switches etc.
    So I'm thinking JInternalFrames may work but I need something that is transparent.
    Any advice or a push in the right direction before I dive in will be greatly appreciated.
    Edited by: xavier33 on Feb 22, 2008 4:08 PM

    panels would work equally as well, but you're still going to have the same problem (from your first post)
    "I'm trying to put together a UI that displays a background image and displays on top of that image several jpanels, jlabels, and icon type images ."
    if any of the add-ons has a listener, you'll have to pass on the event to the panel.
    this might be close enough - a small area at the top, when the cursor changes you can drag the panel around
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class Testing
      int xPos, yPos;
      Cursor normalCursor = new Cursor(Cursor.DEFAULT_CURSOR);
      Cursor moveCursor = new Cursor(Cursor.MOVE_CURSOR);
      public void buildGUI()
        ImageBackgroundPanel backgroundImage = new ImageBackgroundPanel("test.gif");
        backgroundImage.setLayout(null);
        final JPanel viewPanel = new JPanel(new BorderLayout());
        viewPanel.setOpaque(false);
        viewPanel.setBounds(0,0,100,100);
        final JPanel p = new JPanel();
        p.setOpaque(false);
        p.setPreferredSize(new Dimension(viewPanel.getWidth(),10));
        viewPanel.add(p,BorderLayout.NORTH);
        viewPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));//<---just so you can see it moving
        backgroundImage.add(viewPanel);
        JFrame f = new JFrame();
        f.getContentPane().add(backgroundImage);
        f.setSize(600,400);
        f.setLocationRelativeTo(null);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
        p.addMouseListener(new MouseAdapter(){
          public void mousePressed(MouseEvent me){
            xPos = me.getX();
            yPos = me.getY();
          public void mouseEntered(MouseEvent me){
            p.setCursor(moveCursor);
          public void mouseExited(MouseEvent me){
            p.setCursor(normalCursor);
        p.addMouseMotionListener(new MouseMotionAdapter(){
          public void mouseDragged(MouseEvent me){
            Point vp_p = viewPanel.getLocation();
            Point me_p = me.getPoint();
            viewPanel.setLocation(vp_p.x + me_p.x - xPos,vp_p.y + me_p.y - yPos);
      public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            new Testing().buildGUI();
    class ImageBackgroundPanel extends JPanel
      Image img;
      public ImageBackgroundPanel(String file)
        try
          img = javax.imageio.ImageIO.read(new java.net.URL(getClass().getResource(file), file));
        catch(Exception e){}//handled in paintComponent
      public void paintComponent(Graphics g)
        super.paintComponent(g);
        if(img != null) g.drawImage(img, 0,0,this.getWidth(),this.getHeight(),this);
    }

  • What compression type to use for disk image files

    Hello all
    I was wondering if a more experienced user than me could give a recommendation as to which compression format I should use to compress an image I made of my / partition. I used dd to make the image file.
    For me, (de)compression time is more important than compression ratio (size), but I'm of course looking for a good blend of both
    Thanks for any advice

    If you have a multicore processor, use pigz instead of gzip etc. Start with this app and only after you're not happy with it, look for one that's faster / compresses better.
    BTW, do you have a lot of incompressible data in there? Movies, pics, music and already compressed files won't compress any more.
    Last edited by karol (2011-01-29 16:16:03)

  • How can I restore the background color Firefox 13 used for displaying images?

    I preferred the darker background color introduced in Firefox 13 for when images were displayed standalone, as opposed to the glaring white. How can I restore that behavior?

    That should still happen.
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    You can also check for a userChrome.css file with code to change the background color.
    The customization files userChrome.css (interface) and userContent.css (websites) are located in the chrome folder in the user profile folder.
    *http://kb.mozillazine.org/Editing_configuration

  • What is component used to display system files in FTP

    Hello,
    I would like to know what is the component that is used to display system files and remote server files in a FTP.
    e.g
    File Name || File Type || File Size
    1.jsp JSP file 1kb
    2.java JAVA file 10 kb
    Do we need to use JTable to display the headers and a JTree to display the system files? Please help
    Thanks
    james

    Hi James,
    Actually, I am developing where one of its modules is a ftp client.
    Mainly, it has 2 panels with JTree's one with the local files and the other, with the remote files.
    Have a look to the following links, the are very useful:
    About JTree's:
    http://www.fawcette.com/javapro/2003_01/magazine/features/bkurniawan/default_pf.asp
    http://java.sun.com/products/jfc/tsc/articles/treetable1/
    and the java tutorial
    In this link there is a example, simple but it works really well:
    http://www.hipp-online.de/download/version.php?WAppFtp1.4_en
    hope it helps,
    sergio

  • What component to display a matrix

    I want to create a grid with horizontal and vertical header, like Excel tables.
    All the cells of this grid are independant :
    seems to me that in a datagrid, the cells of a same row represent differents fields of a unique dataProvider element.
    but here I want that each cell represent an independant element.
    For example I would like to have a model that is a matrix, maybe an ArrayCollection of ArrayCollections, and each element of this matrix is displayed in the corresponding cell.
    What component would you use ?

    Here is the mxml part of my renderer (Labels are bound on var sound:XMLList that has only one XML element) :
    <s:Group>
         <s:states>
            <s:State id="noSound" name="noSound"/>
            <s:State id="soundRecording" name="soundRecording"/>
            <s:State id="soundRecorded" name="soundRecorded"/>
        </s:states>
        <s:Rect width="100%" height="100%" >
            <s:fill>
                <s:SolidColor id="background" color="0xFFFFFF"/>
            </s:fill>
            <s:stroke>
                <s:SolidColorStroke color="0x000000" weight="1"/>
            </s:stroke>
        </s:Rect>
        <s:Label x="5" y="5"
                 text="{sound.@id}"
                 includeInLayout="{isExpanded}" visible="{isExpanded}"/>
        <s:Label x="40" y="5"
                 includeIn="soundRecorded"
                 includeInLayout="{isExpanded}" visible="{isExpanded}"
                 text="{sound.@pathName}" toolTip="{sound.@pathName}"
                 width="100%" maxDisplayedLines="1"/>
        <s:TextArea id="descriTA" x="5" y="22"
                    includeInLayout="{isExpanded}" visible="{isExpanded}"
                    width="150" height="60"
                    change="{descriChange(descriTA.text)}" text="{sound.@descri}"/>
        <s:Image id="playImage" source="{SoundGrid.playIcon}"
                 mouseDown="{playImage.source = SoundGrid.playIconDown}"
                 mouseUp="{playImage.source = SoundGrid.playIcon}" mouseOut="{playImage.source = SoundGrid.playIcon}"
                 includeIn="soundRecorded"
                 includeInLayout="{isExpanded}" visible="{isExpanded}"
                 x="5" y="84"
                 toolTip="play"
                 click="playClicked()" />
        <s:Image id="recordImage" source="{SoundGrid.recordIcon}"
                 mouseDown="{recordImage.source = SoundGrid.recordIconDown}"
                 mouseUp="{recordImage.source = SoundGrid.recordIcon}" mouseOut="{recordImage.source = SoundGrid.recordIcon}"
                 includeIn="noSound"
                 includeInLayout="{isExpanded}" visible="{isExpanded}"
                 x="5" y="84"
                 toolTip="record"
                 click="recordClicked()"/>
        <s:Image id="stopImage" source="{SoundGrid.stopIcon}"
                 mouseDown="{stopImage.source = SoundGrid.stopIconDown}"
                 mouseUp="{stopImage.source = SoundGrid.stopIcon}" mouseOut="{stopImage.source = SoundGrid.stopIcon}"
                 includeIn="soundRecording"
                 includeInLayout="{isExpanded}" visible="{isExpanded}"
                 x="5" y="84"
                 toolTip="stop"
                 click="stopClicked()"/>
        <s:Image id="importImage" source="{SoundGrid.importIcon}"
                 mouseDown="{importImage.source = SoundGrid.importIconDown}"
                 mouseUp="{importImage.source = SoundGrid.importIcon}" mouseOut="{importImage.source = SoundGrid.importIcon}"
                 includeIn="noSound"
                 includeInLayout="{isExpanded}" visible="{isExpanded}"
                 x="50" y="84"
                 toolTip="import"
                 click="importClicked()"/>
    </s:Group>

  • Using flash to display images from sql server or file system

    hello,
    what methods and parameters of the urlloader class we have to use to display images in a flash player if possible..
    also movie should update everytime a new image is added to a database or file
    the images can either be in a file system or in a sql database (if possible)
    does flash comes with an object of this type or we have to create it.
    regards,

    i responded to your duplicate message 4 days ago:
    is it possible to insert and retrieve images from sql server using actionscript.
    you'll need server-side script to query your database and you can use the flash urlloader class to call your script.
    also  is it possible to create a flash scrolling gallery based on images  stored in a database and everytime an image is added it is displayed in  the gallery.
    load the data using the urlloader class and  then load the images.  periodically query the database for new images if  there's no direct way for flash to know a new image was added.

  • Upload and display image in webside

    Hello Friends,
    I am developing an auction web site ,and facing some problem so I need your help.
    There is some confusion about uploading and displaying images in website .In web based
    application if I want to upload images than where have to store the images database or server
    side any folder .I have not idea about that please send your ideas and sussesions.
    Second problem is What is the best way to display images in webside either giving a direct
    path of server side image folder or I need to retrieve all images from database .
    I have no idea about it please send me your guideline which are usefull for me to implement in my
    website.
    what is the correct way to upload and display images in website ?
    Thanks . Have a nice day.

    If you are using a Container you just leave your image files in the home directory of your web application. And forget this idea about database. It´s not necessary in this case.
    To display the images just use HTML, <img src="url">.

  • Displaying image in swings

    i am creating this programme where user will select the file from local directory and it is displayed .
    I have code till user selects the required file
    Now i dont know what kind of component should be used to display the file like JTextArea or what and how to go about it .
    any help will be appericiated

    Probably the simplest way is with a JLabel and an ImageIcon.
    http://java.sun.com/docs/books/tutorial/uiswing/components/label.html
    http://java.sun.com/docs/books/tutorial/uiswing/misc/icon.html

Maybe you are looking for

  • Accessing properties of a UI element in wdDoInit()

    I would like to interrogate the value of a DateNavigator elements startsWith property in the wdDoInit method of the view controller, by using the IWDDateNavigator.getStartsWith() method. The problem is, I cannot figure out to programmatically access

  • Acrobat 9 with FrameMaker 7.2

    Hello, I'm running FrameMaker 7.2p158, Acrobat 7.1.0, and Windows XP, everything patched up to date. I've recently acquired the latest version of the Technical Communication Suite, which includes Acrobat 9. I'm not ready to install FM8 yet, but I wou

  • Help with updating a database while in cfloop

    Greetings. I'm having some difficulties in updating a database using cfquery inside of a cfloop. Background: I've got a text file that I need to interpret, line for line, and then update an existing database with information from that text file. For

  • EDN:  subscribe to the same event deployed on different domain/Servers

    We are working on use case where in we would like to publish an Event from an ADF application . We would like to subscribe to the same event deployed on different domain/Servers than the servers on which ADF Application deployed. We would like to get

  • Option to extend partition is grayed out in windows 2008 R2

    Option to extend partition is grayed out in windows 2008 R2