473,320 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to add jar file

hi,
to solve problem of Importing excel file in to JTable,I used
JTableReadTableModelTask class.
This class in not present in jdk version. Thats why I download one jar file named as...
datagrid-all.jar.

In enviornment variables,I set the classpath as
C:\datagrid\datagrid-all.jar

Now also my project give error as Can not find Class Symbol.

Is here any mistake to set the path.


Thanks,in advance.

Regards,
Vikas Sawant.
Mar 18 '09 #1
7 5272
r035198x
13,262 8TB
How are you compiling the source files?
Mar 18 '09 #2
Thanks for reply.

I am using Editor-JCreator and there is buttons for compilation and execution,which I used.
Mar 18 '09 #3
r035198x
13,262 8TB
Basically you need to tell your editor to use that jar as part of classpath when executing the javac command. How to do that may be documented in Jcreator's help (I don't use it and I don't know). If you can't find how you can always compile the files on the command line and provide the classpath yourself.
Mar 18 '09 #4
yes I make this modification.It works.My code for importing excel file is,

try {
String excelFileName = "Team1.xls";
File file = new File(excelFileName ); //‘file’ is the file you want to load.
JProgressBar progressBar = new JProgressBar(); //‘progressBar’ will show how much data it have loaded.
JTableReadTableModelTask task = new JTableReadTableModelTask(file,null,progressBar,mod el);
task.execute();
}
catch (IOException ex) {
System.out.println(ex.getMessage());
ex.printStackTrace();
}

but now it gives error that is,

D:\flb\Manual.java:1023: cannot find symbol
symbol : constructor JTableReadTableModelTask(java.io.File,<nulltype>,j avax.swing.JProgressBar,javax.swing.table.DefaultT ableModel)
location: class com.zfqjava.swing.JTableReadTableModelTask
JTableReadTableModelTask task = new JTableReadTableModelTask(file,null,progressBar,mod el);


What is the reason behind this error.

Thanks.
Mar 18 '09 #5
r035198x
13,262 8TB
See the error message. It's trying to hard to tell what the problem is.
Basically that the JTableReadTableModelTask class does not have a constructor with parameters which match the arguments that you are passing when calling that constructor.
Mar 18 '09 #6
This is the constructor definition which i get from API ,

public JTableReadTableModelTask(Object urlObject,
Map readProperties,
JProgressBar progressBar,
JTable table)

Parameters:
urlObject - a java.io.File or java.net.URL object
readProperties - ModelIO
progressBar - a progress bar to monitor the read process
table - the result TableModel will set to JTable


please tell me what is wrong in my constructor.

Thanks,
Vikas Sawant
Mar 18 '09 #7
r035198x
13,262 8TB
The error message that you got is telling you that you are passing a
javax.swing.table.DefaultTableModel where a JTable is expected.
Mar 18 '09 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
7
by: Joseph | last post by:
Hi, I'm having bit of questions on recursive pointer. I have following code that supports upto 8K files but when i do a file like 12K i get a segment fault. I Know it is in this line of code. ...
3
by: StGo | last post by:
How can i read/write file's custom attributs(like subject,author...) in C#??? Thanks :))
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
1
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved...
3
by: Shapper | last post by:
Hello, I created a script to upload a file. To determine the file type I am using userPostedFile.ContentType. For example, for a png image I get "image/png". My questions are: 1. Where can...
0
by: troutbum | last post by:
I am experiencing problems when one user has a document open through a share pointing to the web site. I use the dsolefile to read the contents of a particular directory and then display them in a...
0
by: thjwong | last post by:
I'm using WinXP with Microsoft Visual C++ .NET 69462-006-3405781-18776, Microsoft Development Environment 2003 Version 7.1.3088, Microsoft .NET Framework 1.1 Version 1.1.4322 SP1 Most developers...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.