You don't print anything with a dialog box, native or otherwise. All the dialog box does is to ask the user to provide some information for you, such as what printer to use or what range of pages you should print or whatever. The actual printing is up to you.
Next, "printing an array" is underspecified. An array is simply a construction for storing a fixed number of objects. But printing implies converting objects from their internal form to a displayable form. So you have several design questions you have to answer before you get started, such as:
1. How do you want to display an element of the array?
2. How do you want to arrange the array elements? (e.g. in a vertical column, in a horizontal row, what if the row doesn't fit into the page with, and so on.)
Once you have decided how to format and arrange the data, then you come to the hard part. I would recommend you look around for a "java printing tutorial" on the web.
> So, can somebody provide an example of printing any
> array of data and using native dialog box ?
> Please, help. I'll transfer all duke dollars for
> useful example honestly.
You just haven't told anyone exactly what you want. Surely you see that.
Do you mean that you want your array contents on one page or a sequence of pages? What does your array actually contain?
Learn to state your problem:
I have an array of (object type)s. I would like to print them to the printer specified by the user...
>Do you mean like this?
>for(int x=0; x<data.length; x++)
>{
>System.out.println(data[x]);
>}
>
:-), of course NOT!!!
Print array of string objects ON PRINTER! COULD SOMEBODY PROVIDE AN EXAMPLE, PLEASE ?
If I properly understood, to print array ,for example,of strings I should write a class which would implement interface Printable and then "draw" every line of my array on printer context like you draw 2D graphics on monitor(graphic context), am I right ?