forcing java functions to execute in sequence??
-
any idea how to do it , as i have a main Jframe and another data frame which previews and print the data in JTable ,now my problem is when i execute my code to print then flush the jtable data, it works vice-versa, as it flushes all the data in jtable then shows the preview frame. it is as:
{
functionshow_print_preview();
functionflush_table_and_refresh();
} -
any idea how to do it , as i have a main Jframe and another data frame which previews and print the data in JTable ,now my problem is when i execute my code to print then flush the jtable data, it works vice-versa, as it flushes all the data in jtable then shows the preview frame. it is as:
{
functionshow_print_preview();
functionflush_table_and_refresh();
}Java will execute the code in the exact same order as you write it. So if you have the calls to those two functions below one and other like:
{ functionshow_print_preview(); functionflush_table_and_refresh(); }
then they will be called in the following order:- functionshow_print_preview
- functionflush_table_and_refresh
The only thing I can think of is that you start a seperate thread somewhere within either of these two functions causing them to be executed out of sync.
-
Java will execute the code in the exact same order as you write it. So if you have the calls to those two functions below one and other like:
{ functionshow_print_preview(); functionflush_table_and_refresh(); }
then they will be called in the following order:- functionshow_print_preview
- functionflush_table_and_refresh
The only thing I can think of is that you start a seperate thread somewhere within either of these two functions causing them to be executed out of sync.
see that is the problem , i know it has to be this way but priview shows as a blank jtable as the number 2 executes while first is in middle of execution (taking the jtable data of mainframe), any solution??......
-
Java will execute the code in the exact same order as you write it. So if you have the calls to those two functions below one and other like:
{ functionshow_print_preview(); functionflush_table_and_refresh(); }
then they will be called in the following order:- functionshow_print_preview
- functionflush_table_and_refresh
The only thing I can think of is that you start a seperate thread somewhere within either of these two functions causing them to be executed out of sync.
you're right - and not right. The methods are called in this order, but the printer job takes some more time. In the meanwhile the table is deleted. @ Alok try to return a value from the print job, a signal to mark when the job is done. Set up a loop (or use another thread) which interrupts the code as long as the print job takes. regards Torsten
I never finish anyth...
-
you're right - and not right. The methods are called in this order, but the printer job takes some more time. In the meanwhile the table is deleted. @ Alok try to return a value from the print job, a signal to mark when the job is done. Set up a loop (or use another thread) which interrupts the code as long as the print job takes. regards Torsten
I never finish anyth...
k i will try that.......