Load in a image to a class
Hi.
Im a newbie on java and want some help, im trying to load in a image(gif) from my hardrive into a class, and draw it on the screen.
I know how to do it with swing, but just want to do it with awt.
And i dont want too use applet, is this possible??
/Blomman
Thx Steve i managed to do it, with a toolkit etc, but
i didnt use canvas.Yeah, Canvas is just one way to go (the most common if you just want an image you can pick up and move around) but just about any visible component works...
>
Yes im doing an Applet, but i just vant too make the
classes first, and get them too work, im making a game
and the applet just gonna run all kinds of classes, i
dont know if this is the best way too do it, im
learning ;).Apps are much easier to work with, since you don't have to worry about security, compatability, and such, but keep in mind a couple of things:
If you are going to use Applet you will not be able to use the Toolkit, you will Have to use the Applet's getImage method. So you will have to change the code.
You will not be able to read/write from Files in an Applet without a lot of security issues and permission problems...
>
I dont want too use swing either, cause in the future
my dream is too make this app a midlet too..;)Completely understandable when working with Applets and stuff since MS JVM won't use Swing, but for stand alone apps, like I had thought you were doing, swing is the way to go...
>
/Blomman
Similar Messages
-
How to load a Jar file in the class path?
How to load a Jar file which contains class files, images, etc.. in the classpath without using URLClassLoader.
You don't "load" jars. If it's on the classpath, you can obtain individual resources from it using various methods on either Class or ClassLoader. Do you mean "how to add a jar to the classpath at runtime"? Can't be done without using a classloader, typically URLClassLoader or a subclass thereof. Why you want to not use the proven method is beyond me. Presumably because you don't understand classloading. In which case, forget it.
-
How to load a background Image on a JDialog object
Hi All, Actually i am new to java programing and i am stuck in this problem. I am developing a java application which is dialog based (using JDialog objects) and i want to load a background image on my dialog. I hope this could be done and i really appreciate your help because i must deliver this project and this is a user interface requirement.
Try something along the lines of this: Create a new class called BackgroundImagePanel and have it extend JPanel.
Have an attribute in the class for your image, and a method to set it.
Override isOpaque() to return true.
Override the paintComponenet method as such:
public void paintComponent (Graphics g) {
super.paintComponent(g);
if( image == null ) return;
Icon icon = new ImageIcon(image);
icon.paintIcon(this, g, x, y);
Add this panel to your JDialog and then add other component to this panel.
You might have to tweak this a bit, but it should get you close...
Bill -
How to load a PNG image from a location in CF card
Hi,
I am using WTK 2.5.2. I wanted to load a PNG image to Image object. The image is loaded when I have it in the classes folder. But I want to select different image from a different location. If I try to open an Image to createImage(String) from a different location, I get IOException.
Please help me.
Thanks
Deekshit MI got the answer, I should be using Image.createImage(InputStream) API. It works fine.
Thanks
DM -
JDeveloper 11g just displays Loading... image only
Hi,
I am having problem in testing my web application. i m using JDeveloper 11g 11.1.1.0.0 and ADF faces.
the problem occurs whenever i run my web application. the browser displays white page with Loading... image and keeps showing this image and nothing else happen.
this happened when i build my web from scratch but when i used applications workspace that i downloaded from the tutorial websites the problem does not happen.
any help would be appriciated.here is my Log file...... plz suggest any solution ....... i tried my application on different machine as well not working.....
C:\oracle\Middleware\jdeveloper\system\system11.1.1.0.31.52.05\DefaultDomain\bin\startWebLogic.cmd
[waiting for the server to complete its initialization...]
JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m -XX:MaxPermSize=192m
WLS Start Mode=Development
CLASSPATH=;C:\oracle\MIDDLE~1\patch_wls1030\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1\patch_cie660\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1\JDK160~1\lib\tools.jar;C:\oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.jar;C:\oracle\MIDDLE~1\modules\features\weblogic.server.modules_10.3.0.0.jar;C:\oracle\MIDDLE~1\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~1\modules\ORGAPA~1.5/lib/ant-all.jar;C:\oracle\MIDDLE~1\modules\NETSFA~1.0_1/lib/ant-contrib.jar;C:\Oracle\Middleware\jdeveloper\modules\features\adf.share_11.1.1.jar;;C:\oracle\MIDDLE~1\WLSERV~1.3\common\eval\pointbase\lib\pbclient57.jar;C:\oracle\MIDDLE~1\WLSERV~1.3\server\lib\xqrl.jar;;
PATH=C:\oracle\MIDDLE~1\patch_wls1030\profiles\default\native;C:\oracle\MIDDLE~1\patch_jdev1111\profiles\default\native;C:\oracle\MIDDLE~1\patch_cie660\profiles\default\native;C:\oracle\MIDDLE~1\WLSERV~1.3\server\native\win\32;C:\oracle\MIDDLE~1\WLSERV~1.3\server\bin;C:\oracle\MIDDLE~1\modules\ORGAPA~1.5\bin;C:\oracle\MIDDLE~1\JDK160~1\jre\bin;C:\oracle\MIDDLE~1\JDK160~1\bin;C:\oracle\FRHome_1\jdk\jre\bin\classic;C:\oracle\FRHome_1\jdk\jre\bin;C:\oracle\FRHome_1\bin;C:\oracle\FRHome_1\jlib;C:\oracle\BIToolsHome_1\jdk\jre\bin\classic;C:\oracle\BIToolsHome_1\jdk\jre\bin;C:\oracle\BIToolsHome_1\jlib;C:\oracle\BIToolsHome_1\jre\1.4.2\bin\client;C:\oracle\BIToolsHome_1\jre\1.4.2\bin;C:\DevSuiteHome_1\jdk\jre\bin\classic;C:\DevSuiteHome_1\jdk\jre\bin;C:\DevSuiteHome_1\jdk\jre\bin\client;C:\DevSuiteHome_1\jlib;C:\DevSuiteHome_1\bin;C:\DevSuiteHome_1\jre\1.4.2\bin\client;C:\DevSuiteHome_1\jre\1.4.2\bin;C:\oracle\product\10.1.0\db_1\bin;C:\oracle\product\10.1.0\db_1\jre\1.4.2\bin\client;C:\oracle\product\10.1.0\db_1\jre\1.4.2\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\oracle\MIDDLE~1\WLSERV~1.3\server\native\win\32\oci920_8
* To start WebLogic Server, use a username and *
* password assigned to an admin-level user. For *
* server administration, use the WebLogic Server *
* console at http:\\hostname:port\console *
starting weblogic with Java version:
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode)
Starting WLS with line:
C:\oracle\MIDDLE~1\JDK160~1\bin\java -client -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m -XX:MaxPermSize=192m -Xverify:none -da -Dplatform.home=C:\oracle\MIDDLE~1\WLSERV~1.3 -Dwls.home=C:\oracle\MIDDLE~1\WLSERV~1.3\server -Dweblogic.home=C:\oracle\MIDDLE~1\WLSERV~1.3\server -Ddomain.home=C:\oracle\MIDDLE~1\JDEVEL~1\system\SYSTEM~1.05\DEFAUL~1 -Doracle.home=C:\Oracle\Middleware\jdeveloper -Doracle.security.jps.config=C:\oracle\MIDDLE~1\JDEVEL~1\system\SYSTEM~1.05\DEFAUL~1\config\oracle\jps-config.xml -Doracle.dms.context=OFF -Djava.protocol.handler.pkgs=oracle.mds.net.protocol -Dweblogic.management.discover=true -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=C:\oracle\MIDDLE~1\patch_wls1030\profiles\default\sysext_manifest_classpath;C:\oracle\MIDDLE~1\patch_jdev1111\profiles\default\sysext_manifest_classpath;C:\oracle\MIDDLE~1\patch_cie660\profiles\default\sysext_manifest_classpath -Dweblogic.Name=DefaultServer -Djava.security.policy=C:\oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.policy weblogic.Server
<Aug 4, 2009 7:36:58 AM GMT-06:00> <Notice> <WebLogicServer> <BEA-000395> <Following extensions directory contents added to the end of the classpath:
C:\oracle\Middleware\patch_wls1030\profiles\default\sysext_manifest_classpath\weblogic_ext_patch.jar;C:\oracle\Middleware\wlserver_10.3\L10N\beehive_ja.jar;C:\oracle\Middleware\wlserver_10.3\L10N\beehive_ko.jar;C:\oracle\Middleware\wlserver_10.3\L10N\beehive_zh_CN.jar;C:\oracle\Middleware\wlserver_10.3\L10N\beehive_zh_TW.jar;C:\oracle\Middleware\wlserver_10.3\L10N\p13n_wls_ja.jar;C:\oracle\Middleware\wlserver_10.3\L10N\p13n_wls_ko.jar;C:\oracle\Middleware\wlserver_10.3\L10N\p13n_wls_zh_CN.jar;C:\oracle\Middleware\wlserver_10.3\L10N\p13n_wls_zh_TW.jar;C:\oracle\Middleware\wlserver_10.3\L10N\testclient_ja.jar;C:\oracle\Middleware\wlserver_10.3\L10N\testclient_ko.jar;C:\oracle\Middleware\wlserver_10.3\L10N\testclient_zh_CN.jar;C:\oracle\Middleware\wlserver_10.3\L10N\testclient_zh_TW.jar;C:\oracle\Middleware\wlserver_10.3\L10N\tuxedocontrol_ja.jar;C:\oracle\Middleware\wlserver_10.3\L10N\tuxedocontrol_ko.jar;C:\oracle\Middleware\wlserver_10.3\L10N\tuxedocontrol_zh_CN.jar;C:\oracle\Middleware\wlserver_10.3\L10N\tuxedocontrol_zh_TW.jar;C:\oracle\Middleware\wlserver_10.3\L10N\workshop_ja.jar;C:\oracle\Middleware\wlserver_10.3\L10N\workshop_ko.jar;C:\oracle\Middleware\wlserver_10.3\L10N\workshop_zh_CN.jar;C:\oracle\Middleware\wlserver_10.3\L10N\workshop_zh_TW.jar>
<Aug 4, 2009 7:36:59 AM GMT-06:00> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) Client VM Version 10.0-b19 from Sun Microsystems Inc.>
<Aug 4, 2009 7:36:59 AM GMT-06:00> <Info> <Management> <BEA-141107> <Version: WebLogic Server Temporary Patch for CR380042 Thu Sep 11 13:33:40 PDT 2008
WebLogic Server Temporary Patch for 7372756 Fri Sep 12 17:05:44 EDT 2008
WebLogic Server Temporary Patch for CR381265 Wed Oct 08 10:15:58 PDT 2008
WebLogic Server Temporary Patch for CR380913 Wed Oct 15 13:24:22 PDT 2008
WebLogic Server Temporary Patch for CR382965 Fri Nov 21 15:51:48 PST 2008
WebLogic Server Temporary Patch for CR383260 Thu Nov 20 12:58:15 PST 2008
WebLogic Server Temporary Patch for CR383202 Fri Nov 21 09:58:15 PST 2008
WebLogic Server 10.3 Mon Aug 18 22:39:18 EDT 2008 1142987 >
<Aug 4, 2009 7:37:01 AM GMT-06:00> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
<Aug 4, 2009 7:37:01 AM GMT-06:00> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool>
<Aug 4, 2009 7:37:01 AM GMT-06:00> <Notice> <Log Management> <BEA-170019> <The server log file C:\oracle\Middleware\jdeveloper\system\system11.1.1.0.31.52.05\DefaultDomain\servers\DefaultServer\logs\DefaultServer.log is opened. All server side log events will be written to this file.>
<Aug 4, 2009 7:37:11 AM GMT-06:00> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
<Aug 4, 2009 7:37:16 AM GMT-06:00> <Warning> <Deployer> <BEA-149617> <Non-critical internal application uddi was not deployed. Error: [Deployer:149158]No application files exist at 'C:\oracle\MIDDLE~1\WLSERV~1.3\server\lib\uddi.war'.>
<Aug 4, 2009 7:37:16 AM GMT-06:00> <Warning> <Deployer> <BEA-149617> <Non-critical internal application uddiexplorer was not deployed. Error: [Deployer:149158]No application files exist at 'C:\oracle\MIDDLE~1\WLSERV~1.3\server\lib\uddiexplorer.war'.>
<Aug 4, 2009 7:37:18 AM GMT-06:00> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY>
<Aug 4, 2009 7:37:18 AM GMT-06:00> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
<Aug 4, 2009 7:37:20 AM GMT-06:00> <Notice> <Log Management> <BEA-170027> <The Server has established connection with the Domain level Diagnostic Service successfully.>
<Aug 4, 2009 7:37:20 AM GMT-06:00> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN>
<Aug 4, 2009 7:37:20 AM GMT-06:00> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING>
<Aug 4, 2009 7:37:20 AM GMT-06:00> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 127.0.0.1:7101 for protocols iiop, t3, ldap, snmp, http.>
<Aug 4, 2009 7:37:20 AM GMT-06:00> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 192.168.1.30:7101 for protocols iiop, t3, ldap, snmp, http.>
<Aug 4, 2009 7:37:20 AM GMT-06:00> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "DefaultServer" for domain "DefaultDomain" running in Development Mode>
<Aug 4, 2009 7:37:20 AM GMT-06:00> <Warning> <Server> <BEA-002611> <Hostname "SPC", maps to multiple IP addresses: 192.168.1.30, 127.0.0.1>
<Aug 4, 2009 7:37:20 AM GMT-06:00> <Warning> <Server> <BEA-002611> <Hostname "localhost", maps to multiple IP addresses: 192.168.1.30, 127.0.0.1>
<Aug 4, 2009 7:37:20 AM GMT-06:00> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>
<Aug 4, 2009 7:37:20 AM GMT-06:00> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
DefaultServer startup time: 31156 ms.
DefaultServer started.
[Running application Fusion_app on Server Instance DefaultServer...]
Uploading credentials.
---- Deployment started. ---- Aug 4, 2009 7:37:27 AM
Target platform is (Weblogic 10.3).
Running dependency analysis...
2009-08-04 07:37:28.234: Writing WAR file to C:\oracle\Middleware\jdeveloper\system\system11.1.1.0.31.52.05\o.j2ee\drs\Fusion_app\Fusion_app-ViewController-webapp
2009-08-04 07:37:28.359: Wrote WAR file to C:\oracle\Middleware\jdeveloper\system\system11.1.1.0.31.52.05\o.j2ee\drs\Fusion_app\Fusion_app-ViewController-webapp
2009-08-04 07:37:30.796: Writing EAR file to C:\oracle\Middleware\jdeveloper\system\system11.1.1.0.31.52.05\o.j2ee\drs\Fusion_app
2009-08-04 07:37:30.843: Wrote EAR file to C:\oracle\Middleware\jdeveloper\system\system11.1.1.0.31.52.05\o.j2ee\drs\Fusion_app
Deploying Application...
<Aug 4, 2009 7:37:35 AM GMT-06:00> <Warning> <J2EE> <BEA-160195> <The application version lifecycle event listener oracle.security.jps.wls.listeners.JpsAppVersionLifecycleListener is ignored because the application Fusion_app is not versioned.>
Aug 4, 2009 7:37:35 AM oracle.adf.share.config.ADFConfigFactory cleanUpApplicationState
INFO: Cleaning up application state
Aug 4, 2009 7:37:36 AM oracle.as.jmx.framework.PortableMBeanFactory setJMXFrameworkProviderClass
INFO: JMX Portable Framework initialized with platform SPI "class oracle.as.jmx.framework.wls.spi.JMXFrameworkProviderImpl"
Aug 4, 2009 7:38:08 AM oracle.adfinternal.view.faces.partition.FeatureUtils _addFeatures
WARNING: A duplicate definition for the feature "AdfDvtGraph" has been found at zip:C:/oracle/Middleware/jdeveloper/system/system11.1.1.0.31.52.05/DefaultDomain/servers/DefaultServer/tmp/_WL_user/Fusion_app/vhyezh/war/WEB-INF/lib/dvt-faces.jar!/META-INF/adf-js-features.xml, line 3. A feature with the same name was originally defined at zip:C:/oracle/Middleware/jdeveloper/dvt/lib/dvt-faces.jar!/META-INF/adf-js-features.xml, line 3. This may indicate that multiple copies of the same jar file are present on the class path. Ignoring the new feature definition.
Aug 4, 2009 7:38:08 AM oracle.adfinternal.view.faces.partition.FeatureUtils _addFeatures
WARNING: A duplicate definition for the feature "AdfDvtGauge" has been found at zip:C:/oracle/Middleware/jdeveloper/system/system11.1.1.0.31.52.05/DefaultDomain/servers/DefaultServer/tmp/_WL_user/Fusion_app/vhyezh/war/WEB-INF/lib/dvt-faces.jar!/META-INF/adf-js-features.xml, line 7. A feature with the same name was originally defined at zip:C:/oracle/Middleware/jdeveloper/dvt/lib/dvt-faces.jar!/META-INF/adf-js-features.xml, line 7. This may indicate that multiple copies of the same jar file are present on the class path. Ignoring the new feature definition.
Aug 4, 2009 7:38:08 AM oracle.adfinternal.view.faces.partition.FeatureUtils _addFeatures
WARNING: A duplicate definition for the feature "AdfRichPivotTable" has been found at zip:C:/oracle/Middleware/jdeveloper/system/system11.1.1.0.31.52.05/DefaultDomain/servers/DefaultServer/tmp/_WL_user/Fusion_app/vhyezh/war/WEB-INF/lib/dvt-faces.jar!/META-INF/adf-js-features.xml, line 11. A feature with the same name was originally defined at zip:C:/oracle/Middleware/jdeveloper/dvt/lib/dvt-faces.jar!/META-INF/adf-js-features.xml, line 11. This may indicate that multiple copies of the same jar file are present on the class path. Ignoring the new feature definition.
Application Deployed Successfully.
Elapsed time for deployment: 42 seconds
---- Deployment finished. ---- Aug 4, 2009 7:38:09 AM
Run startup time: 43562 ms.
[Application Fusion_app deployed to Server Instance DefaultServer]
Target URL -- http://127.0.0.1:7101/Fusion_app-ViewController-context-root/faces/adf.task-flow?adf.tfId=orders-flow&adf.tfDoc=/WEB-INF/orders-flow.xml
Aug 4, 2009 7:38:22 AM oracle.adfinternal.controller.faces.lifecycle.JSFLifecycleImpl setLifecycleContextBuilder
WARNING: ADFc: Replacing the ADF Page Lifecycle implementation with 'oracle.adfinternal.controller.application.model.JSFDataBindingLifecycleContextBuilder'.
Aug 4, 2009 7:38:22 AM oracle.adfinternal.controller.util.model.AdfmInterface initialize
INFO: ADFc: BindingContext is present, using ADFm APIs for DataControlFrames.
Aug 4, 2009 7:38:23 AM oracle.adfinternal.controller.metadata.provider.MdsMetadataResourceProvider <init>
INFO: ADFc: Controller caching of MDS metadata resources ENABLED.
<Aug 4, 2009 7:38:33 AM GMT-06:00> <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext@185aa63 - appName: 'Fusion_app', name: 'Fusion_app-ViewController-context-root', context-path: '/Fusion_app-ViewController-context-root', spec-version: '2.5', request: weblogic.servlet.internal.ServletRequestImpl@385e76[
GET /Fusion_app-ViewController-context-root/faces/adf.task-flow?adf.tfId=orders-flow&adf.tfDoc=/WEB-INF/orders-flow.xml HTTP/1.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
]] Root cause of ServletException.
oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.sql.SQLDataException, msg=ORA-01882: timezone region not found
at oracle.jbo.server.OracleSQLBuilderImpl.setSessionTimeZone(OracleSQLBuilderImpl.java:4957)
at oracle.jbo.server.DBTransactionImpl.refreshConnectionMetadata(DBTransactionImpl.java:5054)
at oracle.jbo.server.DBTransactionImpl.initTransaction(DBTransactionImpl.java:1280)
at oracle.jbo.server.DBTransactionImpl.initTxn(DBTransactionImpl.java:6415)
at oracle.jbo.server.DBTransactionImpl2.connect(DBTransactionImpl2.java:118)
Truncated. see log file for complete stacktrace
java.sql.SQLDataException: ORA-01882: timezone region not found
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:79)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:116)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:177)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
Truncated. see log file for complete stacktrace
>
<Aug 4, 2009 7:39:39 AM GMT-06:00> <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext@185aa63 - appName: 'Fusion_app', name: 'Fusion_app-ViewController-context-root', context-path: '/Fusion_app-ViewController-context-root', spec-version: '2.5', request: weblogic.servlet.internal.ServletRequestImpl@9d476e[
GET /Fusion_app-ViewController-context-root/faces/adf.task-flow?adf.tfId=orders-flow&adf.tfDoc=/WEB-INF/orders-flow.xml HTTP/1.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: JSESSIONID=6TpJK45GLsdg1ZRfJdypDhC7ZgQzJybRrZLPWbd6WKdxpV1gv5yM!2087942931
Cache-Control: max-age=0
]] Root cause of ServletException.
oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.sql.SQLDataException, msg=ORA-01882: timezone region not found
at oracle.jbo.server.OracleSQLBuilderImpl.setSessionTimeZone(OracleSQLBuilderImpl.java:4957)
at oracle.jbo.server.DBTransactionImpl.refreshConnectionMetadata(DBTransactionImpl.java:5054)
at oracle.jbo.server.DBTransactionImpl.initTransaction(DBTransactionImpl.java:1280)
at oracle.jbo.server.DBTransactionImpl.initTxn(DBTransactionImpl.java:6415)
at oracle.jbo.server.DBTransactionImpl2.connect(DBTransactionImpl2.java:118)
Truncated. see log file for complete stacktrace
java.sql.SQLDataException: ORA-01882: timezone region not found
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:79)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:116)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:177)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
Truncated. see log file for complete stacktrace
> -
URGENT : Please HELP : Loading a first image too slow
Hello,
I want to load an image to save it just before in a JPG format so as to obtain finally a byte[] array of this JPG image result.
So, to do it, I tried to load my Image from different ways but I have always a strange comportement... My problem come from the reading :
First, I use the imageio classes...
FileImageInputStream fiis = new FileImageInputStream(file);
BufferedImage input = ImageIO.read(fiis);
And then, I use the oldest method :
Image image = new ImageIcon(file.getAbsolutePath()).getImage();
BufferedImage input = new BufferedImage(image.getWidth(panel), image.getHeight(panel),BufferedImage.TYPE_INT_RGB);
and also :
Image image = new ImageIcon(file.getAbsolutePath()).getImage();
BufferedImage input = toBufferedImage(picture);
But finally, I understood my problem is that the first time I load an image (no matter the format, JPG, BMP, TIFF... or other) the loading phase is very slow and lasts at least 30 sec. But then, every loading that I do will gonna be really fast. (No more than 1 sec.) It's look like if the first time there was a kind of dinamical alocation or something like that.... but I tried to find some configuration parameters to set it... But without success. :-(
If someone could have an idea to suggest me... it would help me very much.
Thanks in advance for your help,
AnthonyPlease someone can help me ?!? A suggestion ?
I have tried today one more time to resolve this issue... but without success... Anything I do with the loading of an image... by imageio or other ways... it's still the same problem... the first time I load an image, it takes me 40 - 50 sec to load it and after this first load, it is very fast with others... and with every formats. It's not a question of format but of memory allocation, I think... but I'm not sure...
PRECISION : I work with an applet, is there something to configurate to allocate some memories or another thing ?!?
Thanks in advance for your help, I really need it just right now... I have to finish this job extremly fast !!!
Regards,
Anthony -
How to load svg (vector) image dinamicaly.
Hallo!
I tryed to load dinamicaly an image svg (.ai) into flash but I can't.
At my level:
1) I know that flash can't import .svg file but it is possible convert svg in Adobe ilustrator .ai file;
2) I can import .ai file in flash with no problem;
3) I can load dinamicaly external .jpg file with no problem;
If I try to load dinamicaly .ai file in the same way that I use to load .jpg file I get this message:
Error #2044: Unhandled ioError:. text=Error #2124: Loaded file is an unknown type. URL: file: .....
Is there any way to solve this problem?
Can someone help me?
Thank you.you can use the urlloader class to load the svg but it won't display an image until you parse the xml, Using SVG as a level design format - Zeh Fernando
-
Load a different image to stage
Hi there,
I am trying to place an image on the homepage of a website i
am building but i want the image to change every time the page
loads. could anyone give me an idea on how to set this up or know
of a good tutorial? my client is a photographer so they want to
display a different photo every time the page reloads. i also want
the anchor point of the image to be at the top left so the image
begins at the same place. Any ideas? thanks in advance.Sure. The basic idea is simple. You want to load a random
image. Flash only provides one means of generating anything random
and it's the random() method of the Math class.
By itself, random() is only going to help you generate a
number. But if you take it one step further and append that number
result to ".jpg", what you'll get is a String pointing to the
filename of an image in this case 1.jpg. For instance
// Math.random() returns a 1 stored in a variable named pic
var myFile:String = pic + ".jpg";
Now you can use loadMovie, MovieClipLoader (both AS2) or the
Loader class (AS3) to load the file onto the stage. I'll show
MovieClipLoader and Loader
// MovieClipLoader - assumes images loading are in same
directory as swf
var myMCL:MovieClipLoader = new MovieClipLoader();
myMCL.loadClip( myFile );
// Loader - assumes same as above
var _ldr:Loader = new Loader();
addChild( _ldr );
_ldr.load( new URLRequest( myFile ) );
The only code you need to control is the Math.random() so
that you put an upper and lower bound on the returned result. You
can find help with that inside the Flash documentation.
Hope this helps. -
Loading up an image into a Jpanel!! HELP!!
Hi,
With regards to the following code, I was wondering if anyone could help me. I am in the early stages of making a basic Image Editing program, and have managed to implement the following code. The thing is, when you load up an image, it seems to always position it in the top left corner of the container - overwiting all menus, buttons placed underneath. Why is this??
I need the image to appear in the JPanel/canvas below the toolbar and not on top of it!!
I hope someone out there can help me!
Thanks,
a very confused girl :(
SAMPLE CODE:-
import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import java.util.*;
import javax.imageio.ImageIO;
import java.net.*;
import javax.swing.filechooser.*;
public class ImageMaker extends JFrame implements ActionListener
String kBanner = "ImageMaker v1.0";
JPanel contentPane;
JButton loadButton;
JToolBar toolBar;
JMenuBar menuBar;
JMenu fileMenu;
JMenuItem fileOpenMenuItem;
public BufferedImage mBufferedImage;
public ImageMaker(String fileName)
Container appWindow = getContentPane();
setTitle(kBanner);
appWindow.setLayout(new BorderLayout(5,5));
menuBar = new JMenuBar();
setJMenuBar(menuBar);
fileMenu = new JMenu("File");
menuBar.add(fileMenu);
fileOpenMenuItem = new JMenuItem("Open");
fileMenu.add(fileOpenMenuItem);
fileOpenMenuItem.addActionListener(this);
toolBar = new JToolBar();
loadButton = new JButton("Open");
loadButton.addActionListener(this);
toolBar.add(loadButton);
contentPane = new JPanel();
appWindow.add( BorderLayout.NORTH, toolBar);
appWindow.add( BorderLayout.SOUTH, contentPane);
public void loadImage(String fileName)
Image image = Toolkit.getDefaultToolkit().getImage(fileName);
MediaTracker mt = new MediaTracker(this);
mt.addImage(image, 0);
try { mt.waitForID(0); }
catch (InterruptedException ie) { return; }
if (mt.isErrorID(0)) return;
mBufferedImage = new BufferedImage(image.getWidth(null),
image.getHeight(null),
BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = mBufferedImage.createGraphics();
g2.drawImage(image, null, null);
validate();
repaint();
setTitle(kBanner + ": " + fileName);
public void paint(Graphics g)
super.paint(g);
if (mBufferedImage == null) return;
Insets insets = getInsets();
g.drawImage(mBufferedImage, insets.left, insets.top, null);
public void actionPerformed(ActionEvent ae)
JFileChooser fd = new JFileChooser();
int returnVal=fd.showOpenDialog(ImageMaker.this);
if(returnVal==JFileChooser.APPROVE_OPTION)
if (fd.getSelectedFile() == null)
{ return; }
File file=fd.getSelectedFile();
String path=(String)file.getPath();
loadImage(path);
JMenu men = (JMenu) ae.getSource();
String label = (String) men.getText();
JButton butt = (JButton) ae.getSource();
String butt2 = (String) butt.getText();
if (label.equals("Open"))
else if (label.equals("Save"))
}//end ActionListener
public static void main(String[] args)
String fileName = "default";
if (args.length > 0) fileName = args[0];
ImageMaker img=new ImageMaker(fileName);
img.setSize(800,600);
img.show();
}Hi,
Thank you for your help.
I have done what you suggested and created this code below using the paintComponent.
It compiles, but when i run it i get an error ("Uncaught error fetching image: java.lang.NullPointerExecption"). I was hoping you could advise me further as i am really struggling to get this basic app running propely.
Thanks againfor your help.
import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import java.util.*;
import javax.imageio.ImageIO;
import java.net.*;
import javax.swing.filechooser.*;
import javax.swing.plaf.basic.*;
public class TLookupOp extends JFrame
{ DisplayPanel displayPanel;
JButton loadButton;
public BufferedImage mBufferedImage;
Graphics2D g2;
String path;
JFileChooser fd;
public TLookupOp()
{super("Test");
Container container=getContentPane();
container.setLayout(new BorderLayout(5,5));
displayPanel=new DisplayPanel(path);
container.add(displayPanel);
JPanel panel=new JPanel();
loadButton = new JButton("Open");
loadButton.addActionListener(new ActionListener()
{public void actionPerformed(ActionEvent ae)
fd = new JFileChooser();
int returnVal=fd.showOpenDialog(TLookupOp.this);
if(returnVal==JFileChooser.APPROVE_OPTION )
if (fd.getSelectedFile() == null)
{ return; }
File file=fd.getSelectedFile();
path=(String)file.getPath();
//displayPanel=new DisplayPanel(path);
//displayPanel.loadImage(path);
loadButton.setToolTipText("Click to load an image.");
panel.add(loadButton);
container.add( BorderLayout.NORTH, panel);
addWindowListener(new WindowEventHandler());
setSize(displayPanel.getWidth(),displayPanel.getHeight()+25);
show();
class WindowEventHandler extends WindowAdapter
{public void windowClosing(WindowEvent e)
{System.exit(0);
public static void main(String[] args)
{new TLookupOp();
class DisplayPanel extends JPanel
{Image image;
BufferedImage mBufferedImage;
Graphics2D g2;
String filepath;
DisplayPanel(String path)
{ filepath=path;
loadImage(filepath);
setSize(image.getWidth(this), image.getWidth(this));
createBufferedImage();
public void loadImage(String fileName)
Image image = Toolkit.getDefaultToolkit().getImage(fileName);
MediaTracker mt = new MediaTracker(this);
mt.addImage(image, 0);
try { mt.waitForID(0); }
catch (InterruptedException ie) { return; }
if (mt.isErrorID(0)) return;
public void createBufferedImage()
{mBufferedImage=new BufferedImage(image.getWidth(null),
image.getHeight(null),
BufferedImage.TYPE_INT_RGB);
g2 = mBufferedImage.createGraphics();
g2.drawImage(image,0,0,this);
public void paintComponent(Graphics g)
super.paintComponent(g);
Graphics2D g2D=(Graphics2D) g;
g2D.drawImage(mBufferedImage,0,0,this);
} -
Load and display image using CDC
Hi everyone,
Please help. I'm new to java. I need a simple routine to load and display an image from the file system into a CDC app on windows mobile 5. I'm usin creme 4.1.
Thanx in advanceUse the following as a guide:
1. Get the image (path below must be absolute):
public static Image getImage(String filename) throws ScanException {
Image img = null;
// Read paths from properties file
StringBuffer buf = new StringBuffer("\\");
buf.append(ScanUtility.getPathImages());
buf.append("\\");
buf.append(filename);
buf.append(".jpg");
File dataFile = new File(buf.toString());
if(!dataFile.exists())
throw new ScanException("Cannot locate the file:\n" + dataFile.getAbsolutePath());
img = Toolkit.getDefaultToolkit().createImage(buf.toString());
return img;
2. Create a class to display the image (pass in the image, above):
ImagePanel class source:
import java.awt.*;
import java.awt.image.*;
public class ImagePanel extends Panel {
private Image image = null;
private Image scaledImage = null;
private boolean imageComplete = false;
public ImagePanel(Image img) {
image = img;
scaledImage = image.getScaledInstance(200, -1, Image.SCALE_DEFAULT);
prepareImage(scaledImage, this);
// Override the paint method, to render the image
public void paint(Graphics g) {
if(imageComplete) {
g.drawImage(scaledImage, 0, 0, this);
// Override imageUpdate method, to prevent repaint() from trying
// to do anything until the image is scaled
public boolean imageUpdate(Image img, int infoFlags, int x, int y, int w, int h) {
if(infoFlags == ImageObserver.ALLBITS) {
imageComplete = true;
repaint();
return super.imageUpdate(img, infoFlags, x, y, w, h);
public void flush() {
image.flush();
scaledImage.flush();
image = null;
scaledImage = null;
} -
Question about loading and using Images.
I know how to load an image and to draw it onto a canvas etc etc. However my question is to do with the efficiency of loading multiple images (possibly the same image!) and using them together. I have multiple objects, all instances of the same class, which all draw themselves onto a screen in different positions. However they all use the same 3 images (depending on an internal state).
So if I create 5 of these objects and each object calls to load the same image using something along the lines of:
url = this.getClass().getResource("MyImage.png");
normalImage = Toolkit.getDefaultToolkit().getImage(url);Does this mean that in the memory there are 5 exactly the same copies of this image? Or does java do something clever and use one image that they would all reference? I suspect I will have 5 in memory but I wanted to ask about this before going and making an imageManager class where I load all the images and just use getMethods in that when drawing. I will not be preforming any transforms or anything on any of the images so they can all literally be the same image but simply drawn in multiple positions on the one canvas.
(note: I am using active rendering to draw these images myself and then blit it to the screen ...).Use ImageIO rather than Toolkit--with Toolkit you need to use a MediaTracker to ensure you have your image loaded before you try to use it.
If you load an image and then do this:
MyImage1 = MyImage;
MyImage2 = MyImage;
MyImage3 = MyImage;
There are 4 references to the Image in MyImage. If you don't specifically use a method that gives you a new Image, usually, you are getting a refrence to an image already loaded in memory. -
Smooth load of enternal images
Hey folks,
I have a slideshow that I want to play fullscreen, but there
are a lot of photos, so I don't want to load them all in at the
start. However, when I load them on demand, the slideshow will
freeze for a moment while they load in the background. I know there
must be something I can do differently so that these can load in
the background, and just fire an event when they're ready, but I
can't seem to find what I'm looking for. Any ideas?
- BBSpero:
Without downloading all the images during the preload stage
there isn't a 100% sure fire work around for preventing the freeze
as a user clicks on an image however there is a possible
compromise. You need to create an image loading queue class to
manage the loading of the images in the background once the movie
is displayed. The queue will progressively load the image assets in
the background as the movie is playing. The queue needs to be
designed to handle events from the user that will halt the current
image being loaded and move the current non loaded image to the top
of the queue. i.e.
< load first image and display >
< movie starts >
< begin loading queue >
user clicks image,
< is image loaded ? >
- If yes then display
- If no then halt current loading image
< search loader queue for matching image id >
< load image >
< once image loaded display then go back to beginning of
queue and start >
Hope this helps -
Loading the same image multiple times
I'm trying to dynamically load a single image multiple times
into flash. Basically I want to end up with two movieclips mc1 and
mc2 that contain the image. I'm currently using the Loader
component (connected to the ProgressBar) to dynamically load the
image. It works fine for loading the image once but I'm really not
sure how to go about creating a second movie clip with the image.
Here's my code for loading the first image:
var mc1:MovieClip = new MovieClip();
var listener:Object = new Object();
listener.complete = function(eventObj:Object){
nextFrame();
imageLoader.addEventListener("complete", listener);
mc1 = imageLoader.content;
imageLoader.load(imgURL);
But everything I've tried to load mc2 with that same image
has failed. I've tried 'mc2 = imageLoader.content', 'mc2 = mc1',
'attachMovie', 'duplicateMovieClip', calling imageLoader.load()
twice on the imgURL, and creating a second Loader component and
loading the image again. All of these methods have invariably
failed. Most of them can load mc1 alright and sometimes mc2 even
shows up on the stage but in the AS mc2 is always undefined.
Can anybody point me in the right direction for loading
multiple copies of the same image? It really shouldn't be that
hard, should it?Well I figured out a solution. Turns out Flash doesn't allow
you to duplicate dynamically loaded content like an image in a
movieclip. But there is a little class called BitmapData that will
do precisely what I was looking for. Here's the link I got this
info from:
http://www.senocular.com/flash/source.php?id=0.174 -
How to load a tif image in flex
Hi All,
Is it possible to load a tif image in flex. If it's possible
anyone guide me or send me some code snippets regarding how to
display a tif image in flex.
Regards,
Dharma"flexdharma" <[email protected]> wrote in
message
news:ga2d96$p8h$[email protected]..
>
Hi All,
> Is it possible to load a tif image in flex. If it's
possible anyone guide
> me or send me some code snippets regarding how to
display a tif image in
> flex.
Convert it to the much more web-friendly png format. -
How to load a boot image to cisco aironet 1140 series after missing boot image
Hi all,
I need a solution for this. When i switch my cisco aironet 1140 , it s blinking with red light .and gives a message "no boot image to load".
When i tried next time, by pressing escape it shows this message that i have mentioned below.
ap:
ap:
using eeprom values
WRDTR,CLKTR: 0x83000800 0x40000000
RQDC ,RFDC : 0x80000035 0x00000208
using ÿÿÿÿ ddr static values from serial eeprom
ddr init done
Running Normal Memtest...
Passed.
IOS Bootloader - Starting system.
FLASH CHIP: Numonyx P33
Checking for Over Erased blocks
Xmodem file system is available.
DDR values used from system serial eeprom.
WRDTR,CLKTR: 0x83000800, 0x40000000
RQDC, RFDC : 0x80000035, 0x00000208
PCIE0: link is up.
PCIE0: VC0 is active
PCIE1: link is NOT up.
PCIE1 port 1 not initialized
PCIEx: initialization done
flashfs[0]: 1 files, 1 directories
flashfs[0]: 0 orphaned files, 0 orphaned directories
flashfs[0]: Total bytes: 32385024
flashfs[0]: Bytes used: 1536
flashfs[0]: Bytes available: 32383488
flashfs[0]: flashfs fsck took 16 seconds.
Reading cookie from system serial eeprom...Done
Base Ethernet MAC address: 28:94:0f:d6:c8:62
Ethernet speed is 100 Mb - FULL duplex
The system is unable to boot automatically because there
are no bootable files.
C1140 Boot Loader (C1140-BOOT-M) Version 12.4(23c)JA3, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Compiled Tue 18-Oct-11 14:51 by prod_rel_team
ap:
So , now my question is how to load the boot image ? From where will we get this ? OR
I m also having another Cisco aironet 1140 , Can i get bootimage from that . Kindly let me know the solution from genius ?Take a look at this link as it should have the info you need
https://supportforums.cisco.com/docs/DOC-14636
Sent from Cisco Technical Support iPhone App
Maybe you are looking for
-
Unit Testing: Supplying SYSDATE on a DATE parameter
hi all, I have a procedure that I'm unit testing and one of the parameter is date, I want to supply a dynamic value to it relative to sysdate but SQL Developer only accepts hard coded date values. Does anyone know how I can supply SYSDATE or SYSDATE-
-
Creating a new report in 11.5.9
I am trying to create a new report for Oracle Sales Online. I don't want to just do a simple JSP, I want to use some of the existing functionality that the existing pages are using. Take the Organization Summary page for example. Its the page called
-
HT3702 How to remove my credit card from the iPod
I want to remove my credit card from the app store
-
How to use the value in a text cell?
Hi everyone i am new to this forum. My family and i have been macusers for more than 10 years and for our business we own many macs. I am trying to build a stock list calculator and want to ask something. My B3 cell contains the text "50*70cm" and i
-
here is a sample code of my application.... int initialDelay = 10000; // start after 10 second int period = 10000*60*60*24*30; // repeat every month Timer timer = new Timer(); TimerTask task = new TimerTask() { public void run() { try { MyDBConnectio