BufferedImage array into JScrollPane

Hi, i want to put an array of bufferedimage into a JScrollPane, the problem is that i want that the shown images are selectable therefore i want to put them into a JCheckBox.
Is possible? Someone can advise me? Do you have some idea?
Thanks

I think you should put a Panel in JScrollPane and and draw the images with JCheckBox on your panel. I did a something very similar in the past, If you want, I can send you the snap shot.

Similar Messages

  • Inserting a associative array into a table

    Hi,
    I am working on a process where I want to store the temporary results in an associative array. At the end of the process I plan to write the contents of the array into a table that has the same structure. (the array is defined as a %rowtype of the table)
    Is it possible to execute ONE sql statement that transfers the array into the table? I am on 10g (10.2.0.4.0)
    Here's what I have now:
    declare
      type t_emp is table of emp%rowtype index by pls_integer;
      v_emp t_emp;
    begin
      -- a process that fills v_emp with lots of data
      for i in v_emp.first .. v_emp.last
      loop
        insert into emp values v_emp(i);
      end loop;  
    end;But it would be better if the loop could be replaced by sql one statement that inserts all of v_emp into emp. Is that possible?
    Thanks!
    PS: I'm not sure whether it's a good idea to use this approach... building a table in memory and inserting it into the database at the end of the process. Maybe it's better to insert every record directly into the table... but in any case I'm curious to see if it is possible in theory :)
    Edited: Added version info

    True, SQL cannot access the PL/SQL type.
    So you can not do something like this:
    insert into emp
    select * from table(v_emp)That is not possible.
    But FORALL is possible:
    FORALL i in v_emp.first .. v_emp.last
        insert into emp values v_emp(i);FORALL makes just one "round trip" to SQL bulk binding the entire contents of the array.
    It is much more efficient than the normal FOR loop, though it is mostly a PL/SQL optimization - even the FORALL actually inserts the rows "one at the time", it just hands the entire array to the SQL engine in one go.
    If the logic has to be done procedurally, FORALL is efficient.
    If the logic can be changed so arrays can be avoided completely and everything done in a single "insert into ... select ..." statement, that is the most efficient.

  • How can i pass a value in array into .setText()?

    i want to display a value in an array into a JTextField. May i know how to do it?
    eg:
    JTextField UserName;
    UserName.setText(s);
    but it doesn't display the value into the JTextfield.

    ok... is s an array?
    String[] s = {"s1", "s2"};Either you expect 1 value...
    username.setText(s[0]);
    // or
    username.setText(s[1]);Or you expect both:
    StringBuffer sb = new StringBuffer("");
    for(int x = 0; x < s.length; x++) {
       if(x != 0) sb.append(", ");
       sb.append(s[x])
    username.setText(sb.toString());

  • Add time stamp array into first column of text file

    I am writing daq output to a file by using array to spreadsheet string vi then write that to a file but I would like to add a time stamp array into the first column of the text file. How do I do this?

    When you use a DAQmx Read, you have the option of returning a waveform data type. This includes time data. If you were to use this and either Export Waveforms to Spreadsheet File or Write Measurement File, this would included. To stick with the regular Write to Spreadsheet File, you would have to create an array of timestamps yourself based on a start time and the sample rate of the DAQ. Then you would convert this and the data array to strings and use the string array type of Write to Spreadsheet instead of the DBL type.
    Message Edited by Dennis Knutson on 09-25-2007 01:12 PM
    Attachments:
    Write to Spreadsheet - Strings.PNG ‏1 KB

  • Write arrays into a text file in different columns at different times

    Hi,
              I have a problem write data into a text file. I want to write 4 1D arrays into a text file. The problem is that I need to write it at different time and in different column (in other word, not only append the arrays).
    Do you have an idea to solve my problem?
    Thank you

    A file is long a linear string of data (text). In order ro insert columns, you need to rewrite the entire file, because colums are interlaced over the entire lenght of the file.
    So:
    read file into 2D array
    insert columns using array operations
    write resulting 2D array to file again.
    (Only if your colums are guaranteed to be fixed width AND you know the final number of colums, you could write the missing columns as spaces and then overwrite later. Still, it will be painful and inefficient, because column data are not adjacent in the file.)
    LabVIEW Champion . Do more with less code and in less time .

  • Converting object wrapper type array into equivalent primary type array

    Hi All!
    My question is how to convert object wrapper type array into equivalent prime type array, e.g. Integer[] -> int[] or Float[] -> float[] etc.
    Is sound like a trivial task however the problem is that I do not know the type I work with. To understand what I mean, please read the following code -
    //Method signature
    Object createArray( Class clazz, String value ) throws Exception;
    //and usage should be as follows:
    Object arr = createArray( Integer.class, "2%%3%%4" );
    //"arr" will be passed as a parameter of a method again via reflection
    public void compute( Object... args ) {
        a = (int[])args[0];
    //or
    Object arr = createArray( Double.class, "2%%3%%4" );
    public void compute( Object... args ) {
        b = (double[])args[0];
    //and the method implementation -
    Object createArray( Class clazz, String value ) throws Exception {
         String[] split = value.split( "%%" );
         //create array, e.g. Integer[] or Double[] etc.
         Object[] o = (Object[])Array.newInstance( clazz, split.length );
         //fill the array with parsed values, on parse error exception will be thrown
         for (int i = 0; i < split.length; i++) {
              Method meth = clazz.getMethod( "valueOf", new Class[]{ String.class });
              o[i] = meth.invoke( null, new Object[]{ split[i] });
         //here convert Object[] to Object of type int[] or double[] etc...
         /* and return that object*/
         //NB!!! I want to avoid the following code:
         if( o instanceof Integer[] ) {
              int[] ar = new int[o.length];
              for (int i = 0; i < o.length; i++) {
                   ar[i] = (Integer)o;
              return ar;
         } else if( o instanceof Double[] ) {
         //...repeat "else if" for all primary types... :(
         return null;
    Unfortunately I was unable to find any useful method in Java API (I work with 1.5).
    Did I make myself clear? :)
    Thanks in advance,
    Pavel Grigorenko

    I think I've found the answer myself ;-)
    Never thought I could use something like int.class or double.class,
    so the next statement holds int[] q = (int[])Array.newInstance( int.class, 2 );
    and the easy solution is the following -
    Object primeArray = Array.newInstance( token.getPrimeClass(), split.length );
    for (int j = 0; j < split.length; j++) {
         Method meth = clazz.getMethod( "valueOf", new Class[]{ String.class });
         Object val = meth.invoke( null, new Object[]{ split[j] });
         Array.set( primeArray, j, val );
    }where "token.getPrimeClass()" return appropriate Class, i.e. int.class, float.class etc.

  • How do I modify an Array into a collection

    Hi I'm havin a real hard time modifying an Array into a collection, heres the code I'm working with
    I have to modify all the Arrays of this code....
    public class Student {
         private String           name;
         private float []      grades;
         private int           finalGrade;
         public Student(String name) {
              this.name      = name;
              this.grades = new float[5];
              for (int i = 0; i < grades.length; i ++) {
                   grades[i] = 0.0f;
              finalGrade = 0;
         public String toString() {
              String studentInfo = " Grades for " + name + ": ";
         for (int i = 0; i < grades.length; i ++)
         studentInfo += " " + grades;
         studentInfo += "\n final grade: " + getFinalGrade();
         return studentInfo;
         private void setFinalGrade() {
              float temp = 0.0f;
              for(int i = 0; i < grades.length; i++)
                   temp += grades[i];
              finalGrade = Math.round(temp/grades.length);
         public int getFinalGrade() {
              this.setFinalGrade();
              return finalGrade;
         public void setGrade( int index, float grade) {
              this.grades[index] = grade;
         public float[] getGrades() {
              return grades;
         public String getName() {
              return name;

    I'm kind of new at this I just started to learn about
    that, is there an example u could give me to inspire
    me ?
    Object[] o = new String[]{"one", "two", "five"};
    Collection ascollection = Arrays.asList(o);
    //the returned Collection (List) is unmodifiable,
    //so if we want to remove or add items, we need
    //a copy:
    Collection copy = new ArrayList(ascollection);
    copy.remove("two");
    String[] backagain = (String[]) copy.toArray(new String[copy.size()]);

  • How do I combine two arrays into one?

    I am trying to combine two byte arrays into one. What function do I use that will put in the information in the same order just combined?

    battler. wrote:
    Julien,
    Used LV for years.  Never knew that (concatenate inputs).  Wouldn't believe the lengths ive used to get around it.  Thanks
    Same here! I actually learned about it taking a sample test for the CLAD.
    Richard

  • Passing array into resultset

    hi,
    is it possible to pass an array into a resultset? if yes please indicate how.
    thank you all in advance

    Hi,
    Sorry for the confusion, here's what I'm trying to accomplish.
    I'm trying to create a report in Crystal Report and use Java as data source. My Java application needs to generate some value and pass them to the report as parameters. After some research I've found that I can use a Java Bean class as data source for Crystal Report that returns a ResultSet. Therefore I'm trying to pass some values in my Java app into the Bean class as array and convert them to a ResultSet for Crystal Report.
    If you know of a different way please let me know, otherwise, this is what I meant by passing array into resultset.
    thanks for your reply,

  • Append 2 arrays into 1

    im trying to append 2 arrays into 1 but i cant get it right!
    this is what i tried to do but im getting an error "'class' or 'interface' expected on line 14"
    plz help!!!
    import java.util.*;
    public class appendarrays {
         public static void main(String[] args) {
         int[] a = {1, 4, 9, 16, 9};
         int[] b = {11, 11, 7, 9, 16, 4, 1};
         append(a,b);
         System.out.println(Arrays.toString(ab));
    public static int[] append(int[] a, int[] b) {
         int[] ab = new int[a.length + b.length];
    System.arraycopy(a, 0, ab, 0, a.length);
    System.arraycopy(b, 0, ab, a.length, b.length);
    public String toSAtring() {
         return ab;
    }

    yoo hoo!!! it works now! thanks those who helped me here! i got it!
    import java.util.*;
    public class mergearrays {
         public static void main(String[] args) {
         int[] a = {1, 4, 9, 16, 9};
         int[] b = {11, 11, 7, 9, 16, 4, 1};
         int[] myArray = merge(a, b);
         System.out.println(Arrays.toString(myArray));
    public static int[] merge(int[] a, int[] b) {
       int[] newArray = new int[a.length + b.length];
       int i = 0;
       int len = a.length;
       for (int j = 0; j < len; j++) {
         newArray[i++] = a[j];
       len = b.length;
       for(int j = 0; j < len; j++) {
         newArray[i++] = b[j];
       return newArray;
    }as for the rest...take courses in helping people.

  • Possible to insert array into db without looping?

    Hi there,
    I'm working on a Flex project that uses cfc's and MySQL. I
    have an ArrayCollection that I want to store in my db. I was
    thinking that I could store it as a BLOB. I'm taking a stab at it
    now but I thought I'd put the feelers out to see if anyone has any
    ideas of how to do this.
    Maybe a simpler way to put it:
    Is it possible to save an entire array into a database
    without looping through and storing each item in the array
    separately?
    Thanks.
    Novian

    For 1 dimensional arrays, you can either convert the array to
    a list - ArrayToList() or for more complicated structures you can
    serialize your data using XML, WDDX (a type of XML) or JSON. WDDX
    support is native to CF, you can find components online that will
    give you JSON support or you can roll your own XML
    conversion.

  • Divide an array into components

    Hello:
    I am developing a LV application that has, in some way, "two parts": One of them is the user interface and its associated block diagram, that receives values from controls and files. Then, this values are used for feeding the inputs of a "Call Library Function" node.
    Well, some of the values I use are components of an array. I thought that I could use a "Split array" block, but I cant connect the "1 component array" with the numerical input of the library node.
    How could I "convert" a "1 component array" into a "numerical value". I actually use a very improper method, I connect the "1 component" array to a "array max & min" block, and I use "max value" output (I could use min too, obviously).
    Another question that is related to this is the follwing: Is there any method in order to split an array into its numerical components? Because I have, for example, a 4 elements array, I wished to divide it (in an easy way, instead of having a "serial association" of 4 "split array" blocks) into 4 numerical values that are used for feeding a function node.
    Well, if you need any aditional info, please dont hesitate in ask for it. Thank you very much for your attention and please sorry for my bad english.
    Yours sincerely.
    Juan Crespo

    Juan,
    Apologies if I misunderstood, but is the 'Index Array' function the answer to both your questions?
    =====================================================
    Fading out. " ... J. Arthur Rank on gong."
    Attachments:
    Index Array Elements.jpg ‏12 KB

  • Storing an array into the database using jdbc

    Hi,
    i�ve got a problem storing an array into a database. I want to store objects consisting of several attributes. One of these attributes is an array containing several int values. I don�t know exactly what is the best way to store these objects into a database. I have created two tables connected by a one to many relationship of which one stores the array values and the other table stores the object containing the array. Is that ok or should I use another way. It�s the first time I�m trying to store objects containing arrays into a database so I�m very uncertain in which way this should be done.
    Thanks in advance for any tips

    1. You should use blob or longvarbianry type colum to stor that array.
    2. All object in that array should be Serializable.
    3. Constuct a PreparedStatement object
    4. Convert array to byte[] object
    ByteArrayOutputStream baos=null;
    ObjectOutputStream objectOutputStream=null;
    baos = new ByteArrayOutputStream(bufferSize);
    objectOutputStream = new ObjectOutputStream(baos);
    objectOutputStream.writeObject(array);
    objectOutputStream.flush();
    baos.flush();
    byte[] value=baos.toByteArray();
    5. Now you can use PreparedStatement.setBytes function to insert byte[] value.

  • How to pass 1D array into matlab?

    1 had 2 1-D array
    array1 = 1D array signed 32-bit integer numeric
    array2 = 1D array double-precision floating-point numeric
    how do i pass this 2 arrays to matlab script??
    help....as i'm very new to both labview and matlab.
    thks,lyn

    LabVIEW has a Matlab Script Node (Programs >> Mathematics >> Formula) that you can use to interface between the two programs. To pass arrays into the script node do the following:
    1. Right-click on the left edge and select "Add Input"
    2. Give the input a variable name in the termainal that was created.
    3. Right click on the terminal and select Choose Data Type >> Real Vector.
    You can now wire the 1D array to this terminal. You enter your Matlab Commands as text inside the node and you can create outputs the same way to created inputs.

  • Write string array into cfg file

    Hi, everybody.
    I faced the problem to write array into cfg file. I am trying to put many items in a key. It should look like
    [Section1]
    Key1=el_1, el_2,el_3,.............el_n.
    each element is string of 105 characters. Everything works fine when I save the only one el_1 or multiple for the  first time, however, when I am trying to update values in a key section some extra strings appear in a file. My VI is attached.
    Thanks in advance

    Do you realize that your spreadsheet string only writes the following:
    1111111111
      2222222222222222
     33333333333333333333
    The way you wrote your VI, it sends the entire string above to the value for Write Key.vi.
    Do you realize that value is for the data type only?  So I'm not sure what you want to do....
    Without describing the problem you are having, can you describe what you actually want to do?
    R
    Message Edited by JoeLabView on 07-22-2008 11:49 AM
    Attachments:
    confused.PNG ‏26 KB

Maybe you are looking for

  • Can I edit open a GoLive site in Dreamweaver?

    I have a site that I put together for a charity..I have done it for a few years and the content, images etc don't change too often. Every month or so there needs to be an update to timetable and information. At the moment I do this with GoLive which

  • Maximum upload speed of 2700HGV?

    Hi. I'm using the 2wire BT2700HGV router on my Infinity connection, which should be about 66mbps download and 20mbps upload, according to the BT website when I ordered the connection. When I've got nothing but a single ethernet wire connecting me, an

  • Load Balancing and BSP address

    Hi, I'm using a load balancing feature in the production server. I have 10 actual server. Is there a way to have a common BSP link? right now i'm using just 1 server. I tried to set the Server Group on the SICF, but that does not do anything. Any inf

  • InCopy workflow with packages

    I am using the InCopy CS5 workflow and sending icap files to external clients for editing. The client edited the file and then sent back an .idap file. If someone other than myself who made the original .icap files tries to update the Indesign templa

  • YAACE (Yet Another Access Control Exception)

    Hi, This has got to be the simplest example on record. I created the following "Hello, World" file: import java.net.Socket; public class HelloWorld Socket     socket; public HelloWorld() throws Exception System.out.println("Hello, World!"); socket =