How to display Image in full size when clicked

ImageIcon icon = new ImageIcon("C:\\Users\\Ajay\\Pictures\\volt6.jpg");
ImageIcon icon1 = new ImageIcon("C:\\Users\\Ajay\\Pictures\\vlot9.jpg");
ImageIcon icon2 = new ImageIcon("C:\\Users\\Ajay\\Pictures\\add.jpg");
JLabel label = new JLabel();
JLabel label1 = new JLabel();
JLabel label2 = new JLabel();
JPanel bPanel = new JPanel(new GridLayout(2,2,5,5));
label1.setIcon(icon1);
label2.setIcon(icon2);
label.setIcon(icon);
bPanel.add(label);
bPanel.add(label1);
bPanel.add(label2);
This is the code i am using to add 3 images to a Panel.
Now when i click on one of the 3 images that are displayed , i want that image to be displayed in a new window.
Please helpme out.
I am new to this programming ,any kinda advices are appreciated.
ThankYou

I am new to this programming ,any kinda advices are appreciated.you were given good advice regarding standard practices
[http://forums.sun.com/thread.jspa?threadID=5331674&tstart=0]
in ignoring the advice given, you decided it was better to waste more time of others,
with your cross-posting, in your attempt to bludge some code.
i am new to the programming ........all indications are that you will retain that title.....forever
so can u explain in detail........anything less would be 'in one ear, and out both'

Similar Messages

  • IPhoto Not Displaying images in full-size, only thumbnails

    I have iPhoto 11.9.4.2 installed in iMac 27" running Mac OS 10.7.5.
    Up until last night iPhoto has been great. Last night I added about 100 images to my library which is a pretty typical update for me. The pics all transferred fine. All my exisiting and new images are visible in thumbnail mode, however when I 'click' on any one of my new or existing images so that I can view only that image in iPhoto, the image flashes up for 1 second then disappears. If I use my mouse or arrow keys I can go to the next image which again flashes up temporarily then disappears.
    When I adjst the 'zoom' on the lower left portion of the iPhoto window, I can see a very small version of the image I would like to see with a box/rectangle over the area that I assume would be visibile if I zoomed in what would normally be a full-sized image.
    Any ideas?

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In early versions of Library Manager it's the File -> Rebuild command. In later versions it's under the Library menu.)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  
    Regards
    TD

  • How to display reports in same portlet when clicked on report links in a menu portlet

    Hi,
    I am not sure what forum I should ask this question. Anyway, I am trying in this forum.
    Let me explain what I trying to do.
    I have reports links as menu item links in a menu. I have published this menu to portal and added it to a page. I can now see the report links. If I now click on the report link, it opens the report in a whole window. How do I open the report in the same portlet? Is this possible to open the report in a different portlet at least?
    Thanks for your help.

    Hi,
    This is part of JPDK. You will have to install it. Which version of portal are you using? You can also try this out using
    URL portlet which is available with webview in 309.
    Thanks,
    Sharmila

  • How can i display image in RTF template when Oracle Apps running in Windows

    Can any body help how can i display image in RTF template when oracle apps running in Windows Server.
    Thanks
    Ravi

    Hi Ravi,
    You can add images into your rtf template using MS Word Insert Picture feature.
    Did you try this method?
    Thanks
    Ravi
    [email protected]

  • IOS6... How do I see the full screen when watching youtube videos and second the map quality is very poor, foggy most of the time and images overlap to each other... Can I restore to IOS6 if these problems can not be solved?

    I just upgraded to IOS6 and I have some difficulties that I never had on IOS5:
    How can a see the full screen when watching youtube. Address bar is always in view.
    Maps are foggy and some images overlap to eachother.
    If these problems can not be solved, how do I downgrade back to IOS5?
    Regards,
    Luis

    Luis757 wrote:
    If these problems can not be solved, how do I downgrade back to IOS5?
    Regards,
    Luis
    No, there is no legitimate way to downgrade iOS to an earlier version.
    Be patient, Apple will eventually get around to fixing the "bugs" in iOS 6.
    You can leave feedback here: Apple Feedback.

  • Keeping images full size when uploading from "Photos" after editing

    Is there any way that I can edit photos in the ”Photos” app and keep what I have edited and also keep them full size when I upload them Flickr?

    Highlight the images you wish to export.
    Ctrl-Shift-E to open the export dialog.
    Change the top drop-down list to Hard Drive.
    Choose a location for the files in the Export Location section.
    Adjust file naming if necessary.
    In the File Settings section make sure you have the correct output format selected and choose a quality (85 is fine for most things and keeps file size manageable).
    Make file size changes as appropriate in the Image Sizing section.
    If you are downsizing a lot then consider adding some output sharpening.
    Click Export.
    Hopefully that covers most things.

  • How can I create an icon that when clicked will open and maximize an image file?

    How do I create a icon that when clicked will open and maximize an image file?  I have tried to use the simple image widget with maximize upon tap/click - however I am can only size the image really small and put on the page.  I'd prefer to have a graphic that when clicked it simply opens up the image.  This is for a very simple question/answer book.   The user is suppose to look at a picture and locate something.  I want to put an 'Answer' graphic on the image and then the user can click the 'answer' graphic and it will open up the picture with the answer identified. 
    Is this possible?

    Have yiu tried the PopOver widget?  You can drop an image into it, maximise the image and the widgets window...But, you cannot get it full screen.
    With iBooks Author, you either learn to use what is available within the app, or look online for third party widgets to purchase which suit your project.

  • How to display contact person full screen photo in making a call or receive call

    How to display contact person full screen photo in making a call or receive call

    Apple have removed the full screen contact image calling in 7.1, they come with default icon. Hope they bring back that option in next, you can also leave feedback @http://www.apple.com/feedback/

  • How to display images and information

    how to display images and information(e.g. like questions) on a jsp page that stored in a database

    Look As far as i can see....
    Utlimately every file could be expressed as a bytes buffer.
    so say if you have a bean called Choice Bean which is expressed as
    public class ChoiceBean{
       private String choiceid;
       private String choicedesc;
       private byte image[];
       public void setChoiceId(String choiceid){
              this.choiceid = choiceid;
        public String getChoiceId(){
               return this.choiceid;
          public void setChoiceDesc(String choicedesc){
               this.choicedesc = choicedesc;
           public String getChoiceDesc(){
               return this.choicedesc;
           public void setImage(byte image[]){
                  this.image = image;
             public byte[] getImage(){
                  return this.image;
    }QuestionList.java:
    ===============
    public class QuestionList{
         private List<ChoiceBean> choicelist;
          /*Other member variable declarations*/
           public  List<ChoiceBean> getChoiceList(){
                    /*Custom code where you may build the list by querying the DA layer*/
                     return this.choicelist;
         public int search(String choiceid){
                 int index = -1;
                 for(int i =0 ; i < this.choicelist.size() ; i++){
                        ChoiceBean cb = this.choicelist.get(i);
                         if(cb.getChoiceId().equals(choiceid)){
                                index = i;
                                break;
                 return index;
        /* Other member method declarations */
    }and you are retreving List<ChoiceBean> from DB using your query & have created a session attribute / <jsp:useBean> named ChoiceList
    NOTE: sometimes your application server can go out of bounds as you are consuming a lot of memory by creating an arraylist object.
    use the following methodology to display images & choices
    sample.jsp:
    =========
    <jsp:useBean id="QuestionList"  class="com.qpa.dao.QuestionList" scope="session"/>
    <TABLE>
    <%
    /* QuestionList.getChoiceList() is a method which fetches data from the DB & returns it in form of  List<ChoiceBean> */
    List<ChoiceBean> choicelist = QuestionList.getChoiceList();
    for(int i =0 ; i < choicelist.size() ; i++){
    %>
    <TR>
    <TD><%!=choicelist.get(i).getChoiceId()%></TD>
    <!-- calling servlet which renders an images in JPG format based upon given choiceid(unique field) -->
    <TD><IMAGE src="ImageServlet?choiceid=<%!=choicelist.get(i).getChoiceId()%>"/> </TD>
    <TD><%!=choicelist.get(i).getChoiceDesc()%></TD>
    </TR>
    <%
    %>
    </TABLE>
    <%
        session.remove("QuestionList");
    %>
    NOTE: usage of JSTL or any other custom built tag-libraries makes life more simpler in the following case
    ImageServlet.java:
    ===============
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            byte buffer[] = null;
            HttpSession session = request.getSession(false);
            /*getting the QuestionList from the session*/
            QuestionList ql = null;
            String choiceid = new String("");
            try{
                 choiceid = request.getParameter("choiceid");
                 /*getting the QuestionList from the session*/
                ql = (QuestionList)  session.getAttribute("QuestionList");
            } catch(Exception exp){
            if(choiceid.equals("") == false &&  ql != null ){
                List<ChoiceBean> clist = QuestionList.getChoiceList();           
                   assuming that you have created a serach method which searches the entire choice list and would give you
                   the index of that object which is being refered by unique choiceid and returns -1 if not found
                int index =  QuestionList.search(choiceid);
                if(index != -1){
                   ChoiceBean cb = clist.get(index);
                   buffer = cb.getImage();
            if(buffer != null){
                 // assuming that we have stored images in JPEG format only
                 JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(new ByteArrayInputStream(buffer));
                 BufferedImage image =decoder.decodeAsBufferedImage();
                 response.setContentType("image/jpeg");
                 // Send back image
                 ServletOutputStream sos = response.getOutputStream();
                 JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(sos);
                 encoder.encode(image);
            } else {
               response.setContentType("text/html");
               response.getWriter().println("<b>Image data not found</b>");              
    }However,i still feel there are few loopholes with this approach where Application Server can eat up a lot of heap space which may result in outofmemorybound exception.
    Hope this might help :)
    REGARDS,
    RaHuL

  • Is it possible to set an image to zoom full screen when clicked?

    Hi Guys
    Quick question...
    Is it possible to set an image to zoom full screen when clicked?

    You can create a button that displays a larger image:
    http://blogs.adobe.com/indesigndocs/2010/12/hot-spot-button-workaround-for-indesign-dig-pu bs.html

  • How do I get the full size of my pics or video into the time line?

    Greetings,
    I've nener been part of a forum before and an wondering if this will actually be taken seriously. I'm new to video editing and know little about the program I am using (Adobe Premiere Pro CC). Would someone please advise me as to how I can add the full size video or pics to the time line. It appears whenever I add something from my Gopro 3 HD camera I only get a partial of the video / pic.
    Regards,
    The Powered Parachute Guy

    Click the NEW ITEM link on reply page #5 in the PPro/Encore tutorial list in message #3 http://forums.adobe.com/message/2276578 may also help, with more help in message #5
    Also read below...
    Some of this is from the Premiere Elements forum, but the idea of sizing pictures is the same for PPro or Encore
    Pictures that are "overly" large may cause video editing problems
    Photo Scaling for Video http://forums.adobe.com/thread/450798
    -HiRes Pictures to DVD http://forums.adobe.com/thread/1187937?tstart=0
    -PPro Crash http://forums.adobe.com/thread/879967

  • Can someone tell me how to make my screen full size with Safari ?  I am using a Mac osx 10.6.8.

    Can someone tell me how to make my screen full size on my Mac OSX 10.6.8. using safari.  I know this is a simple question. I have always had it on full screen and recently had it worked on remotely and now I can't get the screen back to full size.  I appreciate any advise you can offer. Thank you

    from the BetterTouchTool blog, older versions can be obtained using these links:
    The last 64bit Snow Leopard (10.6 ) version (v 0.939 ) can be downloaded here
    <http://bettertouchtool.net/btt0.939.zip>
    If you are using an older 32bit Mac you’ll have to use this version: 0.785
    <http://bettertouchtool.net/btt0.785.zip>

  • How to display images on my internal isight?

    Hi,
    I just bought the new iMac 2 gig dual. Running on 10.5.2.
    I wanted to know how to display images on my screen during a video conference chat without resorting to holding up a print out to the camera? I need something where I can switch from video mode to image mode and show a single image at a time if I need to. All that while still talking of coarse. If it isn't possible with my iSight software, can you point me to other software I can download and still use my built in cam?
    I hope I was clear enough in asking this.
    Thanks
    Liban

    Welcome to Apple Discussions, Liban
    iChat can do what you want, but I do not know of any web-based video chat site that can.
    Look for Help or Support information on the site you are using or ask the Webmaster if his site has the capability to do what you want.
    EZ Jim
    PowerBook 1.67 GHz w/Mac OS X (10.4.11) G5 DP 1.8 w/Mac OS X (10.5.2)  External iSight

  • In iPhoto most of my photos appear to have been replaced by much smaller versions. What has happened and how can I get the full size photos back?

    In iPhoto most of my photos appear to have been replaced by much smaller versions. What has happened and how can I get the full size photos back?

    That is either a bug in Firefox 5 or the script has a problem with Firefox 5.<br />
    It works in all other Firefox versions like Firefox 3 and 4 and 6 (Aurora) and 7 (Nightly).

  • How to display image?

    Hi all,
    How to display image from the database table in the adobe form by using web dynpro abap?
    I want to display image in the adobe interactive form by using web dynpro abap.
    Please help me.
    Regards,
    srini

    Hi Srini,
    If you go through the article you might have seen the following piece of code
    *** Send the values back to the node
      lo_el_z_if_test_cv->set_static_attributes(
        EXPORTING
          static_attributes = ls_z_if_test_cv ).
    " here ls_z_if_test_cv has the image in XSTRING format which has beeen retrived using METHOD get_bds_graphic_as_bmp of CLASS cl_ssf_xsf_utilities
    " In  your case you need to just use the select query n fetch it from your table; ( provided your image is store in XSTRING format )
    How is your image stored in your database table ?
    Regards,
    Radhika.

Maybe you are looking for