Loading files asynchronously using SwingWorker: method communication proble
In my GUI app I have two methods load() and parse() that handle correspondingly reading from file operation and parsing that file into my internal data structure. load() method makes use of SwingWorker class and therefore once I enter SwingWorker#done() i must somehow call parse() method. I can not do it from SwingWorker#done() directly because this is logically wrong to call parse form load
So can you give me some advice on what is best way to call parse()?
Move calls of load() and parse() into SwingWorker#done()I think you need to read the SwingWorker documentation again, and more carefully.
-- doInBackground is executed on a Worker thread
-- done is executed on the EDT.
Neither your load nor parse calls should be executed on the EDT, so put them in doInBackground.
done will be automatically invoked when doInBackground returns, and is the right place to include code for updating the GUI when the background process is completed.
luck, db
Similar Messages
-
Hi Experts,
How can i get a file header using this method cl_gui_frontend_services=>gui_download
Thanks
BasuHi,
You can use the FM - GUI_DOWNLOAD to specify the headers. It can be done in the following manner -
TYPES: BEGIN OF ty_head, "Structure for header
h(10) TYPE c,
END OF ty_head.
DATA: it_head TYPE TABLE OF ty_head WITH HEADER LINE.
"Adding header details
it_head-h = 'Field1'.
APPEND it_head.
it_head-h = 'Field2'.
APPEND it_head.
it_head-h = 'Field3'.
APPEND it_head.
it_head-h = 'Field4'.
APPEND it_head.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = p_file
filetype = 'ASC'
write_field_separator = 'X'
header = '00' "<= note this
TABLES
data_tab = it_tab
fieldnames = it_head[] "<= Pass your header table here
EXCEPTIONS
OTHERS = 1.
Hope this helps.
Regards,
Himanshu -
problem with download for photo elements 12. got message as I downloaded file 2 (using alt method) that I was miss the "file archive"
Firstly, there's no such thing as Apache 9.3, there's Apache 1 (and subversions) and Apache 2 (and subversions). Your error message -
Oracle-HTTP-Server/1.3.28Shows you're using Apache 1.3.28
Secondly, I'm confused by your comment -
I do not have Apache 9.3 or higher but I think oracle should offer this in its companion CDOracle does offer the Apache server, if you're saying you didn't get it from Oracle then where did your Apache server come from?
Thirdly, I notice from your config file -
ErrorLog "|E:\oracle\product\10.1.0\Companion\Apache\Apache\bin\rotatelogs logs/error_log 43200"That you're piping the logs through rotatelogs, are you sure the logfiles haven't just been renamed? -
Help please: given the following
all class have the same RID
class A
class B derived from class A
class C derived from class A
Is there a way to have classes A,B,C in separate load file without using the Shareable interface communications mechanism. Could we create our own SecurityDomain to allow load files to link to each other.From the server: make a URL point�ng to the file and open a stream to it.
http://java.sun.com/j2se/1.3/docs/api/java/net/URL.html#openStream() -
Connect to Unix and load files
Can I connect to Unix and load files without using agent on Unix?
what I mean to connect directly to unix to load file from unix to Oracle database without using any agnets on Unix just by using server username and password
Please help !!!
Edited by: user653098 on Sep 5, 2010 11:45 AMOne way i can think of is if the Files are in the same Server where the ODI Server . Launch the ODI Designer of the Server(using VNC or any other application ) and use the Local agent to load the data from Unix to database. Other than this you would need to have an Agent to communicate from your Client windows Machine and Unix box.
-
Change file mode using java?
Hi
Can I change file mode using java method other than
Runtime.exec()
thx
JacinleHi
Thank you Roopasri. But what I want is not using Runtime.exec
I am using Unix and I want to change some image file access mode
so not a RandomAccess File.
So is there anything like chmod command on Unix?
something like maybe java.io.File.chmod("755");
I read that's a feature requested early on 1.2
Will it be included in 1.4?
Jacinle -
Using getResource() to load file from a war
Hi:
I am using the method getResource() of ServletContext to load "web.xml"
file from a webapp.
It works fine when my web application is not packed into a war file. But
when I pack it in a war file, I got MalformedURLException.
Does anyone know the reason?
Fun
Thanks Mahendra, I checked my weblogic.properties, and it looks fine.
fun
Mahendra Dhamdhere wrote:
> Is your deployed application name in weblogic.properties same as your
> previously deployed web application name?
>
> Fun <[email protected]> wrote in message
> news:[email protected]..
> > Hi:
> >
> > I am using the method getResource() of ServletContext to load "web.xml"
> > file from a webapp.
> >
> > It works fine when my web application is not packed into a war file. But
> > when I pack it in a war file, I got MalformedURLException.
> >
> > Does anyone know the reason?
> >
> > Fun
> >
-
Load property file in init(PortletConfig) method of JSR 286 portlet
I store my configuration in .properties file. Now I want to load this file only once, so I decided to load it in init(poerletConfig) method. But now I'm confused to where to put this file, so it can be loaded in this method. I'm using following code:
Properties properties = new Properties();
try {
properties.load(new FileInputStream("which_path_to_give_here")); // not sure where to put property file and how/which path to give here?
} catch (IOException e) {
System.out.println(e.getMessage());
}Friend i think you are trying to reinvent the wheel again...
To my knowledge liferay provides a utility class for FileUpload by default.
Guess U need to add portlet-ear.jar along with the application you programme.
Hope you could have seen admin portlet already where we would upload company logo.. hope you remeber tht....
I've Posted the code behind(ActionClass) it in the below post
http://forum.java.sun.com/thread.jspa?threadID=5160308&messageID=9610263#9610263
it would be great if you can make use of StrutsPortlet class provided by liferay and configure your porlet.xml accordingly & then write an PortletAction class & then create its action mapping in struts-config.xml.
and the reason why i'm stressing with that approach was sometimes The FileUpload Components may not be compatible different Portlet Containers
Hope that might help :)
and a small advice liferay does have their devoloper zone where you have user communities.Im sure you might get a better reply from their side too.
REGARDS,
RaHuL -
Recently my adobe is taking much longer to load PDF files that used to open immediately
recently my adobe is taking much longer to load PDF files that used to load almost instantly
Look at this comprehensive trouble shooting document;
https://discussions.apple.com/docs/DOC-3353
I suggest that you start with SMC and PRAM resets.
Then a Safe Boot.
Ciao. -
Can i use 2 methods to deploy icon files in Oracle IDS?
Dear all,
I'm using Oracle 9IDS(Forms) and i'm trying to use 2 methods to deploy icon file:
-In development phase, i use defaul.icon.path and defaul.icon.extension in registry.dat file and imagebase=documentbase. My icon are well deploy when i run application from form builder.
-In deployment phase, on the same plateform, i use jar file following these steps:
1- I store jar file in same directory with all runtime files(fmx, mmx, etc.)
2- i create a virtual path(/forms90/Tel/) to map with this directory
3- in formsweb.cfg, i put the following line:
[myapp]
imagebase=codebase
archive_jini=f90all_jinit.jar,/forms90/Tel/images.jar
When i call my application directly (http://localhost:8889/forms90/f90servlet?config=myapp),
icons don't appear.
I would like to know, what's wrong?It's possible to use theses both methods for deploy icons on the same plateform?
Thank u for your helpHi Franck,
I thank that red correctly the document(how deploy icon on web).But that isn't the matter.I update my formsweb.cfg as you advise me
[myapp]
archive_jini=...,/forms90/images.jar
imagebase=codebase
Icon don't appear at runtine while other gif files(splashscreen,logo) appear.Notice these others gif files are compressed in the same jar file. Notice also, that when i use default.icon.path parameter in registry.dat file, icons are well deployed.
It's incomprehensible.
Thanks you for your help! -
SQL Loader : Loading multiple tables using same ctl file
Hi ,
We tried loading multiple tables using the same ctl file but the data was not loaded and no errors were thrown.
The ctl file content is summarised below :
LOAD DATA
APPEND INTO TABLE TABLE_ONE
when record_type ='EVENT'
TRAILING NULLCOLS
record_type char TERMINATED BY ',' ,
EVENT_SOURCE_FIELD CHAR TERMINATED BY ',' ENCLOSED BY '"',
EVENT_DATE DATE "YYYY-MM-DD HH24:MI:SS" TERMINATED BY ',' ENCLOSED BY '"',
EVENT_COST INTEGER EXTERNAL TERMINATED BY ',' ENCLOSED BY '"',
EVENT_ATTRIB_1 CHAR TERMINATED BY ',' ENCLOSED BY '"',
VAT_STATUS INTEGER EXTERNAL TERMINATED BY ',' ENCLOSED BY '"',
ACCOUNT_REFERENCE CONSTANT 'XXX',
bill_date "to_date('02-'||to_char(sysdate,'mm-yyyy'),'dd-mm-yyyy')",
data_date "trunc(sysdate)",
load_date_time "sysdate"
INTO TABLE TABLE_TWO
when record_type ='BILLSUMMARYRECORD'
TRAILING NULLCOLS
RECORD_TYPE char TERMINATED BY ',' ,
NET_TOTAL INTEGER EXTERNAL TERMINATED BY ',' ENCLOSED BY '"',
LOAD_DATE_TIME "sysdate"
INTO TABLE BILL_BKP_ADJUSTMENTS
when record_type ='ADJUSTMENTS'
TRAILING NULLCOLS
RECORD_TYPE char TERMINATED BY ',' ,
ADJUSTMENT_NAME CHAR TERMINATED BY ',' ENCLOSED BY '"',
LOAD_DATE_TIME "sysdate"
INTO TABLE BILL_BKP_CUSTOMERRECORD
when record_type ='CUSTOMERRECORD'
TRAILING NULLCOLS
RECORD_TYPE char TERMINATED BY ',' ,
GENEVA_CUSTOMER_REF CHAR TERMINATED BY ',' ENCLOSED BY '"',
LOAD_DATE_TIME "sysdate"
INTO TABLE TABLE_THREE
when record_type ='PRODUCTCHARGE'
TRAILING NULLCOLS
RECORD_TYPE char TERMINATED BY ',' ,
PROD_ATTRIB_1_CHRG_DESC CHAR TERMINATED BY ',' ENCLOSED BY '"',
LOAD_DATE_TIME "sysdate"
Has anyone faced similar errors or are we going wrong somewhere ?
Regards,
SandipanThis is the info on the discard in the log file :
Record 1: Discarded - failed all WHEN clauses.
Record 638864: Discarded - failed all WHEN clauses.
While some of the records were loaded for one table.
Regards,
Sandipan -
In SharePoint 2010, I am trying to copy pdf file programmatically from a non-RMS protected document library into RMS protected library using copyTo() method.
But I am getting an error while doing so. it gives error as mentioned below -
This library does not accept files of the given type. You must either upload a
new, unprotected file that supports rights management or re-upload a document
that was previously downloaded from this library.
Please suggest some solution.
Thanks,Are You sure that you have give 'PDF' in caps in your program? and check whether you are getting all the datas before calling the method.
in my program, i have used like this and it is working fine for me,
I am getting PDF content from the form...
DATA ls_formoutput TYPE fpformoutput.
DATA pdf_content TYPE solix_tab.
DATA lp_pdf_size TYPE so_obj_len.
DATA lv_mail_title TYPE so_obj_des.
*Attach the PDF .
lp_pdf_size = XSTRLEN( ls_formoutput-pdf ).
pdf_content = cl_document_bcs=>xstring_to_solix(
ip_xstring = ls_formoutput-pdf ).
document->add_attachment(
i_attachment_type = 'PDF'
i_att_content_hex = pdf_content
i_attachment_size = lp_pdf_size
i_attachment_subject = lv_mail_title ) . -
How to upload file using *cl_gui_frontend_services* method
hi
i want to upload an image file using this method
and i want to save it in MIME Repository (/SAP/BC/BSP/SAP/PRASHANT)
DATA:
itab TYPE TABLE OF sflight.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = 'C:\temp\winter.jpg'
filetype = 'ASC'
has_field_separator = '|'
CHANGING
data_tab = itab
IF sy-subrc = 0.
WRITE:/ 'success'.
ENDIF.
So plz tel me how i set given path to upload file using this method .Hi Prashant,
Go through the [Link|https://forums.sdn.sap.com/click.jspa?searchID=24477690&messageID=6684222].
Hope this is helpful.
Regards,
Abhinav -
ABAP List Faxing using BCS method ( Business communication service )
Experts,
I have a requirement where we are faxing the ABAP list as it gets generated .
I am using NEW-PRINT ON and NEW-PRINT OFF , to get the ABAP list in a spool request , and then get the spool contents using function module : 'RSPO_RETURN_SPOOLJOB'
I then use Class / methods provided by Business communication service , such as :
cl_cam_address_bcs=>create_fax_address ,to send this spool content to Fax gateway .
My fax goes , but the fax output list is in X_65_255 format, whereas i want the fax output to be in X_65_132 ..
My REPORT statement does have X_65_132 as line count / line size BUT somehow the Fax output does not take this list format .. ANY IDEA's ????
Would appreciate your reply .
AshutoshNaimesh,
I have passed page format X_65_132 in GET_PRINT_PARAMETERS , in export paramter ' Layout ' ... See code below :
write a list into spool
call function 'GET_PRINT_PARAMETERS'
exporting
line_count = sy-linct
line_size = sy-linsz
layout = 'X_65_132' <<< Page format
mode = 'BATCH'
immediately = ' '
list_text = htext_spool
list_name = 'ZV46 FAX'
no_dialog = 'X'
importing
out_parameters = print_parameters
valid = valid
exceptions
archive_info_not_found = 1 .
BUT still the fax coming out of our fax machine is compressed because i believe the outgoing fax is using page format X_65_255 .
Any idea why ????
Would appreciate your reply .
Ashutosh -
Loading File name and file contents into two separate tables using Sqlloadr
Hi All,
I have situtation like to load File contents into One table and File name into one table . File comes with .txt extension
Example :
File name : product_09_abc.txt
File contents :
Productcode
ABC
CDE
EFT
Can you please help me out this how can we acheive this using SQLLOADER.SQL*Loader will not pass through the filename for you to be able to insert into a table.
You will need to have a controlling o/s script that picks up the file name, calls sql*loader and then also call's an SQL script (using sql*plus?) to insert the filename into a.n.other table.
Maybe you are looking for
-
How do i restore apps on my MacBook Pro?
How do I restore apps on my MacBook Pro? Such as iphoto. I'm running on OSX 10.6.8
-
My loop statement in smartforms seems not to be working...
Hello Experts, I am currently practicing smartforms and I am trying to display the records of my internal table. What I did was in my table under MAIN window I have put the statement: it_spfli into wa_spfli and also in my main area of my table I have
-
Display pdf meta data in search results
I'm using the built in search function of Sun One web server 6.1 to catalog a directory that contains a large number of scientific journal article in pdf format. In each pdf file the title of the journal article and the author name is contained in th
-
Nano 6th gen. will not keep accurate time.
Every time I turn it on the time is wrong and the second hand is stuck.
-
Error on page when opening Web data forms
Hi! Whichever web form I open in my application, I get the message "Error on page" in the bottom left and I cannot see the business rules attached to the form. This issue appeared just a few minutes ago and it was ok earlier. I will be very grateful