My Preview is open all my pics at time instead of open one by one. It occurs when I try to open any type of JPEG file. That's strange and I'm a new macbook user. I hope somebody can help me out. Thanks

My Preview opens all my pics at time instead of open one by one. It occurs when I open any JPG FILE. What should I do to fix it? Thanks

First use JPanel not Panel.
Panel panels[]=new Panel[4];becomes
JPanel panels[]=new JPanel[4];Then refactor your code so that you use arrays correctly:
panels=new Panel();
panels.setLayout(new FlowLayout(FlowLayout.LEFT));becomes
panels=new JPanel();
panels[i].setLayout(new FlowLayout(FlowLayout.LEFT));
I did the above changes to your code and it worked fine.
Dave

Similar Messages

  • I'M NEW TO THIS, i hope someone can help me out with something so simple...

    Hello all
    i'm a first time user with java...my editor is Visual J++ (trial ed)...i'm testing out java to see if i want to use this for my company. for the past 4 days i've been trying to figure out how to connect to a database (i'm using MS SQL SERVER 2K) i've already posted in the JDBC Fourm...but found no answer...I apologize if I'm posting in 2 different forums at same time...but you gotta feel me on this, over 4 days on just trying to connect is not healthy LOL....
    I already downloaded the driver from MS. Installed it followed the user guide (acrobat pdf file) on how to implement it...but i'm still stuck and haven't reached no where....what i want to do is a simple select statement but i can't do that without connecting first....maybe one of you out there has a sample code who uses MS SQL SERVER 2K...or someone can just be a miracle and help out on my code....the code will be attached below
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    public class AccessApp extends Frame
         TextField driver = new TextField(80);
         TextField url = new TextField(80);
         TextField sql = new TextField(80);
         Button doIt = new Button("Do it!");
         TextArea resultArea = new TextArea(10,60);
         public static void main(String args[])
              AccessApp app = new AccessApp();
         public AccessApp()
              super("AccessApp");
              setup();
              pack();
              addWindowListener(new WindowEventHandler());
              show();
         void setup()
              setupMenuBar();
              setLayout(new GridLayout(2,1));
              Panel topPanel = new Panel();
              topPanel.setLayout(new GridLayout(4,1));
              Panel panels[]=new Panel[4];
              for(int i=0;i<panels.length;++i)
                   panels=new Panel();
                   panels[i].setLayout(new FlowLayout(FlowLayout.LEFT));
              panels[0].add(new Label("Driver:"));
              panels[0].add(driver);
              panels[1].add(new Label("URL: "));
              panels[1].add(url);
              panels[2].add(new Label("SQL: "));
              panels[2].add(sql);
              doIt.addActionListener(new ButtonHandler());
              panels[3].add(doIt);
              for(int i=0; i<panels.length; ++i)
                   topPanel.add(panels[i]);
              add(topPanel);
              add(resultArea);
         void setupMenuBar()
              MenuBar menuBar = new MenuBar();
              Menu fileMenu = new Menu("File");
              MenuItem fileExit = new MenuItem("Exit");
              fileExit.addActionListener(new MenuItemHandler());
              fileMenu.add(fileExit);
              menuBar.add(fileMenu);
              setMenuBar(menuBar);
         void accessDB()
              try
                   Class.forName(driver.getText()).newInstance();
                   Connection connection=DriverManager.getConnection(url.getText());
                   Statement statement = connection.createStatement();
                   boolean hasResults = statement.execute(sql.getText());
                   if(hasResults)
                        ResultSet result = statement.getResultSet();
                        if(result!=null) displayResults(result);
                   else resultArea.setText("");
                   connection.close();
              catch(Exception ex)
                   resultArea.setText(ex.toString());
         void displayResults(ResultSet r) throws SQLException
              ResultSetMetaData rmeta = r.getMetaData();
              int numColumns=rmeta.getColumnCount();
              String text="";
              for(int i=1; i<=numColumns; ++i)
                   if(i<numColumns)
                        text+=rmeta.getColumnName(i)+" | ";
                   else
                        text+=rmeta.getColumnName(i);
              text+="\n";
              while(r.next())
                   for(int i=1;i<=numColumns;++i)
                        if(i<numColumns)
                             text+=r.getString(i)+" | ";
                        else
                             text+=r.getString(i).trim();
                   text+="\n";
              resultArea.setText(text);
         class ButtonHandler implements ActionListener
              public void actionPerformed(ActionEvent ev)
                   String s=ev.getActionCommand();
                   if(s=="Do it!") accessDB();
         class MenuItemHandler implements ActionListener
              public void actionPerformed(ActionEvent ev)
                   String s=ev.getActionCommand();
                   if(s=="Exit")
                        System.exit(0);
         class WindowEventHandler extends WindowAdapter
              public void windowClosing(WindowEvent e)
                   System.exit(0);
    I hope this helps
    and hopefully someone will respond

    First use JPanel not Panel.
    Panel panels[]=new Panel[4];becomes
    JPanel panels[]=new JPanel[4];Then refactor your code so that you use arrays correctly:
    panels=new Panel();
    panels.setLayout(new FlowLayout(FlowLayout.LEFT));becomes
    panels=new JPanel();
    panels[i].setLayout(new FlowLayout(FlowLayout.LEFT));
    I did the above changes to your code and it worked fine.
    Dave

  • Hi hope somebody can help? i have acrobat 6 pro, worked well for last two years but then just stopped working. Have reinstalled but still will not open, ronning windows 7. Help please!!

    Hi hope somebody can help? i have acrobat 6 pro, worked well for last two years but then just stopped working. Have reinstalled but still will not open, ronning windows 7. Help please!!  Janice

    Hey janicem42177174,
    Adobe no longer supports the installation and use of Acrobat 6 as it is a very old version which is not compatible with Windows 7.
    I would suggest you to please use the latest version of Acrobat i.e. 11.0.10 which is fully compatible with your OS with its enhanced features and functions.
    You might download a free 30-day trial version of Acrobat from here:
    Download Adobe Acrobat free trial | Acrobat XI Professional
    Let me know how it goes
    Regards,
    Anubha

  • Im new to java and hope somebody can help me with my question

    Hi!
    Im quite new to java and I just have some simple questions..
    can someone please tell what kinds of error are considered as language violation for java? where can I find more info about these errors?
    can someone give me a simple example on a kind of error that cannot be caught in both compilation and runtime? I hope someone can help me out. Thanks in advance!!

    knightz211 wrote:
    Im just asking about errors that might go against the language definition but cant be detected.. If it "goes against the language defintion," it will be detected by the compiler. That's half of the compiler's job is to tell you what you've done that violates the language spec.
    because it confuses me when they say that such errors might occur so I just want to know what might these errors be.. sorry for that..Who's "they"? What exactly* did "they" say about "such errors"? It sounds to me like you're just confused, and you think there's something mysterious and inexplicable going on but you don't know what and don't even know what you're asking.
    I would suggest not worrying about hypothetical problems that you can't even put into words and focussing on learning Java. Along the way, if you encounter real, specific, actual problems, ask about them, and you'll probably get answers about the problems themselves and the language or theory behind them.

  • Hi I hope somebody can help me.

    i had an iphone which was locked to 3 network in UK. after unlocking through network provider, i gave it to my brother to use in india. But unfortunately its not picking up any network availiable in india. When i checked in internet it shows that the phone is unlocked; but the problem persists. he has all the network sims availiabe in my state. I hope somebody can get me out of this trouble..

    Could well be that the phone was not unlocked.  I would contact 3 http://www.three.co.uk/Store/Phones/iPhone
    Failing that you could contact Apple and ask them if the phone has been unlocked
    https://expresslane.apple.com/Issues.action

  • Hi all, i am trying to install Xcode 3.2.5 & Xcode 4.2 in iMac (Mac OS X 10.6.8) , I am getting error message as "Installation Failed". somebody can help me. Thanks in advance.

    Hi all,
               I am trying to install Xcode 3.2.5 & Xcode 4.2 in iMac (Mac OS X 10.6.8) , I am getting error message as "Installation Failed". somebody can help me. Thanks in advance.

    I too have the same error while installing  xcode 4.2 in Mac os x 10.6.8.
    Can any one solve this issue.

  • TS3367 Hi, the FaceTime just did not work between my mom and I. It used to work weeks ago, but now it does not work after showing"connecting". I feel frustrated and try all the method I can think of. Still do not work. Hope u can help me. Thanks!

    Hi, the FaceTime just did not work between my mom and I. It used to work weeks ago, but now it does not work after showing"connecting". I feel frustrated and try all the method I can think of. Still do not work. Hope u can help me. Thanks!

    Was it just this one time?  Could be that you, or your mom, were experiencing network problems.  Try again at a later time.

  • I have several issues that I hope you can help me out with. I am a professional photographer with a Mac with OS X 10.9.4: - I can only make ONE contact sheet in CS6 (from AUTOMATE) from pictures indicated in Bridge. If I want to make another contact sheet

    I have several issues that I hope you can help me out with. I am a professional photographer with a Mac with OS X 10.9.4:
    - I can only make ONE contact sheet in CS6 (from AUTOMATE) from pictures indicated in Bridge. If I want to make another contact sheet I need to shut down and restart CS6.
    - Camera RAW: if I change any setting in Camera RAW (except exposure), having first optimized the exposure, the exposure will automatically return to zero. Sometimes when I've set exposure and cropped the picture in Camera RAW Plug-In, the effects are lost just by opening the picture in CS6.
    - Sometimes if I crop a picture in Camera RAW, it may be impossible to open it again from Bridge!
    - I cannot do lens corrections in Camera RAW, at all. The Camera RAW comment is that "it cannot load the correct lens type". Why?

    Are you writing that when you select  a large number of images in the bridge  like a hundred thumbnails  when you then use Bridge menu Tools>Photoshop>Contact Sheet II that Photoshop only produces a single contact sheet for the first few thumbnails and fails to produce additional contact sheets for the other selected thumbnails? Photoshop contact sheet II script should create as many contact sheet as needed  for the numbers of thumbnails selected.  Perhaps the script is hung or you have exhausted  your machine resources.
    ACR Crop tool does not crop the RAW file it records crop settings to be used during the conversion process.    Camera RAW DATA is not altered.  The only changes made to RAW Files is ACR Metadata may be added.  Anything you do in ACR can be un-done in ACR.    If you can not open a RAW File in ACR the Files is either corrupt or from a new camera ACR does not support yet.  ACR should not corrupt RAW files.
    If you do not have a lens profile for ACR I think you should still be able to do lens correction manually in ACR.
    Some of what you write I don't follow could you post some screen captures of your problems often a picture helps.

  • When I try to import a folder of jpeg files into iPhoto, only some are imported. I get the message "The following files could not be imported. (The file is in an unrecognized format.)" I am running iPhoto '09 ver. 8.1.2 on OSX 10.5.8. They are all RGB.

    When I try to import a folder of jpeg files into iPhoto, only some are imported. I get the message "The following files could not be imported. (The file is in an unrecognized format.)" I am running iPhoto '09 ver. 8.1.2 on OSX 10.5.8. They are all RGB.

    As a Test:
    Hold down the option (or alt) key and launch iPhoto. From the resulting menu select 'Create Library'
    Import a few pics into this new, blank library. Is the Problem repeated there?

  • Hello. Where can I see what I am paying for, on my Mastercard. I can see many transactions but I don´t know what it is. I really hope you can help me. Thanks Helle Harling

    Hello.
    Where can I see what I am paying for, on my Mastercard. I can see many transactions but I don´t know what it is. I really hope you can help me.
    Thanks Helle Harling

    Hello again.
    I have looked in my account, but can´t see all of the charges - I wonder if my daughter are using her iphone to something she dont know are cost money - but it´s over 500 dkr, so i really want to find out. Thanks
    Helle

  • HT3775 hello guys, i m just wondering that which software would be the best for my macbook pro. whenever i try to open those video, it says '(video name)avi' cant open. that will be appreciable if anyone can help me out. thanks.

    hello guys, i m just wondering that which software would be the best for my macbook pro. whenever i try to open those video, it says '(video name)avi' cant open. that will be appreciable if anyone can help me out. thanks.

    I think that VLC Media Player will play avi files.
    Regards,
    Clinton

  • My old laptop crashed and I need to restore my iTunes music and movies to my new laptop from my iPod Touch. Help please. Thanks!

    My old laptop crashed and I need to restore my iTunes music and movies to my new laptop from my iPod Touch. Help please. Thanks!

    See:
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities

  • Emails archive instead of deleting. how do i stop this and where are these archived emails held? hope you can help

    My ipod touch has just started to archive my emails rather than delete them.  Is this the same thing? If not how can I get it back to normaland just delete unwanted emails at my request? hope someone can help, thanks and kind regards, Jane (france)

    This previous discussion may help:
    https://discussions.apple.com/message/17052802#17052802

  • I am looking for a webcam that will plugin and work on my new MacBook Pro running Yosemite?

    Just got my new MacBook pro and wanted to plug in my external Logitec Pro 4000 webcam...but it does not appear on any options to use.
    So I guess its time to upgrade it... but I can't find ANYWHERE what webcams will plug and play on the MacBook Pro (3/2015 model) running the latest version of Yosemite (10.10.2)
    I would LOVE to not have to buy a new camera...but i can't seem to find any other solution.  So ideas?  
    Gary

    It should plug into one of your USB ports.
    If you want a newer external camera, some compatible ones are listed in http://www.mac-compatible-web-cam.com/
    Message was edited by: EZ Jim
    Mac OSX 10.10.2

  • Form won't distribute. Here's the error and everything I've tried so far. Hope you can help

    I've seen at least 2 similar posts on the web, but they ended with no answer. After creating my form with LiveCycle Designer, saving as pdf, and hitting "DISTRIBUTE", I get this error:
    "The filename you specified is not valid because it does not include a .pdf extension, contains one or more invalid characters, or the path preceding it refers to a protected system location."
    So I've done all of the following, many of which were recommended in the other 2 posts, but similarly, have reached a dead-end. Distribute still doesn't work, so I can't use my form:
    I tried checking and unchecking the "hide extensions for known file types".
    I tried resaving the pdf with a simple one word name, no special characters, a word like hello.
    I tried moving the pdf and saving to C:\   root.
    There are no errors on the form.
    Why am I getting this error? I put a lot of work into the form, so am eager to start using it, but I can't really use it properly until I get past this Distribute step. I don't mind posting the form so someone can take a look at it and please help me. Thanks.

    FOR ANYONE WHO HAS THE SAME PROBLEM
    I FOUND THE "PROBLEM". IT'S SIMPLE:
    The file was just too deep within a path (folder inside a folder etc). All you have to do is move/copy the form/pdf to your desktop, then open it and hit Distribute. You will no longer get that error.
    Hope that helps.

Maybe you are looking for