Sandeep DSouza

Greenhorn
+ Follow
since Dec 18, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sandeep DSouza

JTable and JComboBox
Author: sandsouza Apr 29, 2004 10:43 AM

Hi,
I have a JTable with a JCombox as the editor for a couple of columns ... The JComboxes are editable comboboxes.
I am having two issues with this . would really appriciate if somebody could help me with this one
1. When the user types any letter .. the option starting with that letter should show up in the column .. just like the way a noneditable comboBox works.
2. When the user selects any option from the comboBox ... the table stops editing.. basically goes out of edit mode... I think its something to do with the action performed
for the combobox.. but I am not sure what exactly needs to be done ..
Can someone help me with this one .
Thanks ,
sandsouza
18 years ago
Hi,
Thanks for your help .. will try implementing it now
Regards,
sandeep
18 years ago
Hi,
I need to know if there is any event which is triggered when the some data in entered or changed in a
JTextBox.
can someone please help me with this
Thanks in Advance
sandsouza
18 years ago
Hi,
I am building a database application in Java and now i need to print some reports ....
I need to get the data from the database .. do some calculations , and then print in on paper.
I checked online and got some tools like JasperReports, jfreereports, ReportCat, etc. so I was wondering if somebody can suggest whats the best.
In my report I will have to print more than one table on one page.
for example:
if I have 4 Invoices. then i will have 4 tables .. one for each invoice.. and each table will contain
the elements for that Invoice.If all can't fit on one page then it needs to go next page.
I would like to do all this stuff in Java without using any reporting tool ... but I am not really sure how this can be
done .. can someone give me an idea ... as per how this can be done .. will really appriciate all the help.
Thanks in advance,
sandsouza
18 years ago
Hi,
I am building a database application in Java and now i need to print some reports ....
I need to get the data from the database .. do some calculations , and then print in on paper.
I checked online and got some tools like JasperReports, jfreereports, ReportCat, etc. so I was wondering if somebody can suggest whats the best.
In my report I will have to print more than one table on one page.
for example:
if I have 4 Invoices. then i will have 4 tables .. one for each invoice.. and each table will contain
the elements for that Invoice.If all can't fit on one page then it needs to go next page.
I would like to do all this stuff in Java without using any reporting tool ... but I am not really sure how this can be
done .. can someone give me an idea ... as per how this can be done .. will really appriciate all the help.
Thanks in advance,
sandsouza
18 years ago
Hi,
I am trying to do some printing in java .. and was wondering is it possible to increase the size of the
Imagebale area... i need to print some data from the begining of the page.
I get the imagebale size using
pageFormat.getImageableX(), pageFormat.getImageableY().. is it possible to increase this
Pleae let me know ... thanks in advance
sandsouza.
18 years ago
Hi,
I am trying to do some printing in my Java program....
this is what I am doing.... I pass an ArrayList to the class performing the print ... and then create a graphics object using the data in the ArrayList..... And print it.....

public int print(Graphics g, PageFormat pageFormat, int page) throws
PrinterException
{
int i;
Graphics2D g2d = (Graphics2D) g;
if (page == 0)
{
g2d.translate (pageFormat.getImageableX(), pageFormat.getImageableY());
g2d.setFont(new java.awt.Font("Microsoft Sans Serif", 0,11));
int x =0;
int y= 45;
// Printing the data from the Array list.
// The way I am formatting to print.. I can print only 16 records on one page.
So it needs to go to the next page after 16 records.
for(i=0;i<printArray.size();i++)
{
// trying to position the data into tow columns .. with all odd rows on one side and even on another.
if(checknum_odd_even(i))
{
x =0;
// trying to position the data.
Object[] prnObject = (Object[]) printArray.get(i);
g2d.drawString(prnObject[0].toString(), x, y);
y = y + 15;
g2d.drawString(prnObject[1].toString(), x, y);
y = y + 15;
g2d.drawString(prnObject[2].toString(), x, y);
y = y + 45;
}
else
{
// trying to position the data.
x=300;
y=y-75;
Object[] prnObject = (Object[]) printArray.get(i);
g2d.drawString(prnObject[0].toString(), x, y);
y = y + 15;
g2d.drawString(prnObject[1].toString(), x, y);
y = y + 15;
g2d.drawString(prnObject[2].toString(), x, y);
y = y + 45;
}
}
return (PAGE_EXISTS);
}
else return (NO_SUCH_PAGE);
}
}

This works fine.. as long as it is limited to only one page .... but i don't know how to print multiple pages ,,,
for example .. if there are 30 items in the array list that I am sending to the class ... it should print the first 16 on page one and the next 14 on page two .... .. I went through the javax.print .. but did not understand much .. will really appreciate if someone could help me .. give me an idea as per what needs to be done ..
Thanks,
Sandeep
18 years ago
Hi,
I have a question about setting the default cell editior for each column.
I need to know if it is possible to set two different cell editors for the same column on two different rows.
in the sense I have two combo boxes (A and B) and for column 1 on row 1 ... i want to set the default cell editor as combobox A and for column1 on row 2 .. i need to set the default cell editor as comboBoxB.
Can somebody help me with this one ... I will really appreciate it.
Thanks,
sandsouza
19 years ago
Hi,
I need to print a bunch of name and address as labels in java ... can someone tell me how this can be done in Java.
If I was using MS tecnologies then i would use OLE or something with MS Word. .
I need to know how this can be done in java.. I don't mind using Open Office by sun .
Can some one help me on this one ... will really appriciate it.
Thanks,
sandsouza.
19 years ago
Hi,
I need to print a bunch of name and address as labels in java ... can someone tell me how this can be done in Java.
If I was using MS tecnologies then i would use OLE or something with MS Word. .
I need to know how this can be done in java.. I don't mind using Open Office by sun .
Can some one help me on this one ... will really appriciate it.
Thanks,
sandsouza.
19 years ago
Hi,
I was trying to implement the print function in my application.. basially i have a jbutton print and when clicked .. the specifed data should be formatted and printed.
I went throught the printjob and all that .. but the problem is I don't know how to build the page .. in the sense if I have some value on the varila AccID .. i want it to print
AccountID: value of(AccID)
AccountID1: value of(AccID1)
basically I need to know how to build the page..
can someone help me with this... I am building a swing application .. i need to print the data that is on the scree.
thanks,
sandeep
19 years ago
Hi,
I was wondering if it it possible to pass a Resultset ( got from a database) to a JDialog .. display it in a JTable in the Dialog .. and return back to the frame the row that is selected .

need some help on this one.. if possible give some sample code
Thanks.
19 years ago
Hi,
I am trying to do some work with Jtable but need to know if it can be done for sure before i go ahead with it.
I am trying to insert some data into a database table using JTable .... Intially when it starts the Jtable needs to start with only one row and .. and it needs to needs to add more rows one by one when one of the columns gets focus. there are totally 6 columns .. in which 3 of them are regular textfields .. but the other three.. when u enter the data it should be like a combo box. .. where u just select from the list .. and the options in the 2nd and 3rd combo boxes depend on the option chosen in the first one. that was when i eneter data into the databae ..
now when i need to display data .. the function should be somewhat the same .. the numbers of rows should be equal to the number of rows in the database ... and should be able to modify the data.
Can somebody who knows Jtable well tell me if this can be done ... and give me an idea as per how to do this one .
Thanks in advance ,
sandsouza
19 years ago
Hi,
A question about JTable .. I want to enter some into a database using Jtable ..
I was wondering if its possible to have a combo box as one of the fields( columns) in the Jtable and to add more rows when one particular column gets focus... so that user need to press the add row button each time .
can someone help me with is one ...
thanks,
Sandeep
19 years ago
no .. i got the answer
19 years ago