// Create the cboSelectGroup, and add it to the navigation panel:
        //String[] strDefaults = {"Defaults"};
        //cboSelectGroup = new JComboBox(strDefaults);Public Class Form1

        cboSelectGroup.setPreferredSize(new Dimension(150, 40));
        cboSelectGroup.setMinimumSize(new Dimension(150, 40));

        cboSelectGroup.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent evt) {

                btnImagesActionPerformed(evt);

            }

        });

Recommended Answers

All 2 Replies

Please explain what you are trying to do in more detail.

We were trying to create a file with an image after pressing a save button. We recently fixed it.

        // Convert path to string...
        String src = baseDir + "/" + newDir;

        // Create new file...
        File javaFilePath = new File(src, "/" + lblCaption.getText() + ".png");
        File oldImage = new File(imageFilename);

        if (! javaFilePath.exists()){

            FileChannel copyFile = new FileInputStream(oldImage).getChannel();
            FileChannel dest = new FileOutputStream(javaFilePath).getChannel();
            dest.transferFrom(copyFile, 0, copyFile.size());
            JOptionPane.showMessageDialog(null, "Folder/Category, Image and Caption saved!!!");

        } // End if() {}...
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.