Problem to create jar with images
Hello
I have a project, it's a frame with a panel that contains a image, I want to create a Jar, but I have to problems, if create a Jar and execute out the project folder, I can't see the images, if I use getClass().getResource, I have other problems, I can't add panels.
How it's difficult to say, I going to put a link from the project make with eclipse [My project|http://www.megaupload.com/?d=HBPHUWE9] , if someone wants have a look I would be grateful.
http://www.megaupload.com/?d=HBPHUWE9
Just look at the package com.constructor.interfaz
To make the jar use the class InterfazFactoriaPaneles
Thanks in advance !
Edited by: Dav1d on Jul 10, 2009 6:11 AM
Edited by: Dav1d on Jul 10, 2009 6:12 AM
I explain better:
I have a Class -> InterfazFactoriaPaneles, with this main
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
InterfazFactoriaPaneles application = new InterfazFactoriaPaneles();
application.getJFrame().setVisible(true);
in the Frame I add a JPanel with an image, to load the image I override this method, where com.constructor.imagenes, it's the path where I've got my images :
public void paintComponent(Graphics g){
Dimension tamanio = getSize();
ImageIcon imagenFondo = new ImageIcon("./src/com/constructor/imagenes/patronConstructor.jpg");
g.drawImage(imagenFondo.getImage(),0,0,tamanio.width,tamanio.height,null);
setOpaque(false);
super.paintComponent(g);
the with a menu, I remove the panel with the image I load other panel with components (JTextField, JTable, JLabel,...).
If run the program from eclipse, everything it's ok, if I export into jar file, it works if the jar it's inside the project folder, but if I put the jar in other location, doens't load images, I google from answer and I read to put images path like that: new ImageIcon(getClass().getResource("/com/constructor/imagenes/patronConstructor.jpg")); , but if I do that, and run in eclipse, everything it's ok, but If I export into a Jar, I load the image, but when I try to change to other panel it doesn't work.
So I do not what's the answer, if someone check my code, and try to make a jar, and the move the jar file into other location, will be able to see images doesn't appears.
Similar Messages
-
Problem while Creating MVLOG with synonym in Oracle 9i:Is it an Oracle Bug?
Hi All,
I am facing a problem while Creating MVLOG with synonym in Oracle 9i but for 10G it is working fine. Is it an Oracle Bug? or i am missing something.
SQL> select * from v$version;
BANNER
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL>
SQL> create table t ( name varchar2(20), id varchar2(1) primary key);
Table created.
SQL> create materialized view log on t;
Materialized view log created.
SQL> create public synonym syn_t for t;
Synonym created.
SQL> CREATE MATERIALIZED VIEW MV_t
2 REFRESH ON DEMAND
3 WITH PRIMARY KEY
4 AS
5 SELECT name,id
6 FROM syn_t;
Materialized view created.
SQL> CREATE MATERIALIZED VIEW LOG ON MV_t
2 WITH PRIMARY KEY
3 (name)
4 INCLUDING NEW VALUES;
Materialized view log created.
SQL> select * from v$version;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
PL/SQL Release 9.2.0.6.0 - Production
CORE 9.2.0.6.0 Production
TNS for Solaris: Version 9.2.0.6.0 - Production
NLSRTL Version 9.2.0.6.0 - Production
SQL>
SQL> create table t ( name varchar2(20), id varchar2(1) primary key);
Table created.
SQL> create materialized view log on t;
Materialized view log created.
SQL> create public synonym syn_t for t;
Synonym created.
SQL> CREATE MATERIALIZED VIEW MV_t
REFRESH ON DEMAND
WITH PRIMARY KEY
AS
2 3 4 5 SELECT name,id
FROM syn_t; 6
Materialized view created.
SQL> CREATE MATERIALIZED VIEW LOG ON MV_t
WITH PRIMARY KEY
(name)
INCLUDING NEW VALUES; 2 3 4
CREATE MATERIALIZED VIEW LOG ON MV_t
ERROR at line 1:
ORA-12014: table 'MV_T' does not contain a primary key constraintRegards
Message was edited by:
Avinash Tripathi
nullHi Nicloei,
Thanks for the reply. Actually i don't want any work around (Creating MVLOG on table rather than synonym is fine with me) . I just wanted to know it is actually an oracle bug or something else.
Regards
Avinash -
Problem in creating PDF with InDesign CS5.5
Problem in creating PDF with InDesign CS5.5:
exporting a file in pdf, setting "Press Quality" or "PDF/X-1a: 2001" and selecting "Crop Marks" and the surplus of xx mm, the elements contained in the MASTER page move from the original position or disappear at random.
Can you help me, please?
Thanks a lot.Try Remove minor corruption by exporting
-
Problem while creating xml with cdata section
Hi,
I am facing problem while creating xml with cdata section in it. I am using Oracle 10.1.0.4.0 I am writing a stored procedure which accepts a set of input parameters and creates a xml document from them. The code snippet is as follows:
select xmlelement("DOCUMENTS",
xmlagg
(xmlelement
("DOCUMENT",
xmlforest
(m.document_name_txt as "DOCUMENT_NAME_TXT",
m.document_type_cd as "DOCUMENT_TYPE_CD",
'<![cdata[' || m.document_clob_data || ']]>' as "DOCUMENT_CLOB_DATA"
) from table(cast(msg_clob_data_arr as DOCUMENT_CLOB_TBL))m;
msg_clob_data_arr is an input parameter to procedure and DOCUMENT_CLOB_TBL is a pl/sql table of an object containing 3 attributes: first 2 being varchar2 and the 3rd one as CLOB. The xml document this query is generating is as follows:
<DOCUMENTS>
<DOCUMENT>
<DOCUMENT_NAME_TXT>TestName</DOCUMENT_NAME_TXT>
<DOCUMENT_TYPE_CD>BLOB</DOCUMENT_TYPE_CD>
<DOCUMENT_CLOB_DATA>
<![cdata[123456789012345678901234567890123456789012]]>
</DOCUMENT_CLOB_DATA>
</DOCUMENT>
</DOCUMENTS>
The problem is instead of <![cdata[....]]> xmlforest query is encoding everything to give < for cdata tag. How can I overcome this? Please help.SQL> create or replace function XMLCDATA_10103 (elementName varchar2,
2 cdataValue varchar2)
3 return xmltype deterministic
4 as
5 begin
6 return xmltype('<' || elementName || '><![CDATA[' || cdataValue || ']]>
7 end;
8 /
Function created.
SQL> select xmlelement
2 (
3 "Row",
4 xmlcdata_10103('Junk','&<>!%$#&%*&$'),
5 xmlcdata_10103('Name',ENAME),
6 xmlelement("EMPID", EMPNO)
7 ).extract('/*')
8* from emp
SQL> /
<Row>
<Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
<Name><![CDATA[SMITH]]></Name>
<EMPID>7369</EMPID>
</Row>
<Row>
<Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
<Name><![CDATA[ALLEN]]></Name>
<EMPID>7499</EMPID>
</Row>
<Row>
<Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
<Name><![CDATA[WARD]]></Name>
<EMPID>7521</EMPID>
</Row>
<Row>
<Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
<Name><![CDATA[JONES]]></Name>
<EMPID>7566</EMPID>
</Row>
<Row>
<Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
<Name><![CDATA[MARTIN]]></Name>
<EMPID>7654</EMPID>
</Row>
<Row>
<Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
<Name><![CDATA[BLAKE]]></Name>
<EMPID>7698</EMPID>
</Row>
<Row>
<Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
<Name><![CDATA[CLARK]]></Name>
<EMPID>7782</EMPID>
</Row>
<Row>
<Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
<Name><![CDATA[SCOTT]]></Name>
<EMPID>7788</EMPID>
</Row>
<Row>
<Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
<Name><![CDATA[KING]]></Name>
<EMPID>7839</EMPID>
</Row>
<Row>
<Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
<Name><![CDATA[TURNER]]></Name>
<EMPID>7844</EMPID>
</Row>
<Row>
<Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
<Name><![CDATA[ADAMS]]></Name>
<EMPID>7876</EMPID>
</Row>
<Row>
<Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
<Name><![CDATA[JAMES]]></Name>
<EMPID>7900</EMPID>
</Row>
<Row>
<Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
<Name><![CDATA[FORD]]></Name>
<EMPID>7902</EMPID>
</Row>
<Row>
<Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
<Name><![CDATA[MILLER]]></Name>
<EMPID>7934</EMPID>
</Row>
14 rows selected.
SQL> -
Display problems in Mail messages with image attachment
Issue: Seeing intermittent display problems in Mail messages with image attachments
Annoyance level: minor, but Apple techs need to pass it along
Details: Regardless of mail client sending to iPhone (Outlook, OWA, Yahoo, Gmail) there are intermittent and what appear to be random occurrances of the pic being half rendered and/or the pic never loading (followed by message saying it can't be retrieved from server). In some instances the picture then appears fully rendered without a problem. Note: Image sizes varied from 14KB to 450KBHi,
I'm not familiar with C#, but if possible try the following:
1. Removing all thead and tbody tags from the body of the message.
2. Changing all inline CSS to embedded CSS.
I've seen a user said the message stopped showing up after making the changes.
If the issue persists, please note, since Outlook 2007, Outlook opens the HTML Email and converts it to Microsoft Word format before displaying it to the user. What happens during this process is that many CSS attributes and HTML support is completely removed.
Some of the most notable absences are background-image, and padding and margin support. Hardly can we do much about this, so the message "If there are problems with how this email is displayed, click here to view it in a web browser" is actually
a good workaround when we face this problem.
Regards,
Melon Chen
TechNet Community Support
It's recommended to download and install
Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
programs. -
Problem of creating workbook with permanent template?
Hi all,
Iam facing some problem while creating the workbook with permanent template.Let me expalin in detail.
I have created 3 queries (ex:Stock) and i have to insert these in one workbook with permanent template.I had selected the the permanent template option in settings also.iam able to insert the 3 queris and iam not getting the permanent tempalate.which is mandatory.
I tried saving the existing workbook with same tempalate and removed the query and tried to insert the queries but iam getting <b>abbort system error in program</b>
Pls help me out of this issue.
Thanks and regards,
RajeevHi Joe,
We've seen this error when using express VI's inside of template VI's which are loaded using VI server. Are you doing that? If yes, then take all the express VIs that are inside the template VI and turn them into static subVIs.
I don't know if it will help in your case, but let's try it.
Regards,
Luca
Regards,
Luca -
Creating PDF with IMAGE using CFDOCUMENT TAG
Hi Guys,
I m facing problem while creating the PDF using CFDOCUMENT
tag.
Actually my clients want the IMAGEs in PDF document.
Problem is most of the images in JPG format and while I am
going to attach images in PDF document it takes lots of time for
creating PDF. In most of time it cause timeout.
I have try to convert images JPG to PNG, yes I some what
better performance than JPG format but still it is work for 20 - 25
images. In my case I want to attach normally 50-100 images in PDF
(sometimes it is more 200).
PLZ, Help me.. F1...F1...F1
thanks in advance
Pritesh
Coldfusion ProgrammerI am having a similar and more serious problem. It takes a
long time to execute, but even attaching a small image balloons the
pdf to 6MB plus. After a few images it gets up to 20MB. These are
100k jpeg files being attached. The resulting PDF is too large to
email or process effectively. Does anyone know how to reduce
size/processing? -
Problem when creating contract with foreign trade / customs
Hi,
I encountered a problem when creating contract / outline agreement.
I used ME31K to create a contract with a vendor outside of our country. I suppose that I should be able to see "Foreign Trade / Customs" in "Header" menu, but this entry is gray, I cannot enter it.
I tried to create a scheduling agreement using ME31L with the same vendor and material, I can see "Foreign Trade / Customs" information. I suppose these two process are similar, aren't they?
Btw., I checked the master data according to this thread:
http://help.sap.com/saphelp_46c/helpdata/en/ed/3b6cc697e711d1b4e20000e82d81b0/content.htm
Can anyone give me some hint?
Thanks!
CharlieThese two processes are different:
The Contract agreement or the Outline Agreement is that create the centrally contract (cross-plant) where it can maintain different pricing conditions for each and every plant. It creates the Release Order with reference to Outline Agreement. No detailed delivery schedule can be made in the Release Order. No Release documentation is created. Only time-dependent conditions can be created, Some Item Category 'M' and 'W' can be used.
Whereas the Scheduling Agreement is the Plant Location what must be entered in the Scheduling Agreement. Its no need to create any other purchasing document except for delivery schedule line via Transaction ME38 or MRP running (with the appropriate setting of Source List). Delivery Schedule line items are created subject to your specific requirement. It can create both Scheduling Agreement with or without release of Documentation (subject to the Document Type LP or LPA) with the selection of either FRC or JIT delivery schedule. Either time-dependent or time-independent conditions can be created subject to the customizing in the Document Type of the Scheduling Agreement. Item Category 'M' and 'W' can not be used. -
Problem when creating Database with Database, OS and hardware Configuraiton
Problem when creating Database:
There are two problems, which I faced during creation of database. When creating database with Oracle Database Assistant. One when creating pre tuned database from CD. And second when creating customized database giving options your self.
Problem # 1:
When creating pre tuned database from CD. The process of creating Database is 90 % complete and is at step # 3 Initializing Database. It gives error ORA-03113: end-of-file on communication channel.
I searched following oracle help for this problem.
ORA-03113: end-of-file on communication channel
Cause: An unexpected end-of-file was processed on the communication channel. The problem could not be handled by the Net8, two-task software. This message could occur if the shadow two-task process associated with a Net8 connect has terminated abnormally, or if there is a physical failure of the interprocess communication vehicle, that is, the network or server machine went down.
Action: If this message occurs during a connection attempt, check the setup files for the appropriate Net8 driver and confirm Net8 software is correctly installed on the server. If the message occurs after a connection is well established, and the error is not due to a physical failure, check if a trace file was generated on the server at failure time. Existence of a trace file may suggest an Oracle internal error that requires the assistance of customer support.
Conclusion:
What I conceive from this problem and the help available is that, I have to install NET8 again. But I am not sure about the solution, please tell me whether I am rite or not.
Problem # 2:
When creating database with custom option. The process of creating Database is 2 % complete and is at step # 2 Creating Database Files. It gives error ORA-12571: TNS:packet writer failure.
I searched following oracle help for this problem.
ORA-12571: TNS:packet writer failure
Cause: An error occurred during a data send.
Action: Not normally visible to the user. For further details, turn on tracing and re-execute the operation. If error persists, contact Worldwide Customer Support.
Conclusion:
What I conceive from this problem and the help available is that, I have to install NET8 again. But I am not sure about the solution, please tell me whether I am rite or not.
Software & Hardware Configuration are as follow:
Software:
Database
Oracle 8.1.7.0.0 (Oracle8i)
Operating System
Microsoft Windows 2000
5.00.2195
Service Pack 2
Hardware:
x86 Family 6 Model 8 stepping
10
AT/AT COMPITABLE
260,400 KB RAMuser563502 wrote:
I am working on Solaris 8. What is Alert_SID.log? where can I find it?
ThanksFor the responsible of the upgrade of Oracle database, not even know what Alert log is?
to be honest with you, this is not your work. -
Problem to create database with RAC 10g with Oracle Standard Edition
I install CRS (Cluster Ready Services), and then install Oracle 10g database. Also, I install patches 10.1.0.4. When I create database with ASM storage give me a error to create files database.
Any idea?
Thanks
Edu AlcañizYou were right.
http://download-uk.oracle.com/docs/html/B14203_05/intro.htm#sthref44
under the section
"1.3 Configuration Tasks for Oracle Clusterware and Oracle Real Application Clusters"
"... If you use RAC on Oracle Database 10g Standard Edition, then you must use ASM."
Thanks, problem solved.
- Vegard -
How to compile and creat JAR with native function
Hi there,
I wrote some native function for J2ME. But it seems like using J2ME wireless Toolkits, we can not compile native function. Is it right?
Is anyone knowing how to compile and make JAR with J2MEWTK or command line?
Thanks,
Merry Christmas!![zack327],
JNI like or native interfaces APIs is not supported in the CLDC/MID Profile 1.0 specification. If you have J2ME code that includes JNI code, the J2MEWTK tool will not compile successfully for you.
To package the compiled code to a MIDlet suite .jar file, use the 'Package' command in the J2MEWTK toolkit. It is found on the top menu bar 'Project' option as item on the dropdown list.
To package the MIDlets into a MIDlet suite .jar file from the command line, you can execute the usual jar file command:
jar cf MyMIDletSuite.jar Midlet.class
You will also need to create a MIDlet .jad Application Descriptor file as well.
HTH.
Allen Lai
Developer Technical Support
SUN Microsystems
http://www.sun.com/developers/support/ -
Create jar with nested jars progammatically
Hello,
I want to create a jar which will contain other (nested) jars, and then I want my main class (inside the created jar) to make use of classes within the nested jars. And all this, I want to do programmatically (e.g. using Runtime.exec()). Is this possible?
Thanks,
Edited by: 925181 on Apr 3, 2012 4:41 AM
Edited by: 925181 on Apr 3, 2012 4:46 AMAnd all this, I want to do programmatically (e.g. using Runtime.exec()).I don't understand this part of the question. What will you be doing with Runtime.exec()?
-
Problem while creating JAR file for my swing application
Hi...
Using my swings application I am trying to Run different software�s .
My program is Running fine from command prompt. If I create JAR file
It is giving error like �Failed to load Main-Class manifest attribute from .jar�
Can anybody help me to creating JAR file
Thanks in advance
Cheers
Mallikhi,
User following command
jar-cmf textfile_name.txt Jarfile_name *
here you have to make manifest file
and making jar file you have reach there by command promt
and manifest file have some constraint also as well as format
format are
Manifest-Version: 1.0
Class-path: jar file name which are using in app separed by space
Created-By: 1.5.0 (Sun Microsystems Inc.)
Main-Class: Main class name
and end of file is not have carriage return -
Problem in creating users with password restrictions
I have enabled the following option in the Authentication>Enterprise tab of CMC.
Must contain at least N Characters and specified N as 7
Enforce mixed-case passwords
However I am able to create user with password as abcd.
Please suggest.
Thanks in AdvanceI might be missing something but the rule applies to users changing their pw not administrators creating accounts. If the administrator sets this rule it would be thought/assumed that they would enforce their own rule when creating accounts. The users however should not be able to select 4 character passwords.
I'll run some tests and see if I find out anything different.
Tested this on XIR2 SP4 and XI 3.0 The rules apply to the user not the administrator creating the account.
So create an account while the 7 character pw is enabled. By default the user logs in with the pw (any amount of characters) and is prompted to change their pw. They cannot choose anything less than 7 characters. So unless an administrator creates an account with a password less than 7 characters AND deselects the option to force a pw change. All new users will be forced to select a 7 character password.
This is by design. If it forced the administrator to create accounts without a 7 character pw they could simply deselect the options(as administrators) so there is no security in forcing this.
Regards,
Tim
Edited by: Tim Ziemba on Aug 13, 2008 5:28 PM
Edited by: Tim Ziemba on Aug 13, 2008 5:33 PM -
Net_PRICE problem while creating PO with BAPI_PO_CREATE1 ***ASAP
Dear All,
While creating PO with bapi BAPI_PO_CREATE1, The net price is not populating, though the logic is correct, as when i change the net price to some otrher value of in the bapi, while debugging, it is taking the Net price, but in general run, the price is over written by Gross price in PO, Please Help, Its Urgent.
Any Sample codes are welcomed, where Net_price is used.
Thanks in Advance..
Rewards Guaranteed.Dear All,
While creating PO with bapi BAPI_PO_CREATE1, The net price is not populating, though the logic is correct, as when i change the net price to some otrher value of in the bapi, while debugging, it is taking the Net price, but in general run, the price is over written by Gross price in PO, Please Help, Its Urgent.
Any Sample codes are welcomed, where Net_price is used.
Thanks in Advance..
Rewards Guaranteed.
Maybe you are looking for
-
How to make a good gradient?
What am I not understanding here? I want my gradient to look like this: I adjust the gradient controls (left) to something close to this, but the rectangle (right) looks noting like it: How do I get a smooth, wide gradient insted of a narrow band lik
-
I have Lion 10.7.2 and use Safari 5. When I get online and open a website, then go to a new website Safari will take me right back to the previous site automatically. I have reset Safari and there is not an issue with the interenet access. Went to
-
XML not well formed in - XSLT mapping
Hi, I am doing a simple xslt mapping wherein my Source data structure is MT |__ details |__ Records |_emp_no |_ emp_name |_emp_dno In XSL file i hv specified <xsl:template match="MT"> and
-
New to the product - question about validating multiple fields as a group
I have a static form that I'm building from a word document. Part of that form requires a person to fill any 3 out 5 text fields. Since it looks like scripts are applied on a field by field basis, is it possible to have a script that encompasses mul
-
ISE machine authentication - only plug in to the network after booting
Hi experts. I have recently deployed ISE with machine authentication. However, when the machine is already plugged in to the switch before booting, the machine does not authenticate automatically. It isn't until I log on, using a local computer acco