Can't import custom class!
I have no idea why as3 is so stupid but it is and I have to
deal with it. Basically, I creatd a Server.as file with the Server
class but I can't import it into my .fla! Both are in the same
folder and when I change properties to use AS2 it works! But when
I'm doing it in as3 it doesn't work...
you don't need to use a directory structure for your files'
location, but you need to use the package designation in your class
definitions.
for example, if your Server class file is in the same
directory with your fla, you can use:
Similar Messages
-
How can I import a class in my program?
In my program I want to use a class named "WordExtractor" that resides in a jar file named "poi-3.0.1-FINAL-20070705.jar".
This jar file is stored on my computer under:
D:\java_projects\Word Reader\poi-bin-3.0.1-FINAL-20070705\poi-3.0.1-FINAL\poi-3.0.1-FINAL-20070705.jar
How can I import this class WordExtractor into my program?
import ????????? ;In my program I want to use a class named
"WordExtractor" that resides in a jar file named
"poi-3.0.1-FINAL-20070705.jar".
This jar file is stored on my computer under:
D:\java_projects\Word
Reader\poi-bin-3.0.1-FINAL-20070705\poi-3.0.1-FINAL\po
i-3.0.1-FINAL-20070705.jar
How can I import this class WordExtractor into my
program?
import ????????? ;After you add this jar file to the lib , you can use a tools(rar extracter tools) to extract "poi-3.0.1-FINAL-20070705.jar" file and find the position of that class "WordExtractor" .
write "import XXXX.WordExtractor"into your program,"XXXX" is the position that you have found. -
Can you import custom templates for keynote?
Can you import custom templates for keynote?
Yes you can. You can import a Motion project file directly into DVD Studio Pro, though when I tried it took a loooooong time (depends on the size and complexity of the project of course). Here's a tutorial on how to do that:
http://www.wonderhowto.com/how-to-use-dvd-studio-pro-4-with-motion-53426/
OR... you can just export your Motion project and import it into DVD SP as a Quicktime file, and put that in the Menu section. Then you can add your buttons and so forth and proceed from there.
I hope this helps. Good luck! -
I created a java class that I want to put in a universal folder and be made accessible to all java programs on my computer. I tried using CLASSPATH so that files I make can locate it, but it didn't work, and I don't know if I can use an import statement or not. Does anyone know how I can have a custom-made class (located in, for example, C:/classes/) be accessible to all java programs?
I want to be able to put the universally accessible class in a root directory (like C:/classes/), so using packages wouldn't work that well since other java classes would be much further in (C:/users/.../documents/java/...).
The way I tried to set up my classpath is I set CLASSPATH=C:/bin/. bin is the directory where I keep my compiled class files (javac -d C:/bin/ MyClass.java), which would also include the .class file of the one I want accessible. I can run any java file in bin (java -cp C:/bin/ MyClass), but when it searches for external files it still searches in the directory in which it's located. -
How to import custom classes from model to view controller in adf?
hi...
i have some custom classes in model layer in adf.
i want to use them in view controller but i cannot import them.
how is this possible?
my jdev version is 11.1.1.5You normally don't have to do anything special. The view controller project has a dependency to the model project. So simply typing the class name should show you hte option to generate the need import statement for the class.
However, not all classes which reside in the model project should be imported into the view Controller as it might break the MVC pattern.
Timo -
Only a type can be imported. package.Class resolves to a package
Hi,
I made a class for database connection named ConnectionClass.class.
The JSPs in public_html directory working fine with import and session variables.
but JSPs under public_html/subdirectory are unable to import this Class and also unable to access session variables.
I have deploy this class under public_html/WEB-INF/classes/ directory.
and also in a jar file vidyabharti.jar under public_html/WEB-INF/lib directory
I am importing it in JSPs like
<%@ page import="vidyabharti.ConnectionClass, java.sql.*" %>
but i am getting following error
An error occurred at line: 6 in the generated java file
Only a type can be imported. vidyabharti.ConnectionClass resolves to a package
An error occurred at line: 110 in the jsp file: /welcome.jsp
ConnectionClass cannot be resolved to a type
109: <%
110: ConnectionClass cs=null;
An error occurred at line: 115 in the jsp file: /welcome.jsp
ConnectionClass cannot be resolved to a type
cs=new ConnectionClass();
i am using Tomcat 5.5.28.
please help me.Hello,
It's a possible issue whith the JDT compiler version of your tomcat distribution.
You know that jasper is the engine that transform jsp to classes and to achive this goal uses a jdt compiler or the ant task javac compiler.
First check that the JDT compiler class is present in the trace of the exception you have.
If this is the case follow the steps of the tomcat documentation in order to use the ant compiler.
http://tomcat.apache.org/tomcat-5.5-doc/jasper-howto.html
Apache Ant, which was used in previous Tomcat releases, can be used instead instead of the new compiler by simply removing the common/lib/jasper-compiler-jdt.jar file, and placing the ant.jar file from the latest Ant distribution in the common/lib folder. If you do this, you also need to use the "javac" argument to catalina.sh.
If you check the code of the tomcat compilation context seems that you can do the same, without removing any file, by setting the compile parameter of the JspServlet to an arbitrary value diferent from null.
Try this other alternative by editing the file %TOMCAT_HOME%\conf\web.xml
and set the compiler attribute as follow
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>fork</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>compiler</param-name>
<param-value>Ant</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>If this works for your problem we can check the jdt code and perhaps make a patch.
Best reggards, -
Trouble importing custom class
Hi all
Just working my way through Programming for Mac OS X (2nd edition), and I've gotten all stuck at page 62. We've just created a custom class, and then try and 'build & go' the application. However, it never compiles, it always complain with my command to "#import <LotteryEntry.h>" that "error. LotteryEntry.h no such file or directory".
I'm all confused why because there IS such a file! Lol.
Any help would be appreciated
AdamI stumbled on the same error. Be sure to use *import "LotteryEntry.h"* and not *import <LotteryEntry.h>* as suggested by the automatic completion of XCode.
-
Swf can't find custom classes after publishing....
Hi everyone,
So this is probably an easy thing I don't know, I'm hoping.
But when I publish my project and test it in a normal HTML, the swf can find some classes but not others for some reason?
How can I make sure all the classes get compiled into the Swf?
I got the main timeline calling the first class (CalypsoPlayer); and it finds this class find -- which is under the same class path.
But CalypsoPlayer can't find the class it needs, even though it's under the same class path as the class.
I've tested the project in Flash itself and it all works great without any errors so I'm not sure what's going on. It's only when I test
the published SWF that it can't find all the classes it needs.
I appreciate anyones help -- StanHey Dan,
My mind just stopped for an hour and I wasn't thinking straight on this issue, lol. I thought I deleted this posting but apparently
I didn't.
Thanks for your help but this issue was just a result of a mind that had too much coffee and not enough energy .
- Stan -
'Cannot Resolve Symbol' error when importing custom class
I get this error...
c:\mydocu~1\n307\auto.java:14: cannot resolve symbol
symbol: class Box
import Box;
^
when I try to compile auto.java, the applet that's supposed to import the class Box, which I built to be like a message box in VB. Here is the code for Box...
import java.awt.*;
import java.awt.event.*;
public class Box extends Window{
Label lblMsg = new Label();
Button cmdOk = new Button("OK");
Panel pnlSouth = new Panel();
EventHandler ehdlr=new EventHandler(this);
public Box(Frame parent){
super(parent);
setLayout(new BorderLayout());
add(lblMsg, BorderLayout.NORTH);
add(pnlSouth, BorderLayout.SOUTH);
pnlSouth.setLayout(new FlowLayout());
pnlSouth.add(cmdOk);
cmdOk.addActionListener(ehdlr);
this.addWindowListener(ehdlr);
public void speak(String msg){
lblMsg.setText(msg);
this.setLocation(200,200);
this.setSize(200,200);
this.setVisible(true);
private class EventHandler extends WindowAdapter
implements ActionListener{
Window theWindow;
public EventHandler(Window a){
theWindow=a;
public void actionPerformed(ActionEvent e){
theWindow.setVisible(false);
AND HERE IS THE CODE FOR AUTO...
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
import java.util.*;
import Box;
public class auto extends Applet implements ActionListener{
Panel pnlCenter=new Panel();
Panel pnlSouth=new Panel();
Panel pnlNorth=new Panel();
Panel pnlCenterleft=new Panel();
Panel pnlCenterright=new Panel();
Button cmdSubmit=new Button("Submit");
Button cmdNext=new Button("Next");
Button cmdPrev=new Button("Previous");
Label lblLoc=new Label("LOCATION:");
Label lblDate=new Label("DATE:");
Label lblMile=new Label("MILEAGE:");
Label lblCost=new Label("COST:");
Label lblDesc=new Label("DESCRIPTION:");
Label lblFind=new Label("FIND LOCATION:");
Label lblDisp=new Label();
TextField txtLoc=new TextField();
TextField txtDate=new TextField();
TextField txtMile=new TextField();
TextField txtCost=new TextField();
TextArea txtDesc=new TextArea();
TextField txtFind=new TextField();
Box bxOne = new Box((Frame(this).getParent()));
/*by declaring these four variables here, they are instance level, meaning they are
available to the whole applet*/
String textFile="auto.txt";
String list[] = new String[100];
String sort[] = new String[100];
int counter=0;
int count=0;
String currentLine="";
int i;
int sortcount;
public void init(){
this.setLayout(new BorderLayout());
this.add(pnlNorth, BorderLayout.NORTH);
this.add(pnlCenter, BorderLayout.CENTER);
this.add(pnlSouth, BorderLayout.SOUTH);
pnlNorth.setLayout(new FlowLayout());
pnlNorth.add(new Label("VIEW RECORDS"));
pnlCenter.setLayout(new GridLayout(1,2));
pnlCenter.add(pnlCenterleft);
pnlCenter.add(pnlCenterright);
pnlCenterleft.setLayout(new GridLayout(0,1));
pnlCenterleft.add(lblLoc);
pnlCenterleft.add(lblDate);
pnlCenterleft.add(lblMile);
pnlCenterleft.add(lblCost);
pnlCenterleft.add(lblDesc);
pnlCenterleft.add(lblFind);
pnlCenterright.setLayout(new GridLayout(0,1));
pnlCenterright.add(txtLoc);
pnlCenterright.add(txtDate);
pnlCenterright.add(txtMile);
pnlCenterright.add(txtCost);
pnlCenterright.add(txtDesc);
pnlCenterright.add(txtFind);
pnlSouth.setLayout(new FlowLayout());
pnlSouth.add(cmdPrev);
pnlSouth.add(lblDisp);
pnlSouth.add(cmdSubmit);
pnlSouth.add(cmdNext);
lblDisp.setText("0 of 0");
cmdPrev.addActionListener(this);
cmdNext.addActionListener(this);
cmdSubmit.addActionListener(this);
public void actionPerformed(ActionEvent e){
String command=e.getActionCommand();
if (command.equals("Next")){
if(txtLoc.getText().equals("")){
reader();
transfer();
writer();
bxOne.speak("Viewing all records");
}else{
if(counter<count-2){
counter++;
writer();
}else{
//don't move
} else if (command.equals("Previous")){
if(txtLoc.getText().equals("")){
//do nothing
}else{
if(counter>0){
counter--;
writer();
}else{
//don't move
} else {
txtLoc.setText("");
txtDate.setText("");
txtMile.setText("");
txtCost.setText("");
txtDesc.setText("");
reader();
sorter();
writer();
private void writer(){
StringTokenizer stCurrent=new StringTokenizer(sort[counter], "\t");
txtLoc.setText(stCurrent.nextToken());
txtDate.setText(stCurrent.nextToken());
txtMile.setText(stCurrent.nextToken());
txtCost.setText(stCurrent.nextToken());
txtDesc.setText(stCurrent.nextToken());
lblDisp.setText(String.valueOf(counter+1) + " of " + String.valueOf(count-1));
private void reader(){
try{
URL textURL=new URL(getDocumentBase(), textFile);
InputStream issIn=textURL.openStream();
InputStreamReader isrIn=new InputStreamReader(issIn);
BufferedReader brIn=new BufferedReader(isrIn);
while(currentLine!=null){
currentLine=brIn.readLine();
list[count]=currentLine;
count++;
}catch(MalformedURLException exc){
System.out.println("MalformedURLException Error");
}catch(IOException exc){
System.out.println("IOException Error");
}catch(NullPointerException exc){
System.out.println("NullPointerException Error");
private void transfer(){
for(i=0;i<count;i++){
sort=list[i];
private void sorter(){
sortcount=0;
String find=txtFind.getText();
System.out.println(String.valueOf(count));
for(i=0;i<count-1;i++){
StringTokenizer st=new StringTokenizer(list[i], "\t");
String next=st.nextToken();
if (find.equals(next)){
sort[sortcount]=list[i];
sortcount++;
count=sortcount+1;
Any help is greatly appreciated.
2Willis4Hi agian,
I looked closer at your code, I think if you play around with directories and paths, you'll get it, and I think also when you import, you have to have put the class in a package...? Maybe? Blind leading the blind here! So at the top of your box class you have to say something like
package org.blah.lala
and you have to have that directory structure for the class files org/blah/lala/Box.class
Does that make sense?
And then when you import you say:
import org.blah.lala.Box
(I think)
I cna only imagine that this 'help' I am giving you would be hilarious to a more experienced programmer!
Anyway, best of luck. -
Importing Custom Classes into a JSP page
Hello,
I have created custom package com.srjgroup.report. It sits in C:\workspace\src\com\srjgroup\report directory. I have java files as well as compiled classes there. No jar files there.
did amend classpath to point to this directory.
In my JSP page I have the import statement as following
import="java.sql.*, java.util.*, java.text.SimpleDateFormat, com.srjgroup.report.*"It imports all the packages without any errors. However, when I try to use one of the classes in the package, I get error
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 3 in the jsp file: /SQLServer.jsp
Generated servlet error:
SRJReports cannot be resolved to a type
SRJReports is one of the classes that I am trying to use in that package. When I comment out all references to the class, everything is fine.
So, to fix this I moved the entire package to
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\lib direcory, preserving the hierarhy. So, now my custom package is located here:
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\lib\com\srjgroup\report again there are no jar files, only java and classes here. Still, no go.
What am I doing wrong ?Put the class in
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\classes\com\srjgroup\report
One more thing, there is no subdirectory in lib directory. You may look at the example within tomcat for reference. I start from there. -
I've just recently gotten into Java development and have been able to make very basic programs?if you could call them that. To basically introduce myself to Java programming, I thought I'd create a simple tab-based text editor (think Microsoft Notepad with the ability to edit multiple files at once). I've created a basic menu bar class file, a tab-based editor pane/window class file, but am having trouble with the class file I'm using to incorporate the two together. I've had Steven Haines' Java 2 from Scratch at-hand for a week or two now (up to date, no; useful to a degree, yes) and have designed the application with a structure similar to the app in the book.
The structure of the main class file:
import java.lang.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import menuBar;
import jPad;
public class jNotepad extends JFrame implements ActionListener
menuBar menu=new menuBar();
jPad jNote=new jPad();
public jNotepad()
super("JNotepad v1.0");
setJMenuBar(menu);
menu.addActionListener(this);
jNote=new jPad();
getContentPane().add(jNote,BorderLayout.CENTER);
setSize(600,300);
setVisible(true);
addWindowListener
new WindowAdapter()
public void windowClosing(WindowEvent closer)
System.exit(0);
public void actionPerformed(ActionEvent performed)
JMenuItem item=(JMenuItem)performed.getSource();
if(item==menu.fNew)
System.out.println("File->New");
else if(item==menu.fOpen)
System.out.println("File->Open...");
else if(item==menu.fClose)
System.out.println("File->Close");
else if(item==menu.fCloseAll)
System.out.println("File->Close All");
else if(item==menu.fSave)
System.out.println("File->Save");
else if(item==menu.fSaveAs)
System.out.println("File->Save As...");
else if(item==menu.fSaveAll)
System.out.println("File->Save All");
else if(item==menu.fPrint)
System.out.println("File->Print");
else if(item==menu.fExit)
System.out.println("File->Exit");
else if(item==menu.eCut)
System.out.println("Edit->Cut");
else if(item==menu.eCopy)
System.out.println("Edit->Copy");
else if(item==menu.ePaste)
System.out.println("Edit->Paste");
else if(item==menu.eDelete)
System.out.println("Edit->Delete");
else if(item==menu.hContents)
System.out.println("Help->Contents");
else if(item==menu.hAbout)
System.out.println("Help->About");
public static void main(String[] args)
jNotepad jNotepadv10=new jNotepad();
For some reason or another, whenever I try to compile the java file into a class file, it gives me an error stating that I need periods after the "import menuBar" and "import jPad." Then if I add the periods and recompile, it says I need identifiers after the periods, so I add asterisk identifier masks and recompile again just to be told the packages menuBar and jPad do not exist. I can't go any further with my program until I resolve this issue. Any assistance would be appreciated.use package For example pjb is my initals. I like to have top package of all my programs.
At the top of the java file of NotePad.java, should be
package pjb.apps.NotePad;Make sure that java file and compiled class file is in that directory
\pjb\apps\NotePad.java
\pjb\apps\NotePad.class
\pjb\apps\Calculator.class
Ok Now with your imports do the following. A made up JOS program requires apps to use.
\pjb\os\jos.java
\pjb\os\jos.class
In the jos.java i have
import pjb.apps.*;
...jos coding
public void showAppCalculator() {
Calculator josCalculator = new Calculator();
josCalculator.show();
...jos codingAnother example is I just want NotePad imported
import pjb.apps.NotePad;
...jos coding
public void showAppNotePad() {
NotePadjosNotePad = new NotePad();
josCalculator.show();
...jos codingor make sure the the classes are all in the same directory as your application program.
See http://java.sun.com/docs/books/tutorial/java/interpack/index.html
for more details about packages.
Hope it helps :) -
How can i import Customer/Vendor Opening Balances - Invoice wise
I am going on a parallel run from next week onwards and the Client want to import all Customer/Vendor Opening Balances invoice wise , so that they can get the Aging Analysis report the no of days Outstanding as well as they can enter payment invoice wise.
Sanjay,
To import BP Opening Invoices or Credit Memo's,
Use the template inside DTW folder
\Templates\oInvoices for AR Invoices
\Templates\oPurchaseInvoices for AP Invoices
and so on
I presume you would want to import them as Service Invoice so
In the Document template
Set
DocNum....................................DocType......................HandWritten
original Invoice number...............dDocument_Service..............tYes
Document_lines
AccountCode
Opening Balance Account Code (Opening Balance Account is generally created in the Equity drawer and is used purely for all Opening trasactions and will balance out to zero (0) once all opening data from legacy system has been brought over)
Let me know if you need further direction
Suda -
Can I import custom components from Flash 8?
I'm creating a custom Flash Video Playback component in Flash
8 using AS2. I understand that I cannot import this to Flex as
stated in Livedocs: "You can use SWC files created in Flash 8 only
for skinning, not as components. Until the next version of Flash is
released, you can only use SWC files created in Flex 2 as
components."
But now that Flash 8 supports AS3 with the new Adobe Labs
add-on, if I create the custom component using AS3 in Flash 8, can
I then import it and use it in Flex 2.0.1?
Any help is appreciated,
Thanks!To add to this topic :), since AVM for flash 8 and flash 9
are different, swf files in as3 and as2 live in different worlds.
This means you can load flash 8 movies at runtime but you wont be
able to control them at all, just as if they where a JPG file. So
in order to have some interaction, the best option is to recompile
the SWF in flash 9. You might need to do a lot of reprogramming
though.
As a work around the AS3 team suggest to use LocalConnection
between them, but to my opinion this might require the same
rewriting effort as to transform the movie to flash 9 on the first
place. -
How can I import my class or package in JSP?
Hello.
I develop jsp. When I assign variables in jsp, everything work fine. For Example:
connStr="jdbc:oracle:thin:@191.168.0.1:1521:orcl";
But I want put some variables inside class or package, so using text editor I created and compiled package:
package Pack1;
public class Test1 extends java.lang.Object {
public static void main(String[] args) {
String ConnStr = "jdbc:oracle:thin:@191.168.0.1:1521:orcl";
or class
class Test1 {
public static void main(String[] args) {
String connStr = "jdbc:oracle:thin:@191.168.0.1:1521:orcl";
But as soon as I put in my jsp line
<%@ page import="Test1" %> or <%@ page import="Pack1.*" %>
I always have an error.
JSP Error:
Request URI:/DateN/search/Search.jsp
Exception:
oracle.jsp.provider.JspCompileException:
Errors compiling:e:\orant\oem8i\apache\apache\htdocs\daten\_pages\_daten\_search\_Search.java
C:\orant\oem8i\apache\apache\htdocs\daten\_pages\_daten\_search\_Search.java:12: Package DateN not found in import.
import Pack1.*; (or Test1)
^
1 error
I using OEM2.2 with Apache-Server under Win2000. I put my classes:
Test1 in package: in folder: C:\orant\oem8i\Apache\Apache\htdocs\WEB-INF\classes\Pack1
If just class, when just in folder: C:\orant\oem8i\Apache\Apache\htdocs\WEB-INF\classes
If I using just class, when I put just in folder: C:\orant\oem8i\Apache\Apache\htdocs\WEB-INF\classes.
Im stack. Anybody can help?
Thank you.Another way. You can use a USB flash drive & the camera connection kit.
Plug the USB flash drive into your computer & create a new folder titled DCIM. Then put your movie/photo files into the folder. The files must have a filename with exactly 8 characters long (no spaces) plus the file extension (i.e., my-movie.mov; DSCN0164.jpg).
Now plug the flash drive into the iPad using the camera connection kit. Open the Photos app, the movie/photo files should appear & you can import. (You can not export using the camera connection kit.)
Secrets of the iPad Camera Connection Kit
http://howto.cnet.com/8301-11310_39-57401068-285/secrets-of-the-ipad-camera-conn ection-kit/
Cheers, Tom -
How can i import my classes in jsp?
Dear All,
i want to access my classes in jsp. i am using apache tomcat
server. let me know where i have to put my own packages and
how can i use them in jsp.
thanksPut them in directory /WEB-INF/classes under you webcontext. You can use them in your jsp by importing them or using the useBean directive.
Maybe you are looking for
-
Lately I've noticed that when I open Safari Browser, items in my toolbar (back/forward, Home, Print, etc.) disappear. It happened few times. I had to reinstall them by using Customize Toolbar function. Any ideas what can be the cause?
-
in file to file. i am sending multiple file with different file name and in target side the same file names should be displayed.help me how to solve problem
-
Compilation error in a function due to simple IF-ELSEIF condition
DB version:10gR2 I have created the below mentioned function to activate or deactivate a custom functionality in a package. The functionlity should be activated only if the second byte of sys_config.flag_a ='Y' with CODE_ID='103'. If flag_a is null o
-
Problem With a Canvas Pane.
Hello. I need implement a Print Preview for my application, and I use a Canvas Pane for perform the custom painting. Everything works very well, with the exception that the canvas, is drawing outside of the bounds of the scrool panel who contains it.
-
Reuse of existing packages for saving data?
Hi, I'm pretty new to APEX so I lack the in-depth know-how how to do certain tasks. We want to build a simple management application for a customer and reuse as much code as possible to keep the price low. For example, there are procedures in package