Package structure

Well i actually develop a soft and i have a little question about packages structure.
My application is composed is composed of a main JFrame with a JDesktopPane and
a primary JInternalFrame. Some others JIF are used and in order to make it clear,
i try to use this structure for the implementation.
In my main directory, the Gui is placed. All the JIF are placed in a subdirectory called
GuiFrames (and also as a package GuiFrames). For some reasons, I have to give the Gui class
as argument to the JIF in order to keep a link to the main frame when switching from one
JIF to another (there will be only one JIF visible in the JFrame).
The problem is that the reference i use (ie the mainclass name) throw me to a
"can't resolve symbol ..." problem. I don't know how to make a reference to a class that is just above in such a structure.
let's resume it through this small draw :
MainClass.java
|
|
--> Package GuiFrames
.... |
.... --> JIFrameOne.java
.... |
.... --> JIFrameTwo.java
.... |
.... --> JIFrameThree.java
.... |
.... --> JIFrameFour.java
.... |
.... --> JIFrameFive.java
In each JIFramexxxx.java, i need a link to MainClass.java, but MainClass.java can't be found from the package GuiFrames.
Any suggestion would be welcome.
Marc.
PS: the easiest way would be to put all the JIF in the same directory as the MainClass, but i would avoid this for some development reasons.

Put your MainClass in a specified package (instead of the default, nameless package as you have now) and import it in your JIFrame... classes.
package MyPackage
|
--> MainClass.java
.... |
.... --> package GuiFrames
.... .... |
.... .... --> JIFrameOne.java
so the source code looks like:
// MainClass.java
package MyPackage;
public class MainClass {
// JIFrameOne.java
package MyPackage.GuiFrames;
import MyPackage.MainClass;
public class JIFrameOne {
}Jesper

Similar Messages

  • Error: A file found in a source-path must have the same package structure

    I use Adobe Flex Compiler (mxmlc) Version 4.1.0 build 16032,I have a file,named CustomGraphContainerController.as,it's directory is c:\controllers,and the GCController.as file is under the same directory,CustomGraphContainerController.as file like follows
    package controllers{
    import ui.GraphControlContainer;
    public class CustomGraphContainerController extends GCController {
      public function CustomGraphContainerController(a_graphControlContainer:GraphControlContainer) {
       super(a_graphControlContainer);
    Then I want to use mxmlc command to compile it,like follows:
    C:\>mxmlc c:\controllers\CustomGraphContainerController.as
    But it raise compile errors,like follows:
    Loading configuration file C:\sdk\frameworks\flex-config.xml
    C:\controllers\GCController.as: Error: A file found in a source-path must have the same package structure '', as the definition's package, 'controllers'.
    I don't know how to compile the as file with package controllers? Where is wrong? How to use mxmlc to compile it?
    Thanks

    HI,
         You should have one main application class to compile this as code to swf.. So that main application path should be in your proper package structure.. then you can compile you app and as files also...
    Thanks
    Ram..

  • What is package structure for Client ABAP Proxy?

    1.     What is the package structure need to be  followed for creating abap client proxy.
    2.     I read some where in the form, it need to be 4 levels. Why is it?
    Thank you
    Ganges Leaves

    Hi
    U hav to create a 4 level package structure for client ABAP proxy.
    U can create ur on packages
    1st level-structure package.
    2nd level-main package.
    3rd and 4th level-sub packages.
    To the 4th level only u hav to create proxy.
    The classes and code wil be automatically generated at the time of proxy creation.
    I think the 4 level structure bcz while in r/3 everythin in integration builder like software component version and all wil be takin as different levels.
    Also u can go through the weblogs in the above replies u got.
    Regards
    Victoria.

  • Creation of package structure for ABAP proxy scenario

    Hi All,
    I have a doubt on package structure used for ABAP proxy scenario. What is the specific reason to create a four level package structure? Can some one please explain? Thanks in advance.
    Regards,
    Sudheer.

    Hi Sudheer,
    Can you pls clarify what do you mean by 'four level package structure' ?
    Are you referring to the ABAP structures that get created during creating the proxy by SPROXY transaction ? These structures get automatically created. We simply have to write the code using these structures.
    Or do you mean the 'package' which is mandatory to create a transportable ABAP object ? i.e. transport from Development to Staging and then Production.
    Regards,

  • Creating separate jars from one package structure

    Hello,
    I have the following package structure:
    project
    project.util
    project.mainAll of these packages are in the same classes directory. I would like to create one jar that contains project, one jar that contains project.util and one jar that contains project.main.
    The sub-packages jar correctly (each in its respective jar), however, the jar that supposed to contain ONLY the project package ends up containing the other two packages as well. If I say jar -cvf project.jar -C classes project it takes the entire project hierarchy (including util and main packages). If I say jar -cvf project.jar -C classes project\*.class it says that classes\project\*.class cannot be found. How can I limit the classes being jarred to not include the classes in the subdirectories?
    Please help. Thank you
    Elana

    Please help, anyone!
    Thanks

  • Project / Package structure..

    Hi
    I am currently prototyping some relatively simple BC4J / Struts / JSP applications in JDev.
    I have followed the toystore demo which seems to have a nice clear and logical project / package structure for working with the MVC architecture.
    However, i have found it very difficult to actually recreate this template when building my own prototypes using the built in wizards.
    Example :
    I have a Model.jpr separated into packages for BO / VO / services.
    I want to create my Struts components (action classes and xml config) in a Controller.jpr and my presentation JSPs in a View.jpr
    When using the web-tier wizards (JDev9.03) for a "complete struts based application" i can see no clear way of separating out the components ? It will package up the action classes into a package that i had no choice in creating / naming !?
    I realise that if i use the subset wizards i have more control over where components are created (i.e. create an empty struts-xml, then add individual action classes etc. ) but it seems a shame that we can't do this within the complete application wizard.
    Also,is there a way to create a new package without creating a "empty" business components package ? I have found myself creating the folder structure from windows explorer with a dummy java file in the relevant directory, then importing and editing the class to ensure compliance with my project design ?
    How do you guys achieve these goals ?
    Thanks in advance
    Matt

    Bump.

  • Package structure suitable for entity beans

    hi,
    I have to manage some good number of entity beans ( around 250 )
    is it a good idea to package these beans.
    i mean what number of packages could be an idea one.
    currently we have 5 packages and around 50 beans will be in each.
    can anybody suggest on this..

    package structure should be based more on the business context rather than number of beans. Usually it is of the form..
    org/com.<company_name>.<proj_name>.<context>.entity
    for instance...a good package structe example is
    org.apache.log4j.Category !
    If you have customer and order beans then
    com.walmart.pos.customer.entity
    com.walmart.pos.order.entity
    hth...
    sanjay.

  • Four layered package structure for ABAP proxies

    Hi
    I am trying to generate an outbound ( client ) abap proxy in our WAS 640 based ERP system by pointing to a XI message interface on the XI integration repository. I have a single package ZPROXY ( not a main or a structure package ) created in our ERP system to hold the proxy structures ( classes, interfaces ). I have this package assigned to a transport layer ( a common transport layer through which other ABAP objects are to be transported ). Is it really necessary to have a four layer package structures for proxies to be transported and work in the QA/Production system ?

    Hi Sudheer,
    Can you pls clarify what do you mean by 'four level package structure' ?
    Are you referring to the ABAP structures that get created during creating the proxy by SPROXY transaction ? These structures get automatically created. We simply have to write the code using these structures.
    Or do you mean the 'package' which is mandatory to create a transportable ABAP object ? i.e. transport from Development to Staging and then Production.
    Regards,

  • Loading images inside the package structure

    i am having trouble loading images that are imbedded into the package structure. I am assuming this is possible(99.9% sure)
    the classes are
    cardgameframework/CardGame.class
    cardgameframework/cardsupport/Card.class
    cardgameframework/cardsupport/images/2D.GIF
    cardgameframework/cardsupport/images/2C.GIF
    how do i load 2D.gif and 2C.gif from CardGame
    i tried
    Image i = Toolkit.getDefaultToolkit.getImage(
    "/cardgameframe/cardsupport/images/2C.GIF");
    and
    Image i = Toolkit.getDefaultToolkit.getImage(getClass().getResource(
    "/cardgameframe/cardsupport/images/2C.GIF"));
    but neither of these seem 2 work
    any help would be appreciated

    My initial thought is that you've got the package wrong in your two examples - you've got cardgameframe and not cardgameframework.
    Anyway, I tend to use the latter of your approaches - getClass().getResource("/cardgameframework/cardsupport/images/2D.GIF").
    Be careful of case in your URLs.
    Note that if getResource can't find your file it will return null - ensure that you're getting back a non-null URL:
    URL url = getClass().getResource("/cardgameframework/cardsupport/images/2D.GIF");
    System.out.println("URL: " + url);
    ...If your URL is non-null then the problem will be with the format of your image file (if it is null then you'll get a NullPointerException eventually).
    Hope this helps.

  • HowTo: Use package structure in generated code?

    Hi,
    I'm trying to find out if JCS is meeting my requirements for JSF development. So far it is pretty good, although the lack of support for new components is defeating the purpose of JSF for a great deal.
    One of the most terrible things I encountered so far is the fact that I've been unable to get JCS to create a package structure to contain the generated code. In other words, I want JSC to generate the code in "src/com.foo.bar.my.application" instead of just the root of "src/" (where src/ means the source-folder of my project).
    This is a real drawback.
    Maybe I'm wrong, but in that case it's a plain bug because I can't get it to work.
    Iwan

    Admitedly, Creator does not yet offer much flexibility in terms of user-defined package structure. I know you won't like this, but here's a workaround/hack that almost gets to where you want to be.
    First of all, the binding between jsp file and backing bean is defined by the relative positioning between the two files. A JSP file at the top level folder maps to a backing bean just under the assigned java package name (something like webapplicationxx). If you create a directory structure for your JSPs and create pages in them, Creator will create a corresponding package hierarchy for the backing beans.
    So, one way to contrive a java package structure such as com.foo.bar is as follows (best to start with a new project):
    1. Under the Web Pages folder, create a subfolder hierarchy "foo/bar".
    3. Under the Java Sources folder, rename the top level package to 'com'.
    4. You may now create Web pages in the foo/bar subfolder. You'll probably want to cut & paste the Resources directory into the foo/bar folder if you want to use stylesheets, etc. As the pages are created, notice that a com/foo/bar package structure is created under the Java Sources node where the backing beans are maintained.
    One final note, due to a bug in Creator, renaming the package in step 3 does not properly update references to the old pacakge in SessionBean1.java. These will have to be manually changed in the editor. Also note that the ApplicationBean1 and SessionBean1 files must remain at under to top-level package.
    We acknowledge this deficiency in Creator and are working to fix it in the next release.

  • Changing package structure through scripts

    Hi ,
    I have a project with huge number of files(around 2 thousand).
    I want to change the package structure of my source files.Previously no consistent approach is followed.so i want to correct that now.
    I can map each file to a new package structure.
    example: mypackage\common\sample.java = app\comon\Using this input i want to correct oackage and releated imports in my java files.Can any one help me write the best one
    or even if anyone can point to anything of this sort written earlier it would be of great help to me.
    Thanks in advance.

    ..And I am not looking for a simple search replace
    option...
    as it is very difficult for me to test this project.
    So, I am looking for a reliable way of changing
    package and import statements in the depending filesThis would still be a simple search and replace just with "package " and "import " in front of the package name to search for. But you would still have problems whenever the following is used:
    a.b.c.d.F bogus = new a.nb.c.d.F();As a matter of fact, simple search and replace (as long as it is done on the entire package name and not just parts of it) is probably your best bet, if you do not want to go the IDE way. There would probably still be a few mistakes, but there shouldn't be many (if your mapping is reliable). The other problem is would be if classes in one package are to be split into multiple packages, then have fun with any script you write to do it.

  • Compiling classes in their package structure

    I want to compile all classes using one command line
    I have the file structure.
    With .java files contained in two packages
    com.mine.FoldOne
    com.mine.FoldTwo so in the system
    C:/javaProj/src/com/mine/FoldTwo
    C:/javaProj/src/com/mine/FoldOne
    And the folder I want to compile too
    C:/JavaProj/classes
    FromC:/JavaProj I have tried javac @javaProj –d classes
    And
    Javac *.java –d classes
    And several variations of this
    Please tell me how I can compile all my packages using one command line.
    Thanks

    user10778915 wrote:
    Thanks for your advise i will look into building it with antIt's a good tool to know as your projects get more complex. However, if you really do just have 2 packages, then, as suggested by jschell, a simple batch script will suffice, and will probably be simpler. If you just want to get something going as quickly as possible, and don't expect a more complex package structure any time soon, ant may be overkill. But if you're going to be working on bigger projects in the near future, it's probably worth cutting your teeth on ant with a simple project now.

  • Custom tags:without package structure,showing error

    Hi evrybdy
    While making a simple jsp using custom tags,if i m keeping my java file wothout package structure it is giving jasper exception.On the contrary if i m keeping it inside pckg structure it is working properly.Any idea why so???????

    This reason would be why so: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4361575
    Basically you can't access classes in the 'unnamed' package from classes which are in a 'named' package.
    JSPs always compile into servlets in a 'named' package.
    Your classes should always be in a package structure.

  • How can i get the package structure(much complex)?

    I have a oracle package, which is called SPK_A.
    its structure as below:
    SPK_A...T_A1(table)
    ..............T_A2(table)
    ..............FUN_A1(function)
    ..............FUN_A2(function)
    ..............SPK_B(package)...FUN_B1(function)
    ..........................................FUN_B2(function)
    ..........................................T_B1(table)
    ..........................................T_B2(table)
    I have tried to write the sql with data ditionary(dba_dependencies).
    but i failed finaly.
    Because it can only decribe the reference by the package,
    and i found there are 2 problems with "dba_dependencies":
    1.the relationship between them are not necessarily filiation;
    2.It doesn't describe the really package structure;
    Can anyone help me to get the package structure as above?
    Any Ideas Appreciated.
    The sample sql as below:
    create table T_A1
    empno number,
    ename varchar2(10)
    create table T_A2
    deptno number,
    dname varchar2(10)
    create table T_B1
    empno number,
    ename varchar2(10)
    create table T_B2
    deptno number,
    dname varchar2(10)
    create or replace package SPK_B is
    lv_empno T_B1.empno%type;
    lv_deptno T_B2.deptno%type;
    function FUN_B1(in_empno number) return varchar2;
    function FUN_B2(in_deptno number) return varchar2;
    end;
    create or replace package body SPK_B is
    function FUN_B1(in_empno number) return varchar2 is
    lv_ename varchar2(50);
    begin
    select ename into lv_ename from T_B1 where empno=in_empno;
    return lv_ename;
    end;
    function FUN_B2(in_deptno number) return varchar2 is
    lv_dname varchar2(50);
    begin
    select dname into lv_dname from T_B2 where deptno=in_deptno;
    return lv_dname;
    end;
    end;
    create or replace package SPK_A is
    lv_empno T_A1.empno%type;
    lv_deptno T_A2.deptno%type;
    function FUN_A1(in_empno number) return varchar2;
    function FUN_A2(in_deptno number) return varchar2;
    end;
    create or replace package body SPK_A is
    function FUN_A1(in_empno number) return varchar2 is
    lv_ename varchar2(50);
    begin
    lv_ename := SPK_B.FUN_B1(in_empno);
    return lv_ename;
    end;
    function FUN_A2(in_deptno number) return varchar2 is
    lv_dname varchar2(50);
    begin
    lv_dname := SPK_B.FUN_B2(in_deptno);
    return lv_dname;
    end;
    end;
    /

    Use DBMS_UTILITY.GET_DEPENDENCY
    http://www.psoug.org/reference/dbms_utility.html

  • Problem creating package structure and where is my .class file??????

    Working on Tomcat I have my folder structure like this...
    webapps
    ->app_root
    ->WEB-INF
    ->classes
    ->src
    -> .java files
    ->META_INF
    In the command prompt i compile using this
    c:\Program Files\Apache Tomcat 4.0\webapps\Murthy\WEB-INF\classes>javac -d src\*.java
    and in my java files I have the package structure mentioned as
    package com.acme;
    after compiling i expected this to happen for me.
    webapps
    ->app_root
    ->WEB-INF
    ->classes (in WEB-INF)
    ->com (in classes)
    ->acme (in com)
    -> .class files (in acme)
    ->src (in WEB-INF)
    -> .java files(In src)
    ->META_INF
    The funiest part for me started he when i compiled the file
    c:\Program Files\Apache Tomcat 4.0\webapps\Murthy\WEB-INF\classes>javac -d src\one.java
    It compiled successfully without giving me any error but no package structure was created and THERE IS NO one.class file anywhere in my system.....Then how did it compile my file and where is the .class file.
    I think am worng somewhere but unable to locate it.
    Can somebody pull me out of thiss stuf??? Need to do it fast.
    Thanx.

    c:\Program Files\Apache Tomcat 4.0\webapps\Murthy\WEB-INF\classes>javac -d src\*.java
    The command you posted does not have a source file specification. You are telling the compiler to put the .class files in src\*.java but you are not specifying any .java files. It looks like your command should be javac -d . src\*.java

Maybe you are looking for

  • What about session memory when using BEA Weblogic connection pooling?

    Hi, consider a web application, allowing database connections via a BEA Weblogic 8.1 application server. The app-server is pooling the oracle connections. The oracle database is running in dedicated server mode. How are the database requests from the

  • Make function inactive at scale==x

    i have some movie clips that when moused over, become visible.  when clicked the clips are clicked on they tween to center-stage and zoom to fill the extent of my stage. one the zoom completes, i'd like the mouse over effect and function to no longer

  • I can boot, i can login, but every thing keeps flashing..!!

    its all happened after the upgrade to 10.5.1, it was working so fine before on my G4 iMac, now when i log it to one of my two users, the admin one, it reaches to the desktop, shows the files and folders, menus, dock, but the wheel keeps spinning, and

  • ALSB 2.5 - routing request containing multipart/form-data

    Hello, I'm having difficulty routing a request (multipart/data-form with 2 MIME sections) in a business service. First, I set up the "attachments" variables in a stage: <ctx:attachments> <ctx:attachment> <ctx:Content-Disposition>form-data; name="RI";

  • Security context issue when executing a SQL command in SQLCMD

    Simplified core issue below: I have myscript.sql that has: SELECT name FROM Sys.Databases GO USE mydatabase GO EXEC mystoredprocedure 'myparameter' GO When I open cmd.exe and use: SQLCMD -S localhost\myinstance -i script.sql It executes fine. When I