Import bitmap into an array

I want to import a 24-bit bitmap image into an array so I can loop through the array and perform calculations based on the color of the pixels etc.
Can any one advise me of an easy way to do this in Java?
Thanks

I want to import a 24-bit bitmap image into an array so I can loop through the array and perform calculations based on the color of the pixels etc. java.​awt.​image.​BufferedImage:
public int[] getRGB(int arg0, int arg1, int arg2, int arg3, int[] arg4, int arg5, int arg6)
it works for jpeg and png, dont know about bmp.........
See this link:
[http://java.sun.com/j2se/1.5.0/docs/api/java/awt/image/BufferedImage.html]

Similar Messages

  • Problems importing Bitmaps into Editing Workspace

    Hello, I Hope someone can help me.
    I am using Photoshop Elements 6 and I have captured literally hundreds of BMP Files from a home made video.
    I am trying to produce a number of animated sequences by removing the background to leave the subject matter which I then intend to overlay onto a new background in a series of frames.
    The Problem I am having is that when I try to view the image in the Editing Workspace, the image resolution is distorted and stretched out horizontally!
    The original file is 640 X 480 Pixels and around 900Kb. I am using Windows XP SP2 with 512MB Ram and 3.06Ghz Pentium 4.
    I can view the thumbnails in the organiser OK but for some reason when I go to edit it appears as a thin line across the editing workspace at 1%. When I have tried to edit the Image Size it is showing the Document Size as being 0.18cm Wide by 0.14cm High with a resolution of 8902.125 !!!!pixels/inch when it should be about 72?
    I have imported one of the BMP files into Fireworks and exported it as a PNG then edited it in PE with no problem.
    I can also import JPEG files directly into PE and edit without any problems.
    I have just spent over a hour on the phone to Adobe Technical Support who could not help me.
    I have un-installed and re-installed and it has not solved the problem.
    Has anybody got any ideas please so I do not have to re-save every file as a PNG or do you know of an alternative method of producing the animation?

    Are you saying that the problem is with BMP files only?
    Did you tried to edit the same file in other editors like Photoshop or any other??
    Try to crop the same file in Organizer, if it works reset editor preferences and try again...
    + Ripple (VJ)

  • Losing data when importing excel into an array

    Hi,
    I have been writing some code that imports data from an excel .xlsx worksheet file containing 890 columns and 150 rows.
    When I set the VI to import 702 columns everything works fine.  When I try to import 703 columns I get no data in my array.  The VI continues to run without any errors just gives me no results as there is no data in the initial array.
    Can anyone tell me if there is a setting somewhere Im missing or explain why this is happening as I have read that there should be no limit to the amount of columns you have as long as you have less than 2^32 elements which I am well below.  I am using a Labview 2009 and a PC with windows7 64bit and 4G RAM so there should be no problem with PC resources.
    Thanks,
    Ray.

    Hi Ray,
    702 is the limit when you use just 2 chars for the column name: "A" to "ZZ" allows for 702 columns.
    Probably a subVI somewhere deep in your Excel loading routine is limited for that naming scheme (or is only aware of  older Excel versions)...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Reading from file into an array

    Hello, new to Java and we need to modify a mortgage calculator to read interest rate from a file into an array and not have them hard coded in the program. I have read many post on how to perform this but am lost on where to put the new code and format. Here is my code and I hope I posted this right.
    import javax.swing.*;                                              // Imports the Main Swing Package                                   
    import javax.swing.event.*;
    import javax.swing.text.*;                                          // Used for  Text Box Caret Position
    import java.awt.*;                                                // Imports the main AWT Package
    import java.awt.event.*;                                         // Event handling class are defined here
    import java.text.NumberFormat;
    import java.text.*;                                              // Imports the Main Text Package
    import java.util.*;                                              // Imports the Main Utility Package
    public class mortgageCalculator1 extends JFrame implements ActionListener             // Creates class mortgageCalculator
        JLabel AmountLabel = new JLabel("   Enter Mortgage Amount:$ ");                   // Declares Mortgage Amount Label
        JTextField mortgageAmount = new JTextField(10);                                     // Declares Mortgage Amount Text Field
        JButton IntandTerm1B = new JButton("7 years at 5.35%");                    // Declares 1st Mortgage Term and Interest Rate
        JButton IntandTerm2B = new JButton("15 years at 5.50%");                    // Declares 2nd Mortgage Term and Interest Rate
        JButton IntandTerm3B = new JButton("30 years at 5.75%");                    // Declares 3rd Mortgage Term and Interest Rate
        JLabel PaymentLabel = new JLabel("   Monthly Payment: ");                     // Declares Monthly Payment Label
        JTextField monthlyPayment = new JTextField(10);                          // Declares Monthly Payment Text Field
        JButton exitButton = new JButton("Exit");                              // Declares Exit Button
        JButton newcalcButton = new JButton("New Calculation");                     // Declares New Calculation Button
        JTextArea mortgageTable = new JTextArea(35,65);                         // Declares Mortgage Table Area
        JScrollPane scroll = new JScrollPane(mortgageTable);                         // Declares ScrollPane and puts the Mortgage Table inside
        public mortgageCalculator1()                                        // Creates Method
             super("MORTGAGE CALCULATOR");                              // Title of Frame
             JMenuBar mb = new JMenuBar();                                   // Cretes Menu Bar
                JMenu fileMenu = new JMenu("File");                                 // Creates File Menu
             fileMenu.setMnemonic('F');                                      // Enables alt + f to Access File Menu
             JMenuItem exitItem = new JMenuItem("Exit");                     // Creates Exit in File Menu
             fileMenu.add(exitItem);                                   // Adds Exit to File Menu
                 exitItem.addActionListener(new ActionListener()                     // Adds Action Listener to the Exit Item
                     public void actionPerformed(ActionEvent e)                     // Tests to Verify if File->Exit is Pressed
                         System.exit(0);                                // Exits the Programs when File->Exit is Pressed
                mb.add(fileMenu);                                      // Adds the File Menu
                setJMenuBar(mb);                              
         setSize(600, 400);                                        // Sets Size of Frame
            setLocation(200,200);                                         // Sets the Location of the Window  
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);                                  // Command on how to close frame
         JPanel pane = new JPanel();                                   // Declares the JPanel
         pane.setLayout(new BoxLayout(pane, BoxLayout.Y_AXIS));                          // Sets Panel Layout to BoxLayout
         Container grid = getContentPane();                               // Declares a Container called grid
         grid.setLayout(new GridLayout(4,3,5,5));                          // Sets grid Layout to GridLayout
         pane.add(grid);                                             // Adds the grid to the Panel
         pane.add(scroll);                                        // Addes the scrollPane to the Panel
            grid.setBackground(Color.yellow);                              // Set grid color to Yellow
         setCursor(new Cursor(Cursor.HAND_CURSOR));                         // Makes the cursor look like a hand
         mortgageAmount.setBackground(Color.black);                         // Sets mortgageAmount JPanel JTextField Background Color
            mortgageAmount.setForeground(Color.white);                         // Sets mortgageAmount JPanel JTextField Foreground Color
         mortgageAmount.setCaretColor(Color.white);                         // Sets mortgageAmount JPanel JTextField Caret Color
         mortgageAmount.setFont(new Font("Lucida Sans Typewriter", Font.PLAIN, 18));     // Sets mortgageAmount JPanel JTextField Font
         monthlyPayment.setBackground(Color.black);                         // Sets monthlyPayment JPanel JTextField Background Color
         monthlyPayment.setForeground(Color.white);                         // Sets monthlyPayment JPanel JTextField Foreground Color
            monthlyPayment.setFont(new Font("Lucida Sans Typewriter", Font.PLAIN, 18));     // Sets monthlyPayment JPanel JTextField Font
         mortgageTable.setBackground(Color.yellow);                         // Sets mortgageTable JTextArea Background Color
         mortgageTable.setForeground(Color.black);                         // Sets mortgageTable JTextArea Foreground Color
         mortgageTable.setFont(new Font("Arial", Font.PLAIN, 18));               // Sets JTextArea Font
         grid.add(AmountLabel);                                        // Adds the Mortgage Amount Label
         grid.add(mortgageAmount);                                   // Adds the Mortgage Amount Text Field
         grid.add(IntandTerm1B);                                        // Adds 1st Loan and Rate Button
         grid.add(PaymentLabel);                                    // Adds the Payment Label
         grid.add(monthlyPayment);                                    // Adds the Monthly Payment Text Field
           monthlyPayment.setEditable(false);                              // Disables editing in this Text Field
            grid.add(IntandTerm2B);                                        // Adds 2nd Loan and Rate Button
            grid.add(exitButton);
         grid.add(newcalcButton);                                    // Adds the New Calc Button
            grid.add(IntandTerm3B);                                        // Adds the Exit Button
         setContentPane(pane);                                          // Enables the Content Pane
         setVisible(true);                                          // Sets JPanel to be Visable
         exitButton.addActionListener(this);                                // Adds Action Listener to the Exit Button
         newcalcButton.addActionListener(this);                            // Adds Action Listener to the New Calc Button
            IntandTerm1B.addActionListener(this);                              // Adds Action Listener to the 1st loan Button
         IntandTerm2B.addActionListener(this);                              // Adds Action Listener to the 2nd loan Button
         IntandTerm3B.addActionListener(this);                               // Adds Action Listener to the 3rd loan Button
         mortgageAmount.addActionListener(this);                              // Adds Action Listener to the Mortgage  Amount Text Field
         monthlyPayment.addActionListener(this);                              // Adds Action Listener to the Monthly payment Text Field
        public void actionPerformed(ActionEvent e)                               // Tests to Verify Which Button is Pressed
            Object command = e.getSource();                                                 // Enables command to get data
            if (command == exitButton) //sets exitButton                         // Activates the Exit Button
                System.exit(0);  // Exits from exit button                         // Exits from exit button
            int loanTerm = 0;                                             // Declares loanTerm
            if (command == IntandTerm1B)                                   // Activates the 1st Loan Button
                loanTerm = 0;                                        // Sets 1st value of Array
            if (command == IntandTerm2B)                                   // Activates the 2nd Loan Button
                loanTerm = 1;                                        // Sets 2nd value of Array
            if (command == IntandTerm3B)                                   // Activates the 3rd Loan Button
             loanTerm = 2;                                        // Sets 3rd value of Array
                double mortgage = 0;                                   // Declares and Initializes mortgage
             double rate = 0;                                        // Declares and Initializes rate                                        
             double [][] loans = {{7, 5.35}, {15, 5.50}, {30, 5.75},};                 // Array Data for Calculation
                    try
                        mortgage = Double.parseDouble(mortgageAmount.getText());            // Gets user input from mortgageAmount Text Field
                      catch (NumberFormatException nfe)                          // Checks for correct number fformatting of user input
                       JOptionPane.showMessageDialog (this, "Error! Invalid input!");      // Outputs error if number is wrong format or nothing is entered
                       return;
             double interestRate = loans [loanTerm][1];                         // Sets interestRate amount
             double intRate = (interestRate / 100) / 12;                         // Calculates Interst Rate     
                double loanTermMonths = loans [loanTerm] [0];                    // Calculates Loan Term in Months
                int months = (int)loanTermMonths * 12;                          // Converts Loan Term to Months
                double interestRateMonthly = (intRate / 12);                                // monthly interst rate
             double payment = mortgage * intRate / (1 - (Math.pow(1/(1 + intRate), months)));    // Calculation for Monthly payment
                double remainingLoanBalance = mortgage;                              // Sets Reamaining Balance
                double monthlyPaymentInterest = 0;                                       // holds current interest payment
                double monthlyPaymentPrincipal = 0;                                    // holds current principal payment
                NumberFormat myCurrencyFormatter = NumberFormat.getCurrencyInstance(Locale.US);     // Number formatter to format output in table
                monthlyPayment.setText(myCurrencyFormatter.format(payment));
                mortgageTable.setText("Month\tPrincipal\tInterest\tEnding Balance\n" +                // Formats morgageTable Header
                                      "---------\t----------\t------------\t---------------------\n");
                    for (;months > 0 ; months -- )
                     monthlyPaymentInterest = (remainingLoanBalance * intRate);               // Calculation for Monthly Payment Toward Interest
                     //Calculate H = R x I
                     monthlyPaymentPrincipal = (payment - monthlyPaymentInterest);          // Calculation for Monthly Payment Toward Principal
                     //Calculate C = P - H
                  remainingLoanBalance = (remainingLoanBalance - monthlyPaymentPrincipal);     // Calculation for Reamining loan Balance
                  // Calculate R = R - C
                  // H = monthlyPaymentInterest
                  // R = remainingLoanBalance
                  // P = payment
                  // C = monthlyPaymentPrincipal
                  // I = interestRateMonthly
                  mortgageTable.setCaret (new DefaultCaret());                    // Sets Scroll position to the top left corner
                  mortgageTable.append(String.valueOf(months) + "\t" +               // Pulls in data and formats MortgageTable
                  myCurrencyFormatter.format(monthlyPaymentPrincipal) + "\t" +
                     myCurrencyFormatter.format(monthlyPaymentInterest) + "\t" +
                     myCurrencyFormatter.format(remainingLoanBalance) + "\n");
                           if(command == newcalcButton)                               // Activates the new calculation Button
                         mortgageAmount.setText(null);                         //clears mortgage amount fields
                      monthlyPayment.setText(null);                         //clears monthly payment fields
                            mortgageTable.setText(null);                              //clears mortgage table
    public static void main(String[] args)                               //This is the signature of the entry point of all the desktop apps
         new mortgageCalculator1();
    }

    OK, making a little progress but am still very confused.
    What I have is a file (int&term.dat) with three lines;
    5.75, 30
    5.5, 15
    5.35 ,7
    I have three JButtom that I what to read a seperate line and place the term in a term TextField and a rate in a Rate TextField
    I have added the following code and all it does now is output a black space to the screen; I am working with one Button and Just the rate for now to try and get it to work. I have been looking at the forums, reading the internet and several books to try and figure this out. I think I may be getting closer.
    public static void read()
        String line;
        StringTokenizer tokenizer;
        String rate;
        String term;
        try
            FileReader fr = new FileReader ("int&term.dat");
            BufferedReader inFile = new BufferedReader (fr);
            line = inFile.readLine();
            while (line != null)
            tokenizer = new StringTokenizer(line);
            rate = tokenizer.nextToken();
            line = inFile.readLine();
             inFile.close();
             System.out.println(new String());
             catch (FileNotFoundException exception)
                   System.out.println ("The file was not found.");
              catch (IOException exception)
                    System.out.println (exception);
    }

  • (Urgent help needed) how to read txt file and store the data into 2D-array?

    Hi, I have a GUI which allow to choose file from the file chooser, and when "Read file" button is pressed, I want to show the array data into the textarea.
    The sample data is like this followed:
    -0.0007     -0.0061     0.0006
    -0.0002     0.0203     0.0066
    0     0.2317     0.008
    0.0017     0.5957     0.0008
    0.0024     1.071     0.0029
    0.0439     1.4873     -0.0003
    I want my program to scan through and store these data into 2D array.
    However for some reason, my source code issues errors, and I don't know what's wrong with it, seems to have a problem in StringTokenizer though. Can anybody help me?
    Thanks in advance.
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.StringTokenizer;
    public class FileReduction1 extends JFrame implements ActionListener{
    // GUI features
    private BufferedReader fileInput;
    private JTextArea textArea;
    private JButton openButton, readButton,processButton,saveButton;
    private JTextField textfield;
    private JPanel pnlfile;
    private JPanel buttonpnl;
    private JPanel buttonbar;
    // Other fields
    private File fileName;
    private String[][] data;
    private int numLines;
    public FileReduction1(String s) {
    super(s);
    // Content pane
         Container cp = getContentPane();
         cp.setLayout(new BorderLayout());     
    // Open button Panel
    pnlfile=new JPanel(new BorderLayout());
         textfield=new JTextField();
         openButton = new JButton("Open File");
    openButton.addActionListener(this);
    pnlfile.add(openButton,BorderLayout.WEST);
         pnlfile.add(textfield,BorderLayout.CENTER);
         readButton = new JButton("Read File");
    readButton.addActionListener(this);
         readButton.setEnabled(false);
    pnlfile.add(readButton,BorderLayout.EAST);
         cp.add(pnlfile, BorderLayout.NORTH);
         // Text area     
         textArea = new JTextArea(10, 100);
    cp.add(new JScrollPane(textArea),BorderLayout.CENTER);
    processButton = new JButton("Process");
    //processButton.addActionListener(this);
    saveButton=new JButton("Save into");
    //saveButton.addActionListener(this);
    buttonbar=new JPanel(new FlowLayout(FlowLayout.RIGHT));
    buttonpnl=new JPanel(new GridLayout(1,0));
    buttonpnl.add(processButton);
    buttonpnl.add(saveButton);
    buttonbar.add(buttonpnl);
    cp.add(buttonbar,BorderLayout.SOUTH);
    /* ACTION PERFORMED */
    public void actionPerformed(ActionEvent event) {
    if (event.getActionCommand().equals("Open File")) getFileName();
         if (event.getActionCommand().equals("Read File")) readFile();
    /* OPEN THE FILE */
    private void getFileName() {
    // Display file dialog so user can select file to open
         JFileChooser fileChooser = new JFileChooser();
         fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
         int result = fileChooser.showOpenDialog(this);
         // If cancel button selected return
         if (result == JFileChooser.CANCEL_OPTION) return;
    if (result == JFileChooser.APPROVE_OPTION)
         fileName = fileChooser.getSelectedFile();
    textfield.setText(fileName.getName());
         if (checkFileName()) {
         openButton.setEnabled(false);
         readButton.setEnabled(true);
         // Obtain selected file
    /* READ FILE */
    private void readFile() {
    // Disable read button
    readButton.setEnabled(false);
    // Dimension data structure
         getNumberOfLines();
         data = new String[numLines][];
         // Read file
         readTheFile();
         // Output to text area     
         textArea.setText(data[0][0] + "\n");
         for(int index=0;index < data.length;index++)
    for(int j=1;j<data[index].length;j++)
    textArea.append(data[index][j] + "\n");
         // Rnable open button
         openButton.setEnabled(true);
    /* GET NUMBER OF LINES */
    /* Get number of lines in file and prepare data structure. */
    private void getNumberOfLines() {
    int counter = 0;
         // Open the file
         openFile();
         // Loop through file incrementing counter
         try {
         String line = fileInput.readLine();
         while (line != null) {
         counter++;
              System.out.println("(" + counter + ") " + line);
    line = fileInput.readLine();
         numLines = counter;
    closeFile();
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error reading File",
                   "Error 5: ",JOptionPane.ERROR_MESSAGE);
         closeFile();
         System.exit(1);
    /* READ FILE */
    private void readTheFile() {
    // Open the file
    int row=0;
    int col=0;
         openFile();
    System.out.println("Read the file");     
         // Loop through file incrementing counter
         try {
    String line = fileInput.readLine();
         while (line != null)
    StringTokenizer st=new StringTokenizer(line);
    while(st.hasMoreTokens())
    data[row][col]=st.nextToken();
    System.out.println(data[row][col]);
    col++;
    row++;
    closeFile();
    catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error reading File",
                   "Error 5: ",JOptionPane.ERROR_MESSAGE);
         closeFile();
         System.exit(1);
    /* CHECK FILE NAME */
    /* Return flase if selected file is a directory, access is denied or is
    not a file name. */
    private boolean checkFileName() {
         if (fileName.exists()) {
         if (fileName.canRead()) {
              if (fileName.isFile()) return(true);
              else JOptionPane.showMessageDialog(null,
                        "ERROR 3: File is a directory");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 2: Access denied");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 1: No such file!");
         // Return
         return(false);
    /* FILE HANDLING UTILITIES */
    /* OPEN FILE */
    private void openFile() {
         try {
         // Open file
         FileReader file = new FileReader(fileName);
         fileInput = new BufferedReader(file);
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
    System.out.println("File opened");
    /* CLOSE FILE */
    private void closeFile() {
    if (fileInput != null) {
         try {
              fileInput.close();
         catch (IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
    System.out.println("File closed");
    /* MAIN METHOD */
    /* MAIN METHOD */
    public static void main(String[] args) throws IOException {
         // Create instance of class FileChooser
         FileReduction1 newFile = new FileReduction1("File Reduction Program");
         // Make window vissible
         newFile.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         newFile.setSize(500,400);
    newFile.setVisible(true);
    Java.lang.NullpointException
    at FileReductoin1.readTheFile <FileReduction1.java :172>
    at FileReductoin1.readFile <FileReduction1.java :110>
    at FileReductoin1.actionPerformed <FileReduction1.java :71>
    .

    1) Next time use the CODE tags. this is way too much unreadable crap.
    2) The problem is your String[][] data.... the only place I see you do anything approching initializing it is
    data = new String[numLines][];I think you want to do this..
    data = new String[numLines][3];anyway that's why it's blowing up on the line
    data[row][col]=st.nextToken();

  • How to insert values into an array of class

    Hello everyone,
    I need help in inserting values into an array of class, which i have read from a file.
    Length of the array is 5. I should insert values one by one into that array.
    If the array is full (if count = 5), then I should split the array into 2 arrays
    and adjust the values to left and right with median.
    I'm getting an ArrayBoundException .. can anybody help me out ?
    Thanks in advance
    Here is my code..........
    import java.util.*;
    import java.io.*;
    public class Tree
         static String second;
         static String first;
         static int count = 5;
         public void insert(int f1,int s1, int c)
              if(c!=0)
                   Record[] rec = new Record[4];
                   for (int i = 0; i < 5; i++)
                          rec[i] = new Record(); 
                   for(int i = 0; i<=4;i++)
                        rec.x = f1;
                        rec[i].y = s1;
              else
                   System.out.println("yes");
         public static void main(String[] args)
              Tree t = new Tree();
              try
                   FileReader fr = new FileReader("output.txt");           // open file
                   BufferedReader br = new BufferedReader(fr);
                   String s;
                   while((s = br.readLine()) != null)
                        StringTokenizer st = new StringTokenizer(s);
                        while(st.hasMoreTokens())
                             first = st.nextToken();
                             second = st.nextToken();
                        //     System.out.println("First-->"+first+" "+"Second-->"+second);
                        int fir = Integer.parseInt(first);
                        int sec = Integer.parseInt(second);
                        t.insert(fir, sec, count);                    
                   fr.close(); // close file           
              catch (IOException e)
    System.out.println("Can't read file");
    class Record
         public int x,y;

    Hi qwedwe.
    Record[] rec = new Record[4];
                   for (int i = 0; i < 5; i++)
                          rec[i] = new Record(); 
                     }Here is your error: you have an array of 4 Records, but you create and (try to) insert 5 Record-instances.... try:
    Record[] rec = new Record[c];
                   for (int i = 0; i < c; i++)
                          rec[i] = new Record(); 
                     }Regards,
    Norman

  • [JS] [CS5] Copy and paste into existing array

    Hi Guys,
    right now I'm trying to improve the performance of a Script I wrote by copying and pasting a PDF instead of loading it 10 times.
    And here's the problem:
    When pasting the copied PDF it doesn't paste it into the array the original PDF is in but this is exactly what I need for the further script.
    Can I somehow paste the PDF into the Array and a specific position [i]?
    I'm adding the important parts of the script.
    Greetings Michael
    var myDocument = app.activeDocument;
    var myPage = myDocument.pages.item(0);
    var myPageHeight = myDocument.documentPreferences.pageHeight;
    var myPageWidth = myDocument.documentPreferences.pageWidth;
    myVertical=new Array();
    var myVerticalCount=0;
    var myStrokeHeight = myVertical[0].geometricBounds[2]-myVertical[0].geometricBounds[0];
    var myStrokeWidth = myVertical[0].geometricBounds[3]-myVertical[0].geometricBounds[1];
    for(i = 0; (myPageWidth-(i*myStrokeWidth))/(i+1) > (myStrokeWidth/3);i++){
                            myHorizontalCount++;
    myVertical[0] = myPage.rectangles.add({geometricBounds:[myPageHeight/2,0,myPageHeight +3,3]});
    myVertical[0].place (File(myFile_Vert));
    myVertical[0].strokeWeight = 0;
    myVertical[0].fit (FitOptions.FRAME_TO_CONTENT);
    app.select (null);
                        //It should be pasted into the Array myVertical[i]
                        app.select (myVertical[0]);
                        app.copy ();
                        for(i=1;i<myVerticalCount;i++)
                                app.paste();               //into myVertical[i] somehow

    Doesn't anyone know how to do this?
    If not, is it possible to:
                   1. select multiple grapics in a defined area at once?
                   or
                   2. paste a graphic and add this graphic to a selection without deselecting the items I've selected before?
    thanks in advance
    Michael

  • Previewing imported bitmaps for Illustrator CS4 using Windows XP

    Hi all
    Can anyone tell me if it is possible to preview a bitmap while importing it into Illustrator CS4 (File>Place). I am using Windows XP SP3 and I know you can see a preview on bitmaps with the Mac version.
    Any help much appreciated.
    Thanks
    George

    Some general comments (when I used CS3 and WinXp I did not have any problems, now I am on Win7 64bit Pro and CS5) 
    Check your WinXp configuration and eliminate (not remove, just stop from running at startup) anything you don't really need
    Background programs can cause problems for video editing
    The usual advice is to disable anti-virus (and, of course, don't connect to the Internet) to reduce the drain on resources
    Also do not have other programs YOU start running, so PPro has 100% of the computer's attention & resources
    Be sure you have a good device driver for your nVidia card
    This is usually the latest one (direct from nVidia, not Windows update) but you MAY need to experiment with driver versions in case a later version does not work well
    >HDV project where the bulk of the files are HDV from a Canon HV20
    CS5 is much better at allowing different kinds of files in a project, I'm not so sure about earlier versions
    If your final output is going to be DVD what MAY help is to do only the HDV part, save out to DV AVI Widescreen, then do the other codecs in a separate project, and finally join the DV AVI files in a final project
    CS4 is 32bit so will not take FULL advantage of Win7 and a 64bit computer... but if you have enough memory (I would say 12 or 16 Gig, depending on motherboard) that will allow CS4 to use as much ram as possible
    Just how do you have your drives configured?
    My 3 hard drives are configured as... (WD = Western Digital)
    1 - 320G WD Win7 64bit Pro and all program installs
    2 - 320G WD Win7 swap file and video project files
    3 - 1T WD all video files... input & output files
    Search Microsoft to find out how to redirect your Windows swap file
    http://search.microsoft.com/search.aspx?mkt=en-US&setlang=en-US

  • Storing a record set into an array

    Hello Again,
    Yet another road block in my destination to completing my program. I wanted to create a MultiColumn Combobox and needed to store my Database values into an array so I get get them into the Combobox. I'm having trouble getting this code to work properly. It seems that the the combobox wont accept the variable items maybe because it is outside the scope? I tried to move the code around to get it to work but it don't.
    here is the code.
    package pms;
    import java.awt.*;
    import javax.swing.*;
    import java.sql.*;
    public class Test3 extends JFrame {
        public static void main(String[] args) {
            new Test3();
        public Test3() {
            Container c = getContentPane();
            c.setLayout(new BorderLayout());
            c.setBackground(Color.gray);
            DBConnection db = new DBConnection();
            try {
                Connection conn = DriverManager.getConnection(db.connUrl);
                Statement sql = conn.createStatement();
                ResultSet rs = sql.executeQuery("SELECT * FROM Referrals ORDER BY Referral_Text");
                while (rs.next()) {
                    Item[] items = {
                        new Item(rs.getString(2), rs.getString(2)),};
                JComboBox jcb = new JComboBox(items);
                //Close connections.
                rs.close();
                sql.close();
                conn.close();
            } catch (SQLException e) {
                e.getStackTrace();
            jcb.setPreferredSize(new Dimension(24, 24));
            jcb.setRenderer(new ItemRenderer());
            c.add(jcb, BorderLayout.NORTH);
            setSize(200, 100);
            setLocationRelativeTo(null);
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            setVisible(true);
    // The items to display in the combobox...
        class Item {
            String itemName = "";
            String itemValue = "";
            public Item(String name, String value) {
                itemName = name;
                itemValue = value;
    // The combobox's renderer...
        class ItemRenderer extends JPanel implements ListCellRenderer {
            private JLabel nameLabel = new JLabel(" ");
            private JLabel valueLabel = new JLabel(" ");
            public ItemRenderer() {
                setOpaque(true);
                setLayout(new GridLayout(1, 2));
                add(nameLabel);
                add(valueLabel);
            public Component getListCellRendererComponent(
                    JList list,
                    Object value,
                    int index,
                    boolean isSelected,
                    boolean cellHasFocus) {
                nameLabel.setText(((Item) value).itemName);
                valueLabel.setText(((Item) value).itemValue);
                if (isSelected) {
                    setBackground(Color.black);
                    nameLabel.setForeground(Color.white);
                    valueLabel.setForeground(Color.white);
                } else {
                    setBackground(Color.white);
                    nameLabel.setForeground(Color.black);
                    valueLabel.setForeground(Color.black);
                return this;
    }Thanks!

    He is telling you that there are two problems with your code.
    The first is that you are declaring the items array inside the while loop, which means its scope is too limited - it can't be accessed by the JComboBox which is declared later.
    The second is that you are recreating the items array for every record in your ResultSet. This implies that for every new record, the item(s) already stored will be removed from memory and replaced by the values of the latest record, leading to a single option for your combo box.
    Try instead creating an ArrayList object that you initialise right before the loop, and add items to it's collection as you move along. Then pass that ArrayList to the JComboBox in this way:
              try {
                   Connection conn = DriverManager.getConnection(db.connUrl);
                   Statement sql = conn.createStatement();
                   ResultSet rs = sql
                             .executeQuery("SELECT * FROM Referrals ORDER BY ReferItemText");
                   ArrayList<Item> items = new ArrayList<Item>();
                   while (rs.next()) {
                        items.add(new Item(rs.getString(2), rs.getString(2)));
                   JComboBox jcb = new JComboBox(items.toArray());
                   // Close connections.
                   rs.close();
                   sql.close();
                   conn.close();
              } catch (SQLException e) {
                   e.getStackTrace();
              }

  • How Can I Clean up Imported Bitmap Images

    Hi, I am using Flash 5. I have imported a sequence of .png images and they are looking pretty rough and bitmapped so I wanted to clean them up.
    1. Do I have to select each frame after import and adjust the bitmap settings for each image or can I doo this somewhere so it affects al images?
    2. I can’t find the settings for cleaning up the bitmap images. I thought they would be in the “Properties” panel?
    3. Is there a way to fix the rasterization or clean up an imported .swf or is it better to clean up the sequence before saving as an .swf?

    Ned Murphy wrote:
    Ideally you should have images cleaned up/ properly sized / optimized before you import them into Flash.  Once they are in Flash, one thing you can do that can help how the image displays, especially if you manipulate its size while in Flash, is to set the image to allow smoothing.  This can be set using code or can be manually applied to the image in the library by right clicking it, selecting Properties, and checking the option to Allow Smoothing.
    Thanks Ned,
    Wow, exactly what I was looking for. Thanks. A huge improvement in the look of the gradients.

  • Adding pictures into an Array?

    The following is a BlackJack Program my group and I made. So far, it seems to work and would likely net us a 100% when we hand it in. However, we wish to go that extra mile and add pictures, cards in particular, something that should obviously be in any card game! I've been fiddling around with ImageIcon and Image but I don't have a clue how to implement these or how to get them working correctly. Also, it would be best if the pictures could be loaded into an array, which would allow the program to function basically the same way with little editing.
    //Import various Java utilites critical to program function
    import java.awt.* ;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.Random;
    import java.lang.String;
    public class BlackJackExtreme extends JFrame {  
      Random r = new Random();  //Assigning "r" to randomize
      int valueA;  //Numerical Value of player Cards
      int valueB;
      int valueC;
      int valueD;
      int valueE;
      int valueAC;  //Numerical Value of computer Cards
      int valueBC;
      int valueCC;
      int valueDC;
      int valueEC;
      int playerVal;  //Numerical total value of player cards
      int playerVal2;
      int playerValT;
      int compVal;  //Numerical total value of computer cards
      int compVal2;
      int compValT;
      int counter;  //A counter
      String playVal; //String value for Numerical total value of player cards
      String cVal;   //String value for Numerical total value of computer cards
      private JLabel YourCard;   //Initializing a title label
      private JLabel CCard;  //Initializing a title label
      private JLabel Total;   //Initializing a title label
      private JLabel CTotal;  //Initializing a title label
      private JLabel Win;   //Initializing a Win label
      private JLabel Lose;  //Initializing a Lose label
      private JLabel Bust;  //Initializing a Bust label
      private JButton Deal;   //Initializing a button
      private JButton Hit;   //Initializing a button
      private JButton Stand;   //Initializing a button
      private JButton Exit;   //Initializing a button
      private JTextArea TCompVal;     //Initializing textbox for computer values
      private JTextArea TotalVal;
      private JLabel CardOne;  //Initializing a label for player card 1
      private JLabel CardTwo;  //Initializing a label for player card 2
      private JLabel CardThree;  //Initializing a label for player card 3
      private JLabel CardFour;   //Initializing a label for player card 4
      private JLabel CardFive;   //Initializing a label for player card 5
      private JLabel CCardOne;   //Initializing a label for computer card 1
      private JLabel CCardTwo;   //Initializing a label for computer card 1
      private JLabel CCardThree;   //Initializing a label for computer card 1
      private JLabel CCardFour;   //Initializing a label for computer card 1
      private JLabel CCardFive;   //Initializing a label for computer card 1
      private JPanel contentPane;
      public BlackJackExtreme() {
        super();
        initializeComponent();     
        this.setVisible(true);
      private void initializeComponent() {   
        YourCard = new JLabel("These are your cards");
        CCard = new JLabel("These are the computers cards");
        Total = new JLabel("Your total is: ");
        CTotal = new JLabel("Computer total is: ");
        TCompVal = new JTextArea();  //Box for computer values
        TotalVal = new JTextArea();  //Box for player values
        Win = new JLabel("You win!");  //Label for a Win
        Lose = new JLabel("You lose!");  //Label for a Loss
        Bust = new JLabel("You both Bust!");  //Label for a Bust
        Deal = new JButton();  //Button
        Hit = new JButton();  //Button
        Stand = new JButton();  //Button
        Exit = new JButton();  //Button
        CardOne = new JLabel("");  //Label for Player Card 1
        CardTwo  = new JLabel("");  //Label for Player Card 2
        CardThree = new JLabel("");  //Label for Player Card 3
        CardFour = new JLabel("");  //Label for Player Card 4
        CardFive = new JLabel("");  //Label for Player Card 5
        CCardOne = new JLabel("");   //Label for Computer Card 1
        CCardTwo  = new JLabel("");  //Label for Computer Card 2
        CCardThree = new JLabel("");  //Label for Computer Card 3
        CCardFour = new JLabel("");  //Label for Computer Card 4
        CCardFive = new JLabel("");  //Label for Computer Card 5
        contentPane = (JPanel)this.getContentPane();
        //Assigns function and ability to the various buttons
        Deal.setText("Deal");
        Deal.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            Deal_actionPerformed(e);
         Stand.setText("Stand");
        Stand.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            Stand_actionPerformed(e);
            Exit.setText("Exit");
        Exit.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            Exit_actionPerformed(e);
         Hit.setText("Hit");
        Hit.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            Hit_actionPerformed(e);
        //Determines the arrangement of the various buttons, labels, and other GUI objects
        contentPane.setLayout(null);
        addComponent(contentPane, YourCard, 15,1,150,50);
        addComponent(contentPane, CCard, 325,1,200,50);
        addComponent(contentPane, Deal, 15,415,100,35);
        addComponent(contentPane, Hit, 125,415,100,35);
        addComponent(contentPane, Stand, 235 ,415,100,35);
        addComponent(contentPane, Exit, 435 ,415,100,35);
        addComponent(contentPane, CardOne, 25,35,50,50);
        addComponent(contentPane, CardTwo, 110,35,50,50);
        addComponent(contentPane, CardThree, 25,120,50,50);
        addComponent(contentPane, CardFour, 110,120,50,50);
        addComponent(contentPane, CardFive, 65,200,50,50);
        addComponent(contentPane, CCardOne, 350,35,50,50);
        addComponent(contentPane, CCardTwo, 450,35,50,50);
        addComponent(contentPane, CCardThree, 350,120,50,50);
        addComponent(contentPane, CCardFour, 450,120,50,50);
        addComponent(contentPane, CCardFive, 400,200,50,50);
        addComponent(contentPane, Win, 300,300,70,50);
        addComponent(contentPane, Lose, 300,300,70,50);
        addComponent(contentPane, Bust, 300,300,100,50);
        addComponent(contentPane, Total, 100,350,150,50);
        addComponent(contentPane, TotalVal, 200,365,25,25);
        addComponent(contentPane, CTotal, 300,365,150,25);
        addComponent(contentPane, TCompVal, 425,365,25,25);
        //Sets the "outcome" labels invisible on program execution
        Win.setVisible(false);
        Lose.setVisible(false);
        Bust.setVisible(false);
        //Determines size of program window
        this.setTitle("BlackJack");
        this.setLocation(new Point(220,185));
        this.setSize(new Dimension(555,500));
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
      private void addComponent(Container container, Component c, int x, int y, int width, int height){
        c.setBounds(x,y,width,height);
        container.add(c);
      //The DEAL button
      public void Deal_actionPerformed(ActionEvent e) {
        //Correctly resets the display after first round of use
        Hit.setVisible(true);
        Stand.setVisible(true);
        Win.setVisible(false);
        Lose.setVisible(false);
        Bust.setVisible(false);
        CardThree.setVisible(false);
        CardFour.setVisible(false);
        CardFive.setVisible(false);
        TotalVal.setText("");
        TCompVal.setText("");
        //Card Array - Values assigned to cards
        String[] cardnames = new String[15];
        cardnames[0] = "Error";
        cardnames[1] = "Error";
        cardnames[2] = "Two";
        cardnames[3] = "Three";
        cardnames[4] = "Four";
        cardnames[5] = "Five";
        cardnames[6] = "Six";
        cardnames[7] = "Seven";
        cardnames[8] = "Eight";
        cardnames[9] = "Nine";
        cardnames[10] = "Ten";
        cardnames[11] = "Jack";
        cardnames[12] = "Queen";
        cardnames[13] = "King";
        cardnames[14] = "Ace";
        //Randomize Card Values
        valueA = r.nextInt(13)+2;
        valueB = r.nextInt(13)+2;
        valueAC = r.nextInt(13)+2;
        valueBC = r.nextInt(13)+2;
        //Displays Card
        CardOne.setText(cardnames[valueA]);
        CardTwo.setText(cardnames[valueB]);
        CCardOne.setText(cardnames[valueAC]);
        CCardTwo.setText(cardnames[valueBC]);
        //Value Correction for Player Cards
        if (valueA == 11 || valueA == 12 || valueA == 13) {
          valueA = 10;  }
        if (valueA ==14){
          valueA = 11;    }
        if (valueB == 11 || valueB == 12 || valueB == 13) {
          valueB = 10;    }
        if (valueB ==14){
          valueB = 11;    }
        //Value Correction for Computer Cards
        if (valueAC == 11 || valueAC == 12 || valueAC == 13) {
          valueAC = 10;  }
        if (valueAC ==14){
          valueAC = 11;    }
        if (valueBC == 11 || valueBC == 12 || valueBC == 13) {
          valueBC = 10;    }
        if (valueBC ==14){
          valueBC = 11;    }
        //Computer Hand Value Calculations
        compVal = valueAC + valueBC;
        //Assigns addition cards to computer
        if (compVal <= 15) {
          valueCC = r.nextInt(13)+2;
          CCardThree.setText(cardnames[valueCC]);
          if (valueCC == 11 || valueCC == 12 || valueCC == 13) {
           valueCC = 10;    }
          if (valueCC ==14){
            valueCC = 11;    }
          compVal += valueCC;    }
        //Changes the Integer value of player and computer hands into a String value
        cVal = Integer.toString(compVal);  
        playerVal = valueA + valueB;
        playVal =  Integer.toString(playerVal);
        TotalVal.setText(playVal);
        Deal.setVisible(false);
        CCardOne.setVisible(false);
      //The HIT button
      public void Hit_actionPerformed(ActionEvent e) {
        //A counter that changes the specific function of the HIT button when it is pressed at different times
        counter++;
          if (counter ==3){
          Hit.setVisible(false);
        //Card Array - Values assigned to cards
        String[] cardnames = new String[15];
        cardnames[0] = "Error";
        cardnames[1] = "Error";
        cardnames[2] = "Two";
        cardnames[3] = "Three";
        cardnames[4] = "Four";
        cardnames[5] = "Five";
        cardnames[6] = "Six";
        cardnames[7] = "Seven";
        cardnames[8] = "Eight";
        cardnames[9] = "Nine";
        cardnames[10] = "Ten";
        cardnames[11] = "Jack";
        cardnames[12] = "Queen";
        cardnames[13] = "King";
        cardnames[14] = "Ace";
        //Randomize Card Values
        valueC = r.nextInt(13)+2;
        valueD= r.nextInt(13)+2;
        valueE = r.nextInt(13)+2;
        //Determines which card is being hit, as well as randomizing a value to that location
        if (counter == 1) {
          CardThree.setText(cardnames[valueC]);
          playerVal2 = 0 + (valueC);      
          CardThree.setVisible(true);    }
        if (counter == 2) {
          CardFour.setText(cardnames[valueD]);  
          playerVal2 += (valueD) ; 
          CardFour.setVisible(true);    }
        if (counter == 3) {
          CardFive.setText(cardnames[valueE]);
          playerVal2 += (valueE);
          CardFive.setVisible(true);    }
        //Value corrections for player cards
        if (valueC == 11 || valueC == 12 || valueC == 13) {
          valueC = 10;    }
        if (valueC ==14){
          valueC = 11;    }
        if (valueD == 11 || valueD == 12 || valueD == 13) {
          valueD = 10;    }
        if (valueD ==14){
          valueD = 11;    }
        if (valueE == 11 || valueE == 12 || valueE == 13) {
          valueE = 10;    }
        if (valueE ==14){
          valueE = 11;
        //Changes the Integer value of player and computer hands into a String value
        playerValT = playerVal + playerVal2;
        playVal =  Integer.toString(playerValT);
        TotalVal.setText(playVal);
        //The STAND button
        private void Stand_actionPerformed(ActionEvent e) {
          //Correctly assigns player value if HIT button is never pressed
          if (counter == 0){
            playerValT = playerVal; }    
          //Reveals the unknown computer card
          CCardOne.setVisible(true);
          //Determines the winner and loser
          if (playerValT <= 21 && compVal < playerValT) {
            Win.setVisible(true); }
          else if (playerValT <= 21 && compVal > 21) {
            Win.setVisible(true); }
          else if (playerValT >21 && compVal > 21) {
            Bust.setVisible(true); }
          else if (compVal <= 21 && playerValT < compVal){
            Lose.setVisible(true);}
          else if (compVal <= 21 && playerValT > 21) {
            Lose.setVisible(true); }
          else if (compVal == playerValT){
            Lose.setVisible(true); }
          //Configures program and display for next use
          Deal.setVisible(true);
          Stand.setVisible(false);
          Hit.setVisible(false);
          counter = 0;
          TCompVal.setText(cVal);
        //The EXIT button
          private void Exit_actionPerformed(ActionEvent e) {
            System.exit ( 0 );
      public static void main(String[]args) {   
        JFrame.setDefaultLookAndFeelDecorated(true);
        JDialog.setDefaultLookAndFeelDecorated(true);   
        new BlackJackExtreme();
      Instead of having a JLabel with "Ace", "Eight", etc appear, how would one make pictures appear? How does one do this with an array?
    Edited by: Funkdmonkey on Jan 1, 2008 7:45 PM

    I guess an array or perhaps better a hashmap where the image is the value and the card (a great place for an enum!) is the key would work nicely. Oh, and you can find a great public domain set of card images here:
    http://www.eludication.org/playingcards.html
    Finally, your code appears to be suffering from the God-class anti-pattern. You would do well to refactor that beast.
    Edited by: Encephalopathic on Jan 1, 2008 8:09 PM

  • Convert variable into an array

    I have variable, abc; whose value is in the format val1,val2,val3,..
    I want to convert it into an array, like that arr[0]=val1; arr[1]=val2; so on. How can I do this?
    Usman

    examine this class that I did
    import java.lang.*;
    public class ReadString {
    public static void main(String[] args){
    String abc = "1,2,3,4,5,6";
    StringBuffer abc2 = new StringBuffer(abc);
    int arrayLength = abc2.length(); //get length
    int[] abcFinal = new int[6];
    for (int i=0; i<arrayLength; i++) { //test characters
         int anIndex;
         if (!(abc2.substring(i,i+1)).equals(",")) { //if it is a number
         //(i/2) is ta little formula to be able to assign the
         //right index in the intArray to the number
         anIndex = (i/2);
         //set value to array
         abcFinal[anIndex] = Integer.parseInt(abc2.substring(i,i+1));
    for (int j=0;j<abcFinal.length;j++ ) {
         System.out.println("i = " + j + " value = " + abcFinal[j]);
    }//end main
    }//end class

  • How to import bitmap files?

    I have old slides that I scan with a photosmart S20 scanner. The best quality option scan is to save it as bitmap. How do I import it to the Lightroom catalog? Thank you.

    I had the HP photosmart S10 scanner (the SCSI interface predecessor to the S20) and it produced GREAT slide scans although only 2400dpi which is generally enough for most uses. If you mean bitmap as in BMP files, you will have to convert these to TIFF or JPG (i would use TIFF as it will be a lossless conversion) to import these into lightroom as BMP is not a supported file type.  I believe IRFANVIEW (free shareware) will do this conversion in batch. 

  • How do I convert an image file into an array?

    I am using LabVIEW v.6.0.2
    I have no NI IMAQ device or IMAQ card, also no Vision
    The image file I have can be saved as a file containing numbers relating to the picels. I want to put these numbers into an array and plot a cross section intensity chart ( I am investigating young's double slits experiment and want to see the interference fringes in graphical form).

    I'm not sure what you're asking.
    In the GRAPHICS palette, there are READ JPEG file, READ BMP file, and READ PNG file VIs. Choose one and together with DRAW FLATTENED PIXMAP and a PICTURE indicator, you can display a picture with two functions and two wires.
    If you have spreadsheet-type data and import it with READ FROM SPREADSHEET FILE (in the File I/O palette), you can plot that directly to an intensity indicator.
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • Getting file into an array of byte..

    Hi guys,
    i first thank you for all the help you've given in my precedent posts.
    Now i've to ask you a question.
    I need to convert some lines of a txt file(obtained from an excel table) into an array of byte in the best possible manner.
    My file can have a various number of rows and columns.
    With this code
    BufferedReader br = new BufferedReader(new InputStreamReader(myFile.getInputStream()));
    String line = null;
            while ((line = br.readLine()) != null) {
                    line = line.replace (',', '.');
                    StringTokenizer st = new StringTokenizer(line);
                    numberOfNumericColumns = (st.countTokens()-1);
                    col=(numberOfNumericColumns+1);I read the file, i change , with . and line to line i calculate the number of value(that have to be the same,i do the control for showing exception if necessary).
    Now i know from my file what are the number of values in a row(columns of my old excel table).
    I have to convert this file into an array of byte.
    How can i do it?
    Suppose we have only 3 lines, the first line is ever only string,the others lines have a string and other double values.....
    nome giuseppe carmine paolo
    valerio 23.3 34.3 43.3
    paolo 21.2 34.5 12.2
    each value is separated from another one by one or more whitespaces..
    The most important thing is that in a second moment i have to read this array of byte and showing its original content,so i have to put in the array some different value and different line symbol delimiter.
    Can you help me giving me some idea or code?(please be clear,i'm inexpert of java...)
    Thanks very much,i need your help
    Message was edited by:
    giubat

    thanks for your reply...
    my file has about 50000 rows..........and i have to develop an application that allows the upload of about 6000/7000 files....
    so i have to optimize everythings......i want to use whitespace to separate different value and ;different line
    so in my array of bytes i want
    nome(converted in byte) whitespace(in byte) giuseppe (in byte) whitespace(in byte)carmine(in byte) whitespace(in byte) paolo (in byte) ;(in byte);
    valerio(in byte) whitespace(in byte) 23.3 (in byte) whitespace(in byte) 34.3 (in byte) whitespace(in byte)43.3 (in byte) ;(in byte) etc.....So i should have an array of byte lower than the array of byte obtained converting each line as a string into bytes.......
    do you understand what's my problem?
    How can i create an array of byte without fixing its initial dimension that is able to grows up for each line read?
    Excuse for my poor english..
    In the past i've used a vector to temporary store the data while reading the file and at the end i copied the vector in the array of byte but when i do upload in my application i had java heap size error.
    So someone has suggested me to improve my storing method and i've decided to eliminate vector....
    can you help me......????
    please....i need your help..

Maybe you are looking for

  • How to fit frame to content when content contains anchored text box?

    Hi there I am creating a series of inline text frames within a text frame. Each of these inline frames contains text which includes an anchored text frame. If I tell my inline frames to fit to content they seem to ignore the anchored frames contained

  • Control Center not getting started

    Hi All, I have installed oracle business intelligence 10g release 2 on a linux box. I have installed Oracle Warehouse builder on both linux box and on my laptop which is windows. I tried to start the control center from the server which is the linux

  • Help!! Computer Keeps Restarting Itself!! Error 1000000a

    Hello can someone help me with the below error please: Event Type:        Error Event Source:    System Error Event Category:                (102) Event ID:              1003 Date:                     17/04/2009 Time:                     3:08:30 PM U

  • Hard disk crashed.  Syncing with i Tunes

    My HD crashed and I want to sync my i pod back with my i tunes library. When I log in to itunes there's a message indicating it will erase everything I currently have. How do I sync both libraries (apparent) on itunes?

  • Charm School Rip-Off

    I hope someone from Apple is reading this: I subscribed to Flavor of Love Girls: Charm School. I had to PURCHASE the final episode because Apple said the end of the subscription was over - and there were two episodes left - the finals show and the po