GUI Photo Album basic help

Hi, I'm making a Photo Album program with a vertical split pane with picture on top and controls on the bottom. I have a text document with the names of pictures I want to display in it. I don't know how to have pictures in a panel at all, or how to get the files from the text doc. I know how to do a ActionListener kind of, but I'm pretty lost.
    public PhotoAlbum()
    super("Photo Album");
        ResourceBundle imageResource;
        JButton next = new JButton("Next");
        JButton prev   = new JButton("Previous");
    a = new JPanel(new FlowLayout());
        a.add(prev);
        a.add(next);
    b = new JPanel();
        b.setPreferredSize(new Dimension(800, 500));
    c = new JSplitPane(JSplitPane.VERTICAL_SPLIT, b, a);   
        c.setOneTouchExpandable(true);
    setContentPane(c);
    }Sorry if I have deformed looking code, and thanks for the help!

Yeah, I guess you could use a JLabel. I don't use Swing much. Though from reading the docs, it sounds like JLabel is supposed to print small, well, labels, and not large images. But maybe you can use it for that anyway.
"State" is information that expresses the current and ongoing behavior of an object. So for a photo display component, the state could be all images it knows to display, and the one image its currently displaying.
I suppose you could subclass JLabel to get its functionality, and then add the state to the subclass. But maybe that's not how one does things in Swing. I get the impression that it would be more typical to put that state somewhere else, and then just set the JLabel's image value. That's not very object-oriented but it seems typical.
It looks like JLabels use an Icon object, where Icon is an interface that apparently just knows how to report its size and how to draw itself. It looks like Icon is meant for small images (e.g., icons) only, but so is JLabel so if you're going to use that for a big image you might as well do the same for Icon.
So what you could do is, you could make a class that implements Icon, and which holds the state about images. Then put it in a JLabel, and then put the JLabel in the upper panel.
I don't know what you mean by the last question. The BufferedReader knows how to read a character stream (e.g., file contents) one line at a time. If each line names an image, you'd then have an easy way to get the names of image files. Once you do that, you can use the name to load the image into an Image object, and put each Image object into an array or a java.util.List. You can use the javax.imageio.ImageIO class to load images by name. The BufferedReader wouldn't worry about the indices of the array holding the images; that's not its job.

Similar Messages

  • I need help with my GUI Photo Album.

    Hello! I'm still learning bits about GUI and I need some assistance to make my basic program work. I've searched the forums to look at past Photo Album projects; they didn't help much or maybe I'm overlooking some things. Every time I click the "Next" button the image doesn't change. It may be a simple task to solve, but I'm really stumped! Sorry if it's such a stupid thing to ask. Thanks in advance.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    public class PhotoAlbum extends JPanel {
        int i = 1;
        JFrame frame = new JFrame("Photo Album");
        JButton next = new JButton("Next");
        ImageIcon icon = new ImageIcon("../Images/" + i + ".jpg");
        JLabel picture = new JLabel(icon);
        ButtonListener buttonListener = new ButtonListener();
        public PhotoAlbum() {
            frame.setSize(700, 600);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.getContentPane().setLayout(new BorderLayout(5,5));
            frame.getContentPane().add(picture, BorderLayout.CENTER);
            frame.getContentPane().add(next, BorderLayout.SOUTH);
            next.addActionListener(buttonListener);
            frame.setVisible(true);
        class ButtonListener implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                if(e.getSource() == next){
                    ++i;
    }

    WafflesNSyrup wrote:
    int i = 1;
    ImageIcon icon = new ImageIcon("../Images/" + i + ".jpg");
    ++i;
    So I understand that you originally thought incrementing (i) would somehow update (icon) since it uses (i) in an expression. But now you hopefully know this is not a magical expression language.
    I bet you would have also thought that this:
    int x = 1;
    int y = 2;
    int z = x + y;
    x = 42;
    y = 58;would have ended up with z having the value 100? It doesn't. It did the math once, when it executed the expression (x + y) and stored it in the variable (z). So z == 3, regardless of what happens to x or y after the fact.

  • Unhide Photo Albums! Help!

    How can i unhide my photo album after hiding it through the "properties" menu? Can anyone please help me? Thank you

    To unhide a picture try the following:
        * Go into your Media icon, hit the menu button, and choose Explore
        * Navigate to the folder where the pictures are located at
        * Once you're in the folder, hit the menu button, and choose Show Hidden
        * All of the hidden pictures will appear as being dimmed out
        * Once you find the picture, select it, hit the menu button, go into Properties
        * Uncheck the "Hidden" box
    If someone has been helpful please consider giving them kudos by clicking the star to the left of their post.
    Remember to resolve your thread by clicking Accepted Solution.

  • How to create new photo albums

    i've had my iphone 4 for about a week now...and i'm new to this discussion board so i apologize if this topic has been discussed before.
    i have looked at everything i possibly can on my phone and in the users manual. i can't figure out how to create a new photo album!
    help!!!

    thanks for your reply!
    i actually just did that, shortly after i posted my question, i thought i would try it while waiting for a response.
    i sync'ed the photos to my computer. created my folders and put those pictures in them. then resync'ed my phone in itunes and chose the various folders to sync. but the "folders" did not sync back to my phone. everything is still in 'camera roll'.
    i just want the pics in folders on my phone so i can find pictures easier!
    why are there all those spaces under camera roll if it won't let u have more than one folder!? i'm so frustrated! do i have to purchase iphoto or something?

  • Photo album help

    I have a website built in Dreamweaver CS3. I have a photo
    album I have installed but I am looking for other options. It is a
    downloaded shareware program named Sonettic. My website address is:
    http://www.chhstrojans.org/Juniors/web/index.html
    Are there basic Flash photo albums available through Adobe or
    otherwise? This is the first one I've ever done and it is a nice
    program, but there were some problems I did not like. Please help
    if you don't mind.
    Thank you

    Not possible.
    All photos transferred from your computer to your iPhone are stored in your iPhone's Photo Library.
    You can select multiple iPhoto albums to be transferred to your iPhone and all photos available in all albums will be stored in your iPhone's Photo Library.
    This way, you can view the photos that are available in a particular album by selecting the album, or all photos available in all albums by selecting Photo Library.
    The photos are not duplicated. Albums include a pointer only to the original photos that are stored in the iPhone's Photo Library.
    The same with iPhoto on your Mac. All photos are stored in the iPhoto's main library. A photo cannot be available in an album unless it is in the main iPhoto library. Photos in iPhoto albums are not duplicated. They include a pointer to the original stored in iPhoto's main library.
    The applies with iTunes and Playlists, and with the Address Book and Address Book Groups on your Mac.

  • Hi, I need help.  yesterday I copied one of my photo albums from my computer to Ipad 6 , using itunes.  The album was successfully copied but my already few existing photo albums are suddenly empty,  The album title is there but no photos inside.

    Hi
    Need your help. Some of my photo albums are showing as  a blank after copying a photo album from my computer to ipad 6 using itunes.  Can anyone help.,  Those albums were my treasure and i do not have any back of those.

    It's better to post the URL of the feed (as you have subsequently done) than the contents of the feed .
    From the FeedValidator report the feed is basically OK for iTunes. There are several occasions where 'content:encoded' sections (following immediately on 'guid' tags) should be enclosed in
    <description>...</description>
    tags: however all this will be ignored by iTunes anyway and only applies to other readers. The 'potentially dangerous content' referred to by FeedValidator is within the 'content:encoded' tags and so isn't relevant to iTunes. They are referring to an inline css style, and I don't know whether this might cause a problem elsewhere.
    You should really have a language tag, e.g.
    <language>en-us</language>
    (you have a dc:language tag but that's for a different system). This should be placed in the top section, before the first 'item' tag.
    It's advisable to have an 'itunes:explicit' tag for each 'item' -
    <itunes:explicit>yes IF CONTAINS ADULT MATERIAL, OTHERWISE no</itunes:explicit>
    it's not compulsory if you have no adult material, but you must have a 'yes' if you do.
    You can check your feed by subscribing in iTunes from the 'Advanced' menu - this has the same result as clicking the 'Subscribe' button on the Store page. If it works OK there you are ready to submit it.

  • Basic help with photo slideshow?

    Hi
    I am new to adobe after effects and I have recently purchased a file from videohive (http://videohive.net/item/photo-album-v2/44575) which is great.  I am trying to tweak it a little and as I am new to after effects, I would love to ask anyone for some basic help?  I will be leaving the country in 2 weeks to get married and my UK wedding reception will be a week after I return so I am in pretty much a hurry to get a slideshow rendered and put onto dvd to play in the reception.  I have mastered how to render in PAL format and get onto DVD but I am having a little trouble with basic elements such as adding keyframes.
    The file has 13 placeholders which I have replaced with my own photos. Two of which are replaced with avi videos instead of jpg. This works fine but I would like to stop the camera movement on say photo 7 and zoom in a little on the video, play the video (approx 40 seconds) then return the photo back in place and resume your camera movement.  This will be repeated for one other photo (photo 9) where the video is approx 60 seconds.  Could you possibly help me how I can do this?  I am also adding music to play throughout from start to finish and I would also like to pause (or fade volume) whilst the avi video placeholder is playing, then resume after playback.  I know this may sound a lot to ask but I know that with the knowledge - it will only take me about 30 mins work once I know what to do.  Any help you can offer will be fantastic. I am proficient with Adobe Flash so I understand the jargon of timelines etc.
    Thank you for any help anyone could provide in my panic to get complete.
    Best regards
    Sean.

    *woohoo* Here's to the ones daring marriage... For your  problems there is a number of ways to tackle them, but the specific solution may depend on how the template works. As David already said, for audio you'd be better off using Premiere, but assuming you have just a single track that realyl only requires fades, AE should serve your needs. You can reveal the audio volume by tapping the L key when the respective layer in your composition is selected, then enable the stopwatch icon to add keyframes. Layers can be trimmed by simply dragging their ends, duplicated with Ctrl+D and split by using Ctrl+Shift+D, so it should be perfectly possible to extend your audio as needed, assuming you increase the comp duration first via the composition options. For the images to come into view, you could simply scale them up. Of course the project is based on 3D layers, so it would look a lot better if you animated the camera to dolly in, but if you have no experience in AE, that may make more of a mess than it's worth. Therefore I simply recommend you create a photo flash/ film burn transition - add a  white solid with a slight color tint, set it's blending mode to add, animate it's opacity and while it's fading out, fade in your full screen video. If done in 32bpc, this can look quite real and since it's a separate effect, it won't interfere with the rest of the animation.
    Mylenium

  • Trying to scan photos from my photo album to a folder on my desktop.  Have been trying to figure out for over an hour.  Seems very complicated and cumbersome,  Can you help?

    Trying to scan photos from my photo album to a folder on my desktop.  Have been trying to figure out for hours.  Seems very complicated and cumbersome.  Can anyone help?  It's got to be much quicker (fewer key strokes) and simpler than what I've been able to discover.

    Open the file, parse it, populate an ArrayCollection or XMLListCollection, and make the collection the DataGrid dataProvider:
    http://livedocs.adobe.com/flex/3/html/help.html?content=Filesystem_08.html
    http://livedocs.adobe.com/flex/3/html/help.html?content=12_Using_Regular_Expressions_01.ht ml
    http://livedocs.adobe.com/flex/3/html/help.html?content=dpcontrols_6.html
    http://livedocs.adobe.com/flex/3/langref/mx/collections/ArrayCollection.html
    http://livedocs.adobe.com/flex/3/langref/mx/collections/XMLListCollection.html
    If this post answered your question or helped, please mark it as such.

  • Can't select any photos in camera roll or photo album... help!

    I have a iphone 3Gs on 4.2.1
    If I go to my camera roll or any photo album, I can enter but if I select an image in the camera roll or photo album it just automatically closes and goes back to the home screen. Hard reboot, reboot is still the same.
    Any suggestions as to the cause?
    Thanks in advance!

    I am having the same thing as well. I click the photos app, I try view the photos I have taken, it just closed out of the photos app and goes straight back to the home screen. There is another way to see the photos you have taken. You click on the camera, then you click on the photos on the bottom left corner, it works for me. I can see all the pictures I have taken.
    I've been having problems with my camera, whenever I take a picture (with/without flash) my photos turn out black, was wondering if anyone can help us out about this problem.

  • How do I delete photo ALBUMS from my iPHONE 4? I sync via icloud and I can not see any folders selected in itunes. I searched the internet and basically there is no one who has the answer to how you delete the iphone photo library and misc albums

    how do I delete photo ALBUMS from my iPHONE 4?
    I sync via icloud and I can not see any folders selected in itunes.
    I searched the internet and basically there is no one who has the answer (so far)
    to how you delete the iphone photo library and misc albums
    I have also had every iphone and I am not stupid.
    charles altman

    Replying to my own post - heh. I downloaded iExplorer (http://www.macroplant.com/iexplorer/) which allowed me access to the files on the phone and there was the phantom movie in the DCIM folder. Deleted it, and all is well - although I still have 0.65gb of Other in iTunes.....

  • I'm using 3gs, after updating the OS with 6.1.3 version lost all my photo albums unable to retrieve through Itunes kindly help me in this regard.

    Hi There,
    A month ago I had 3gs with 4.1 OS version and I synced all my photo albums from my old laptop as I have planned to sell it off.
    I sold my old laptop and accidentally kids at my home have pressed reset button and my phone got locked, now I got my phone permanently unlocked with a vendor and updated my OS to 6.1.3 version, thinking that my photo can synced again when I connect to Itunes, I bought my new laptop installed Itunes authorised it, it was able to restore my camera roll pics but not my album.
    Please help me in restoring my lost album.
    Thanking in Advance.

    I'm sorry, but unless you hace a backup of your pics somewhere, they are gone. Photos synced to your phone are not part of an iPhone backup, & the photo sync is one-way: Computer to Phone. When you synced to a different computer, these photos were erased from your phone...by design, iPhone syncs iTunes content with one computer at a time.
    Sorry, there is no way to recover this data.

  • I am trying to remove a Photo Album from IPad 4 with no success can you help please?

    I am trying to remove a photo album from my new IPad 4, I have tried several things, connected the IPad to computer etc but with no success. Can you help please?

    The links below have instructions for deleting photos.
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    iPad Tip: How to Delete Photos from Your iPad in the Photos App
    http://ipadacademy.com/2011/08/ipad-tip-how-to-delete-photos-from-your-ipad-in-t he-photos-app
    Another Way to Quickly Delete Photos from Your iPad (Mac Only)
    http://ipadacademy.com/2011/09/another-way-to-quickly-delete-photos-from-your-ip ad-mac-only
    How to Delete Photos from iPad
    http://www.wondershare.com/apple-idevice/how-to-delete-photos-from-ipad.html
    iPhoto for iOS (iPad): Delete photos from iPhoto
    http://support.apple.com/kb/ph3137
    How to: Batch Delete Photos on the iPad
    http://www.lifeisaprayer.com/blog/2010/how-batch-delete-photos-ipad
    (With iOS 5.1, use 2 fingers)
    How to Delete Photos from iCloud’s Photo Stream
    http://www.cultofmac.com/124235/how-to-delete-photos-from-iclouds-photo-stream/
     Cheers, Tom

  • Need help editing scanned images of old photo album pages PSE 9

    Before I begin this project, I thought I'd get some advice from someone who has undertaken a similar project.  I have three photo albums from the 50's and 60's.  The albums were made by my mother who mounted the photos (mostly black and white but some color photos) on construction paper (of various colors) using the corner holders or glue.  She hand cut the construction paper so each page is not a perfect rectangle ( about 11" tall, 8.5" wide).  The pages were punched and put into a three-ring binder. 
    She added text to the edge of the photo and/or to the construction paper.  Each page contains one to 6 photos and text.  Each album has about 120 pages.  I want to keep the notes on the construction paper so I scanned each page into a TIF files, 400 dpi and stored the images in a separate folder for each volume. 
    I use (poorly) PSE 9.  I see it has a auto straighten/crop feature that can be used one photo at a time.  I tried the divide scanned images function and that did not fully separate all images on the page and also created an image for stray objects on the page such as an unused corner holder.  (I know those things have a better name but it escapes me now.) 
    I plan to create photo books for my siblings.  I am now thinking of cropping the image of each page (rather than each photo on the page) into a uniform size, adjusting levels, contrast and sharpness, saving this image to a JPEG file, and using these edited JPEG images to create the photo book.  Since each page was hand-cut, there will areas of white where one page was torn or cut smaller than another page.  Some pages will have blanks where old photos have been lost leaving behind only the corner things.  It won't be perfect but it will be an image of the album as it exists today. 
    My questions are: 
    The pages are about 11 by 8.5.  Does anyone know a photo service that prints photo albums in a portrait layout in this size?  I  have been unable to find one; it looks like most online photo books are wider rather than taller. 
    Let's assume I use a company such as Shutterfly that offers a 12x12 format.  I assume it would be better to edit the images in PSE9 rather than any online software.  What should I do to keep the proportions in the current images true but make the image fit a 12x12 page, for example? 
    IS there any other editing software anyone can recommend that will speed this up, hopefully a software that would take multiple photos at one time, auto-straighten and auto crop to a set size?  And also auto contrast/level/sharp.  If I could use such auto features on these images and then go back and adjust the photos that did not play well with the auto features, that would save me time. 
    I appreciate anyone's input.  I dread doing this but we have one set of photos and 5 siblings so it has to be done.  Thanks!

    Hi,
    Mentioning your issues one by one:
    1) PSE does not have any portrait Photobook available, so your thought was the best way to get the work done is by choosing the 12x12 - shutterfly one.
    2) PSe does a good job of editing the images. You can set your images of approx. 11x8  size to fit to the 12x12 page. Just choose a one photo page Layout for the page and then right click on the image to " Fit photo in the frame".
    3) If more edits are required for the image, you can easily go to Advanced mode and edit your photos, layouts, move the frames, images or add effects to the images.
    4) Photo book creation sure takes time. because, you want it to be the best. I am sure PSE would help you best here.
    Go ahead and create you photobook. Inc ase you get stuck somewhere, you can always post here to get help!
    Cheers,
    Swarnima

  • Photo albums in front row help

    Hi,
    I am having trouble getting my photo albums to play via front row. I have numerous albums but when i go into them in front row, it just shows up random photos from the album and roll they came from, with none of the album pages showing. The photo roll and the name of the albums is the same ie: roll called sweden, album called sweden, would that be causing a problem, ie: iphoto unsure of which photos to show? They play fine in iphoto, with all of the album pages showing, but not in front row.
    Any help would be greatly appreciated as I am getting a little frusterated!!
    Thanks,
    Mel

    Heya Brendt,
    Is the video within iTunes or just in your movies folder?
    If it is not iTunes then ignore the "itunes" portion below.
    Remove the following files to the trash (do not empty until you test for function):
    ~/library/caches
    ~/library/preferences/com.apple.itunes.plist
    ~/library/preferences/com.apple.frontrow.plist
    - Repair your permissions - > http://docs.info.apple.com/article.html?path=DiskUtility/10.5/en/duh17.html
    - Restart your computer again
    - Test and see how its working
    Hope that helps!

  • I need help buying iPhoto photo album.

    I need help buying iPhoto  photo album. iPhoto was built in to my iMac. I am supposed to be able to make picture albums using my photos. It won't let me purchase the photo album i just made. I can't find any kind of help anywhere. Please help

    If you have iPhoto '08 or older it is no longer supported for print products
    If you have iPhoto '09 or '11 reboot, launch iphoto and
    Before ordering your book preview it using this method - http://support.apple.com/kb/HT1040 - and save the resulting PDF for reference - the delivered book will match it.
    If the preview s good and you can not order boot into safe mode, preview again and order
    LN

Maybe you are looking for

  • How to merge multiple documents via command line (Adobe Acrobat Pro 9.3.2)?

    I'm searching solutions to merge multiple documents (all stored in one folder) via command line or batch file to a single PDF-File... Is there a way to do this? Finaly I want to control this from a application written in MS-Access. So, perhaps there

  • Rollup/Cube Operation in Oracle 10g

    I'm using Oracle 10g as my database. Suppose I have a table that has data: ID SEMESTER SUBJECT MARKS 9 4 Maths 50 9 4 Science 45 9 4 English 42 10 5 Maths 56 10 5 History 23 Now the output should look like this ID SEMESTER SUBJECT MARKS RANK 9 4 Math

  • How to change the layout of alv-urgent

    hi friends, my requirement is  User should be able to sort the data on fields in different order, should be able to select the fields to sort the data for example iam displaying the sales order,sales group,kunnr,amount in ALV List Display now when ia

  • SQL Server driver problem

    I am trying to connect to SQL Server 2000. I have JDK1.3.1_02. When I compile my applet I get the error that class sqlserver from the statement "Class.forName(com.microsoft.jdbc.sqlserver.SQLServerDriver);" not found. I have included the path in my c

  • 1z0-599 Oracle weblogic server 12c Essentials

    Hello there, Can some please answer below questions. I found these practice questions over internet and I am so confused with the questions as i don't know correct answers. Please answer them if you know any. Thanks You completed the development of a